摘要: CF Problem - 225C - Codeforces dp好题 算个前缀和,一块一块的算就行了 #include <bits/stdc++.h> using namespace std; #define LL long long #define double long double #def 阅读全文
posted @ 2026-03-10 23:39 Seren_blingbling 阅读(2) 评论(0) 推荐(0)
摘要: CF Problem - 1473D - Codeforces 前缀最大值,后缀最大值 前缀最小值,后缀最小值 注意:要后缀要减去删掉的值 #include <bits/stdc++.h> using namespace std; #define LL long long #define doubl 阅读全文
posted @ 2026-03-09 21:28 Seren_blingbling 阅读(4) 评论(0) 推荐(0)
摘要: CF Problem - 1473D - Codeforces 前缀最大值,后缀最大值 前缀最小值,后缀最小值 注意:要后缀要减去删掉的值 #include <bits/stdc++.h> using namespace std; #define LL long long #define doubl 阅读全文
posted @ 2026-03-09 09:37 Seren_blingbling 阅读(3) 评论(0) 推荐(0)
摘要: CF Problem - 615B - Codeforces 因为题目要求尾巴是一条,且保证编号是单调递增的 所以按编号小到编号大,建立有向边 再计算每个点为终点的最大长度 #include <bits/stdc++.h> using namespace std; #define LL long l 阅读全文
posted @ 2026-03-08 11:20 Seren_blingbling 阅读(1) 评论(0) 推荐(0)
摘要: CF Problem - 466C - Codeforces 前缀和,三等分 #include <bits/stdc++.h> using namespace std; #define LL long long #define double long double #define endl '\n' 阅读全文
posted @ 2026-03-07 20:00 Seren_blingbling 阅读(7) 评论(0) 推荐(0)
摘要: CF Problem - 685A - Codeforces 剪枝加暴力 看到\(n,m\le 1e9\),完全没有想法,看了题解才发现,要保证数字全部不同,最多也只有\(7^7=823543\),所以可以直接用 \(O(nm)\) 暴力解决 #include <bits/stdc++.h> usi 阅读全文
posted @ 2026-03-06 09:55 Seren_blingbling 阅读(3) 评论(0) 推荐(0)
摘要: CF Problem - 1491C - Codeforces 差分:时间复杂度为\(O(n)\) 用lst存差分前缀和,贪心解决 记得多测清空b数组!!! #include <bits/stdc++.h> using namespace std; #define LL long long #def 阅读全文
posted @ 2026-03-06 09:55 Seren_blingbling 阅读(3) 评论(0) 推荐(0)
摘要: CF Problem - E1 - Codeforces 暴力找最小字典序的字符串 #include <bits/stdc++.h> using namespace std; #define LL long long #define double long double #define endl ' 阅读全文
posted @ 2026-02-10 16:03 Seren_blingbling 阅读(2) 评论(0) 推荐(0)
摘要: CF Problem - 1695C - Codeforces 一道小清新的题,要找一条和为0的路径,因为都是1和-1 所以只需要找到从(1,1)到(n,m)的最小路径和mn[n][m]和最大路径和mx[n][m] 如果满足mn[n][m]<=0<=mx[n][m],即找的到 #include <b 阅读全文
posted @ 2026-02-10 16:03 Seren_blingbling 阅读(1) 评论(0) 推荐(0)
摘要: CF Problem - 1969C - Codeforces 关键在k很小 所以可以找关于i的前k个可能的最小值 时间复杂度为\(O(n\times k^2)\) #include <bits/stdc++.h> using namespace std; #define LL long long 阅读全文
posted @ 2026-02-10 16:03 Seren_blingbling 阅读(2) 评论(0) 推荐(0)