随笔分类 -  其他——模拟赛

摘要:题目链接 T1 贪心或二分答案 #include <algorithm> #include <cstring> #include <cctype> #include <cstdio> #define N 100005 using namespace std; int n; struct node { 阅读全文
posted @ 2017-10-25 16:09 杀猪状元 阅读(182) 评论(0) 推荐(0)
摘要:题目链接 T1 考虑遇到一个首位为奇数的233或者或者223 会发生两者之间的相互转变 那么只需要考虑剩余的操作数的奇偶性即可 #include<cstring> #include<cstdio> #define N 1000010 int n,k; char ch[N]; int main() { 阅读全文
posted @ 2017-10-20 16:28 杀猪状元 阅读(197) 评论(0) 推荐(0)
摘要:题目链接 T1 经过打表发现f(x)=x (x>=2) f(1)=2; 然后问题就变为 ∑f(i)^k 拉格朗日插值法。。学习地址 #include <cstdio> #include <cctype> #define Mod 998244353 inline void read(register 阅读全文
posted @ 2017-10-19 16:10 杀猪状元 阅读(225) 评论(0) 推荐(0)
摘要:题目链接 T1 博弈论+概率dp 对于第一问:f[i][j]表示前i个数,当前黑板上的数为j的概率 当前有三种情况 1. 当前数不是j的倍数—>黑板上的数字改变。 2. 当前数是j的倍数且当前数在前i个数中(已经选过) 3. 当前数是j的倍数且没有选过 转移:f[i+1][j]=((j的倍数个数-i 阅读全文
posted @ 2017-10-18 15:15 杀猪状元 阅读(187) 评论(0) 推荐(0)
摘要:题目链接 T1 统计前缀和 以及 后缀的0的数量 答案显然就是min{当前位置1的个数+当前位置后的零的个数} 加个特判 当全都是0或1时 输出0 #include <cstring> #include <cstdio> #define N 100005 char str[N]; int ans,l 阅读全文
posted @ 2017-10-17 15:01 杀猪状元 阅读(240) 评论(0) 推荐(0)
摘要:题目链接 T1 排序后二分 #include <algorithm> #include <cstdio> #include <cctype> #define N 200100 using namespace std; inline void read(int &x) { bool f=0;regis 阅读全文
posted @ 2017-10-16 19:21 杀猪状元 阅读(181) 评论(0) 推荐(0)
摘要:题目链接 T1 容斥原理,根据奇偶性进行加减 #include<iostream> #include<cstdio> using namespace std; typedef long long ll; typedef long double ld; #define rep(i,a,n) for(i 阅读全文
posted @ 2017-10-10 17:49 杀猪状元 阅读(171) 评论(0) 推荐(0)
摘要:题目链接 T1 Sort 一下与原数组比较 ,若有两个数或者没有数发生位置交换 ,则输出YES ,否则输出NO #include <algorithm> #include <cctype> #include <cstdio> #define N 1005000 int n, cnt1, cnt2, 阅读全文
posted @ 2017-10-10 17:46 杀猪状元 阅读(178) 评论(0) 推荐(0)
摘要:题目链接 T1 维护一个单调栈 #include <iostream> #include <cstdio> #define N 500000 #define rep(a,b,c) for(int a=b;a<=c;++a) #define Rep(a,b,c) for(int a=b;a>=c;-- 阅读全文
posted @ 2017-10-10 17:29 杀猪状元 阅读(218) 评论(0) 推荐(0)
摘要:题目链接 T1 #include <cstring> #include <cstdio> #define N 105000 int L,R; char s[N]; int main() { freopen("bracket.in","r",stdin); freopen("bracket.out", 阅读全文
posted @ 2017-10-10 17:25 杀猪状元 阅读(171) 评论(0) 推荐(0)
摘要:题目链接 T1 #include<cstdio> #include<cstdlib> #include<cstring> using namespace std; long long n; #ifdef unix #define LL "%lld" #else #define LL "%I64d" 阅读全文
posted @ 2017-10-10 17:15 杀猪状元 阅读(130) 评论(0) 推荐(0)
摘要:题目链接 T1 #include <cstdio> #define N 1000500 char s[N]; int n,last[26],sum[26],pr[26][26],minv[26][26]; int max(int a,int b){return a>b?a:b;} int main( 阅读全文
posted @ 2017-10-10 17:06 杀猪状元 阅读(147) 评论(0) 推荐(0)
摘要:T1 屠龙宝刀点击就送 树状数组求逆序对+大特判 T2 屠龙宝刀点击就送 暴力dfs T3 屠龙宝刀点击就送 正解dp。。自动弃疗 #include <cstring> #include <cstdio> #define N 1505 int pos[27][N],num[27],n,q; char 阅读全文
posted @ 2017-09-05 21:44 杀猪状元 阅读(191) 评论(0) 推荐(0)
摘要:最水的一次模拟赛。。 点击查看题目 T1 求最后K位 那前面的数是没有比要求的 , 我们就把 10k 作为模数 ,对答案进行取模 就好了 T2 求满足条件的x值 移项之后用三重循环把左边能取到的值计数, 这里会取到负数 于是本弱鸡使用了map。 最后三重循环求右边的取值 , 累加结果 T3 k>=n 阅读全文
posted @ 2017-07-22 16:52 杀猪状元 阅读(182) 评论(0) 推荐(0)
摘要:1.正确答案 【题目描述】 小H与小Y刚刚参加完UOIP外卡组的初赛,就迫不及待的跑出考场对答案。 “吔,我的答案和你都不一样!”,小Y说道,”我们去找神犇们问答案吧”。 外卡组试卷中共有m道判断题,小H与小Y一共从其他n个神犇那问了答案。之后又从小G那里得知,这n个神犇中有p个考了满分,q个考了零 阅读全文
posted @ 2016-11-14 19:52 杀猪状元 阅读(278) 评论(0) 推荐(0)
摘要:笔记【问题描述】给定一个长度为m的序列a,下标编号为1~m。序列的每个元素都是1~n的整数。定义序列的代价为m−1 ∑|ai+1-ai| i=1 你现在可以选择两个数x和y,并将序列a中所有的x改成y。x可以与y相等。请求出序列最小可能的代价。【输入格式】输入第一行包含两个整数n和m。第二行包含m个 阅读全文
posted @ 2016-11-13 17:25 杀猪状元 阅读(266) 评论(0) 推荐(0)
摘要:第一题 背单词 (word.c/cpp/pas) 【题目描述】 fqk 退役后开始补习文化课啦, 于是他打开了英语必修一开始背单 词。 看着满篇的单词非常头疼, 而每次按照相同的顺序背效果并不好, 于是 fqk 想了一种背单词的好方法!他把单词抄写到一个 n 行 m 列的 表格里,然后每天背一行或者 阅读全文
posted @ 2016-11-09 20:34 杀猪状元 阅读(276) 评论(0) 推荐(0)