随笔分类 -  Codeforces

摘要:Pinely Round 4 (Div. 1 + Div. 2)(A - F) A - Maximize the Last Element 解题思路: 只有奇数位置能选。偶数位置前后都有奇数个数字,无法删完。 代码: #include <bits/stdc++.h> using namespace 阅读全文
posted @ 2024-07-29 17:58 value0 阅读(144) 评论(0) 推荐(0)
摘要:Codeforces Round 960 (Div. 2)(A - D) A - Submission Bait 解题思路: 假设直接选最大数,如果最大数有奇数个,\(Alice\)必胜,反之必败。 根据这个思路,从大到小看数字,找到第一个出现奇数次的数,从它开始选,就能保证每次\(Alice\)选 阅读全文
posted @ 2024-07-21 17:39 value0 阅读(65) 评论(0) 推荐(0)
摘要:Educational Codeforces Round 167 (Rated for Div. 2) A. Catch the Coin 解题思路: 最终\(x\)一定会相等,我们考虑直接到下面接住他。 代码: #include <bits/stdc++.h> using namespace st 阅读全文
posted @ 2024-06-28 10:33 value0 阅读(772) 评论(1) 推荐(2)
摘要:Codeforces Round 955 (Div. 2, with prizes from NEAR!) A. Soccer 解题思路: \(a\)区间为\([x_1, x_2]\),\(b\)区间为\([y_1, y_2]\)。二者不相交则不可能出现同分。 代码: #include <bits/ 阅读全文
posted @ 2024-06-26 00:58 value0 阅读(568) 评论(0) 推荐(0)
摘要:Codeforces Round 934 (Div. 2) A - Destroying Bridges 解题思路: 完全图每个点的连边数为\(n - 1\)。 \(k < n - 1\):都可到达。 \(k \geq n - 1\):将点\(1\)的边删完,只能呆在点\(1\)。 代码: #inc 阅读全文
posted @ 2024-03-17 14:02 value0 阅读(431) 评论(0) 推荐(0)
摘要:Educational Codeforces Round 163 (Rated for Div. 2) A - Special Characters 解题思路: 一个相同的连续段会贡献两个特殊字符,所以答案一定是偶数,找个不同的数分隔开即可。 代码: #include <bits/stdc++.h> 阅读全文
posted @ 2024-03-16 08:09 value0 阅读(508) 评论(1) 推荐(0)
摘要:Codeforces Round 933 (Div. 3) A - Rudolf and the Ticket 解题思路: 暴力。 代码: #include <bits/stdc++.h> using namespace std; using ll = long long; using pii = 阅读全文
posted @ 2024-03-12 22:29 value0 阅读(93) 评论(0) 推荐(0)
摘要:Codeforces Round 932 (Div. 2) A - Entertainment in MAC 解题思路: 如果翻转字符小于原字符,那么一直翻转即可。 否则,翻转\(n - 1\)次,然后添加一次。 代码: #include <bits/stdc++.h> using namespac 阅读全文
posted @ 2024-03-06 12:15 value0 阅读(62) 评论(0) 推荐(0)
摘要:Codeforces Round 931 (Div. 2) A - Too Min Too Max 解题思路: 最大、最小、次大、次小。 代码: #include <bits/stdc++.h> using namespace std; using ll = long long; using pii 阅读全文
posted @ 2024-03-02 01:09 value0 阅读(268) 评论(0) 推荐(0)
摘要:Codeforces Round 930 (Div. 2) A - Shuffle Party 解题思路: \(1\)会按着\(2\)的整数次幂往后跳。 代码: #include <bits/stdc++.h> using namespace std; using ll = long long; u 阅读全文
posted @ 2024-03-01 00:35 value0 阅读(622) 评论(0) 推荐(1)
摘要:Educational Codeforces Round 160 (Rated for Div. 2) A - Rating Increase 代码: #include <bits/stdc++.h> using namespace std; typedef long long ll; const 阅读全文
posted @ 2024-02-29 09:59 value0 阅读(20) 评论(0) 推荐(0)
摘要:Codeforces Round 929 (Div. 3) A - Turtle Puzzle: Rearrange and Negate 代码: #include <bits/stdc++.h> using namespace std; using ll = long long; using pi 阅读全文
posted @ 2024-02-29 08:42 value0 阅读(85) 评论(0) 推荐(1)
摘要:Educational Codeforces Round 162 (Rated for Div. 2) A - Moving Chips 解题思路: 模拟一下,不难发现是\(1\)之间\(0\)的个数。 代码: #include <bits/stdc++.h> using namespace std 阅读全文
posted @ 2024-02-24 23:15 value0 阅读(232) 评论(0) 推荐(1)
摘要:Codeforces Round 927 (Div. 3) A - Thorns and Coins 解题思路: 出现连续两个障碍之前,所有金币都能拿到。 代码: #include <bits/stdc++.h> using namespace std; using ll = long long; 阅读全文
posted @ 2024-02-19 19:40 value0 阅读(117) 评论(0) 推荐(0)
摘要:Codeforces Round 925 (Div. 3) A - Recovering a Small String 解题思路: 枚举. 代码: #include <bits/stdc++.h> using namespace std; using ll = long long; using pi 阅读全文
posted @ 2024-02-14 13:51 value0 阅读(78) 评论(0) 推荐(1)
摘要:Codeforces Round 924 (Div. 2) A - Rectangle Cutting 解题思路: 初始矩形长宽为\((a,b)\),如果我们切\(a\),那么一定不能再拼接\(a\),否则一定一样。所以我们拼接\(b\),即将\(a\)对半分开得到两个\((\frac{a}{2}, 阅读全文
posted @ 2024-02-11 19:51 value0 阅读(367) 评论(0) 推荐(1)
摘要:Codeforces Round 921 (Div. 2) 推荐题解 A - We Got Everything Covered! 解题思路: 以前\(k\)个字符都出现过至少一次为一轮,构造\(n\)轮即可。 代码: #include <bits/stdc++.h> using namespace 阅读全文
posted @ 2024-01-28 21:16 value0 阅读(132) 评论(0) 推荐(0)
摘要:Educational Codeforces Round 161 (Rated for Div. 2) A - Tricky Template 代码: #include <bits/stdc++.h> using namespace std; using ll = long long; using 阅读全文
posted @ 2024-01-19 00:41 value0 阅读(114) 评论(0) 推荐(1)
摘要:Codeforces Round 920 (Div. 3) A - Square 解题思路: 取左下角和右上角。 代码: #include <bits/stdc++.h> using namespace std; using ll = long long; using pii = pair<ll, 阅读全文
posted @ 2024-01-18 16:09 value0 阅读(18) 评论(0) 推荐(0)
摘要:Codeforces Round 919 (Div. 2) A. Satisfying Constraints 解题思路: 确定最大下界和最小上界。 然后看有多少个不可选数在界内。 代码: #include <bits/stdc++.h> using namespace std; using ll 阅读全文
posted @ 2024-01-14 00:53 value0 阅读(187) 评论(0) 推荐(2)