随笔分类 - codeforces
摘要:Olympiad Olympiad 输出除0以外的数字种数即可。 Vile Grasshoppers Vile Grasshoppers 猜想答案离y不会很远。暴力枚举答案, $O(\sqrt n)$验证,如果有因数落在区间$[2,p]$里就不合法。 Save Energy! Save Energy
阅读全文
摘要:A.模拟 B.只要有一个数字出现的次数是奇数就不会输。 C.因为n的二进制位上最多只有1000个1,所以我们可以暴力预处理出$1 \cdots 1000$变成$1$的步数。 枚举n的每一位。如果这一位是1,把它变成0就可以保证一定比n小。比i高的位跟n一样,计算从低位选出若干个1的方案数。 D.线段
阅读全文
摘要:Educational Codeforces Round 36 (Rated for Div. 2) F. Imbalance Value of a Tree You are given a tree T consisting of n vertices. A number is written o
阅读全文
摘要:A.模拟。 B.模拟。比赛的时候这题出锅了,然后就unrated了。注意要先保证最大值最小,再保证字典序最大。 C.构造。挑一个大于N的质数然后连啊连就可以了。 D.可持久化Trie。弄两个Trie。一个记录字符串,另一个记录数字。 E.跟bzoj上的遥远的国度很类似。
阅读全文
摘要:A. Modular Exponentiation $2^n$很大的时候直接输出$m$, 不然就把$2^n$算出来。 B. Christmas Spruce 没什么可说的。 C. Party Lemonade C. Party Lemonade 感觉有点厉害。如果$2c_{i-1}<c_i$ ,那么
阅读全文
摘要:好久没打cf了,又打了一把。终于又涨rating了,很开心。 A 贪心 1 #include<cstdio> 2 #include<iostream> 3 using namespace std; 4 int main() { 5 int n, a, b, c, ans = 0; 6 scanf("
阅读全文
摘要:A 膜你 1 #include<cstdio> 2 #include<iostream> 3 using namespace std; 4 5 int main() { 6 int a, b, c, n, ans = 0; 7 scanf("%d %d %d", &a, &b, &c); 8 sca
阅读全文
摘要:A 一个if(但是我太弱了 写了一个迷之dfs 1 #include<cstdio> 2 #include<cmath> 3 #include<iostream> 4 using namespace std; 5 6 int ans1, ans2; 7 int t1, t2; 8 int n, t,
阅读全文
摘要:A.模拟 1 #include<cstdio> 2 #include<iostream> 3 using namespace std; 4 5 inline void read(int &ans) { 6 static char ch = getchar(); 7 register int neg
阅读全文

浙公网安备 33010602011771号