摘要: CF Problem - 1555D - Codeforces 如果要使一个字符串的子串都不是回文 假设第一个是a,第二个不能填a,只能填其他,假设填b,第三个只能c 所以最后结果为abcabcabc 一共有6种排列方法 abc acb bac bca cba cab 所以枚举6种情况找最小回文数即 阅读全文
posted @ 2026-01-15 17:42 Seren_blingbling 阅读(0) 评论(0) 推荐(0)
摘要: CF Problem - 431C - Codeforces(dp好题) 注意初始化dp[0][0]=1 #include <bits/stdc++.h> using namespace std; #define LL long long const LL mod = 1e9+7; const in 阅读全文
posted @ 2026-01-13 15:53 Seren_blingbling 阅读(2) 评论(0) 推荐(0)
摘要: CF Problem - 1528A - Codeforces(树形dp好题) #include <bits/stdc++.h> using namespace std; #define LL long long const LL mod = 998244353; const int N=2e5+1 阅读全文
posted @ 2026-01-12 20:49 Seren_blingbling 阅读(8) 评论(0) 推荐(0)
摘要: CF Problem - 1627C - Codeforces(dfs好题)(构造) #include <bits/stdc++.h> using namespace std; #define LL long long const LL mod = 998244353; const int N=1e 阅读全文
posted @ 2026-01-11 23:54 Seren_blingbling 阅读(25) 评论(0) 推荐(0)
摘要: CF Problem - 1452D - Codeforces(dp好题) 题意: 一共n+2个城镇,每个城镇建造无线电塔的概率为1/2,一个城镇建上无线电塔。 信号功率为1时,影响范围为1 信号功率为2时,影响范围为3 信号功率为3时,影响范围为5 要求: 城镇0和n+1没有收到信号 其余每个城镇 阅读全文
posted @ 2026-01-10 21:07 Seren_blingbling 阅读(13) 评论(0) 推荐(0)
摘要: CF Problem - 1452D - Codeforces(dp好题) 题意: 一共n+2个城镇,每个城镇建造无线电塔的概率为1/2,一个城镇建上无线电塔。 信号功率为1时,影响范围为1 信号功率为2时,影响范围为3 信号功率为3时,影响范围为5 要求: 城镇0和n+1没有收到信号 其余每个城镇 阅读全文
posted @ 2026-01-10 11:58 Seren_blingbling 阅读(12) 评论(0) 推荐(0)
摘要: CF Problem - 858C - Codeforces #include <bits/stdc++.h> using namespace std; #define LL long long const LL mod = 998244353; const int N=2e5+10; char y 阅读全文
posted @ 2026-01-09 21:10 Seren_blingbling 阅读(8) 评论(0) 推荐(0)
摘要: CF Problem - 1498C - Codeforces(dp好题) 可以理解为一个能源等级为 \(i\) 的粒子穿过平面时会消失,同时向原方向发射一个能源等级为 \(i\) 的粒子,再向相反方向发射一个能源等级为 \(i-1\) 的粒子,因此可以使用动态规划算法。 #include <bit 阅读全文
posted @ 2026-01-07 12:05 Seren_blingbling 阅读(9) 评论(0) 推荐(0)
摘要: CF Problem - 676C - Codeforces 双指针 此时 \(i\) 为 \(l\),通过for循环更新 记得每次更新cnt if (s[i] == 'b') cnt--; #include <bits/stdc++.h> using namespace std; #define 阅读全文
posted @ 2026-01-06 12:01 Seren_blingbling 阅读(12) 评论(0) 推荐(0)
摘要: CF Problem - 455A - Codeforces 一道dp题 认真读题!!! 题意: 选数字 \(i\),所有数值为 \(i-1\) 和 \(i+1\) 的元素会被删除,所以选了一个 \(i\) ,就可以把其他 \(i\),一起选上 dp[i]:算到 \(i\) 这个数时的最大分数为多少 阅读全文
posted @ 2026-01-05 11:33 Seren_blingbling 阅读(17) 评论(0) 推荐(0)