摘要: CF Problem - 982C - Codeforces(搜索)(dfs) 找最大删除边数,使得每一棵树的顶点数都为偶数 #include <bits/stdc++.h> using namespace std; #define LL long long const LL mod = 99824 阅读全文
posted @ 2025-11-21 19:08 Seren_blingbling 阅读(3) 评论(0) 推荐(0)
摘要: CF Problem - 1418C - Codeforces(dp+贪心好题!)(1500) dp操作,要分开判断先手和后手 #include <bits/stdc++.h> using namespace std; #define LL long long const LL mod = 9982 阅读全文
posted @ 2025-11-19 21:08 Seren_blingbling 阅读(5) 评论(0) 推荐(0)
摘要: CF Problem - 839C - Codeforces(DFS)(1500)(期望) 求期望dp 即求1的(所有孩子的期望+1)的和,除以孩子数量 #include <bits/stdc++.h> using namespace std; #define LL long long const 阅读全文
posted @ 2025-11-17 21:16 Seren_blingbling 阅读(6) 评论(0) 推荐(0)
摘要: Problem - 1924A - Codeforces(构造) 要判断s字符串是否满足是所有前k个字符的子数组 则需要把s分段,每一段都包含前k个字符 如果段数>=n长度,即满足 否则,找最后一段不满足的字符 构造一个不满足的字符串 #include <bits/stdc++.h> using n 阅读全文
posted @ 2025-11-16 21:50 Seren_blingbling 阅读(11) 评论(0) 推荐(0)
摘要: Problem - 1858B - Codeforces(1500)(贪心) 这题一个是要读题 在不包括cookie seller的区间才算没吃饼干的时间sum += (s[i] - s[i - 1] - 1) / d; 在加上路过cookie seller时吃的饼干数 sum += m - 1; 阅读全文
posted @ 2025-11-15 21:10 Seren_blingbling 阅读(7) 评论(0) 推荐(0)
摘要: Problem - 1767D - Codeforces 这题题解都看了好久 要用二叉树的想法来思考 首先字符串s不管是什么样的,只要统计1和0的数目 因为p数组顺序是任意的 所以把s按先1后0排序 接下来只要找最小可能和最大可能 最小:二叉树思想,x个1的话,最小值只能是\(2^x\) 最大:1比 阅读全文
posted @ 2025-11-14 21:29 Seren_blingbling 阅读(4) 评论(0) 推荐(0)
摘要: 1.Problem - 1881E - Codeforces(1500)(dp) dp好题 #include <bits/stdc++.h> using namespace std; #define LL long long const LL mod = 998244353; const int N 阅读全文
posted @ 2025-11-13 21:08 Seren_blingbling 阅读(6) 评论(0) 推荐(0)
摘要: CF Problem - 1084C - Codeforces 简单题,算每一块中a的数量,对于每一块,有选0,1,2……,k种,k+1种选法 #include <bits/stdc++.h> using namespace std; #define LL long long const LL mo 阅读全文
posted @ 2025-11-11 11:57 Seren_blingbling 阅读(5) 评论(0) 推荐(0)
摘要: CF Problem - 1739C - Codeforces(1500)(dp)(博弈) 菜菜的,答案都理解了老半天,明明是一个不太难的dp 难在博弈,要想明白平局是BAAB,从大到小分牌 #include <bits/stdc++.h> using namespace std; #define 阅读全文
posted @ 2025-11-09 21:09 Seren_blingbling 阅读(7) 评论(0) 推荐(0)
摘要: 2025.11.8把二分重新梳理了一遍(董晓算法的板子,好用!!!) 阅读全文
posted @ 2025-11-08 21:18 Seren_blingbling 阅读(6) 评论(0) 推荐(0)