随笔分类 - codeforces
摘要:传送门 A - Everyone Loves to Sleep 判断一下哪个时间离得最近,如果时间比当前时间还前的话,就加上一天的时间 #include <iostream> #include <vector> #include <array> using namespace std; int ma
阅读全文
摘要:传送门 最近没进入状态,好久没更新博客了,有点开摆的感觉,不过集训期间肯定会认认真真打的 多校的题目是真的难顶 A - Three Doors 模拟一下 #include <iostream> #include <cstdio> #include <algorithm> #include <vect
阅读全文
摘要:传送门 A. YES or YES? 统一一下大小写 #include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <string> #include <queue> #include <f
阅读全文
摘要:传送门 第一次赛中 AK div3,值得纪念! 赛后发现有很多题想的不是很周到,所以晚发了这么久 A - Round Down the Price 找到一个不大于当前数字的 10 的次幂 #include <iostream> #include <cstdio> #include <algorith
阅读全文
摘要:传送门 A - Grass Field 每次清除一行一列,最多也就清除 2 次,判断一下就好了 #include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <string> #includ
阅读全文
摘要:传送门 考试周也快结束了,想打一场 cf 找一找手感,结果惨不忍睹,大寄 刚好这场前 4 题都是思维题,直接卡死 A - XOR Mixup 这样构造出来的数组异或和一定为 0,说明每一个数都是答案 #include <iostream> #include <cstdio> #include <al
阅读全文
摘要:传送门 现在还在 hack 期间,要是被 hack 了就再更新代码 G 还挺感兴趣的,找时间看看题 A - Print a Pedestal (Codeforces logo?) 对 3 取模的三种情况进行构造 #include <iostream> #include <cstdio> #inclu
阅读全文
摘要:传送门 感觉这一场的题目真的非常棒,找时间一定要把 E 也给补了(除非看完答案还是不会),虽然现在还没看,但是前几题的质量让我有继续做下去的欲望 更新:E 题已经补了,感觉还挺不错 A. Beat The Odds 要么全是奇数,要么全是偶数,看着哪个少就删哪个 #include <iostream
阅读全文
摘要:传送门 A. Game with Cards 看最大的在谁那,谁就赢 如果最大的都一样,则先手赢 #include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <string> #inclu
阅读全文
摘要:传送门 A. Digit Minimization 一开始以为是只能换相邻的,wa 了好多发 如果是 n = 2 的话,只能是第二个 其他的情况就都是最小的那个,把最小的放到第一个,然后剩下的慢慢磨 #include <iostream> #include <cstdio> #include <al
阅读全文
摘要:传送门 A. AvtoBus 直接判断就好了,大的话就尽量用4,小的话就尽量用6,然后根据取余的关系找就行了 #include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <string>
阅读全文
摘要:传送门 想不到这次居然还能把 E 整出来,怀疑 D E 题是不是反了 上大分 A. Minimums and Maximums 大概就是两个区间之间判断一下交点,其实数据量很小,直接 for 循环跑一边都行 #include <iostream> #include <cstdio> #include
阅读全文
摘要:传送门 上次打了一场校赛,刚好和上次的 div2 冲了,最近又各种 ddl 轰炸,搞得没啥时间写题解 这场打下来感觉就是各种模板题 A. Lucky? 直接写,前三个数字的和等于后三个数字的和 #include <iostream> #include <cstdio> #include <algor
阅读全文
摘要:传送门 今天这场的代码写的有点烂,回去也不想重新敲一遍了 A. Prof. Slim 他能交换负号的位置,所以直接把负号放到最前面几个,判断是否非递减就行 #include <iostream> using namespace std; const int maxn = 1e5 + 10; int
阅读全文
摘要:传送门 A. Food for Animals 直接找一下本身够不够,然后不够再拿 c #include <iostream> #include <cstdio> #include <algorithm> #include <vector> #include <string> #include <q
阅读全文
摘要:Codeforces Round #786 (Div. 3) 今天五一集训第三天,找时间把集训的模拟赛整理一下,今晚有div3打星,就来瞧一瞧是啥题 A. Number Transformation 题目大意:给出两个数 x 和 y,问两个值 a 和 b,使得 直接让
阅读全文
摘要:Codeforces Round #785 (Div. 2) 今天五一集训第一天,刚打完一场组队赛,晚上本来想摆了,但是刚好洗完澡就开始了,就顺手写一下 A. Subtle Substring Subtraction 题目大意:两人博弈,A只能删除偶数个字符的子串,B只能删除奇数个字符的子串,a-z
阅读全文