上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 27 下一页
摘要: 题目传送 做法 对于每个人,inc为x,pref为y;对于每道菜,p和s为x,b为y 于是根据题意有$$p[i] include include include include define rep(i, a, b) for (int i = a; i void read(T &x) { x = 0 阅读全文
posted @ 2019-04-09 20:25 AlphaWA 阅读(299) 评论(0) 推荐(0) 编辑
摘要: pi只有0~5000且只找最小的没出现的,又要找不同club的,考虑二分匹配,左边pi,右边ci,一个匹配一个。离线倒着加边即可。 阅读全文
posted @ 2019-04-09 14:29 AlphaWA 阅读(297) 评论(0) 推荐(0) 编辑
摘要: 题目传送 推公式博客传送 推完式子就是去朴素地求就行了Orz C++ const int maxn = 1e5 + 5; const int mod = 1e9 + 7; int m, mu[maxn], vis[maxn], primes[maxn], tot; ll dp[maxn]; vect 阅读全文
posted @ 2019-04-09 11:18 AlphaWA 阅读(198) 评论(0) 推荐(0) 编辑
摘要: bit扫描坐标套路题,注意有重复的点,莽WA了。 C++ const int maxn = 1e5 + 5; struct node { ll B, F, D; bool operator rhs.B; return F 阅读全文
posted @ 2019-04-08 22:23 AlphaWA 阅读(197) 评论(0) 推荐(0) 编辑
摘要: 最小生成树上倍增询问裸的。 阅读全文
posted @ 2019-04-08 22:21 AlphaWA 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 答案只有n 1种暴举即可,对于每种,gcd是一那踩雷稳了,否则看雷的分布有没有把模余占满。 阅读全文
posted @ 2019-04-08 22:19 AlphaWA 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 乍一看很唬人,草稿纸上多写几个发现规律:两个元音算一层,像剥洋葱一样,外面的其实都动不了,能变顺序的只有最里层的辅音。 C++ inline bool ok(char ch) { return ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || c 阅读全文
posted @ 2019-04-08 22:11 AlphaWA 阅读(174) 评论(0) 推荐(0) 编辑
摘要: dp[i][j][k]表示第i位填数字k时,与后面的相连模数为j时,后面的数字最小填多少。 测得我提心吊胆还以为复杂度高了,结果出来46ms还是cf评测姬强啊。 阅读全文
posted @ 2019-04-08 22:01 AlphaWA 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 笔者休息娱乐。贪心即可,爱怎么暴力怎么暴力。莽WA,改了几下算法发现是输出中二了…… C++ int T, color[26], tot; bool adj[26][26]; string s; void get(int cur) { set s; rep(i, 0, T 1) if (adj[cu 阅读全文
posted @ 2019-04-08 19:56 AlphaWA 阅读(356) 评论(0) 推荐(0) 编辑
摘要: 本来我就模拟和搜索恐惧症,场上乍一看调度来调度去的真的吓得没敢写。然鹅赛后听说别的队写得贼短就写了写,真的不难……嘤嘤嘤 C++ include include include include using namespace std; struct Others { int usage, recov 阅读全文
posted @ 2019-04-08 17:42 AlphaWA 阅读(137) 评论(0) 推荐(0) 编辑
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 27 下一页