摘要: Atcoder_ABC230F 点击查看代码 #include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn=2e5+10; const ll mod=998244353; ll dp[maxn], 阅读全文
posted @ 2022-09-06 09:14 lmj_1 阅读(19) 评论(0) 推荐(0)
摘要: 牛客多校训练09 I. The Great Wall II 点击查看代码 #include <bits/stdc++.h> using namespace std; const int maxn=8010; int a[maxn],dp[maxn][maxn]; int pre[maxn]; int 阅读全文
posted @ 2022-08-23 16:17 lmj_1 阅读(21) 评论(0) 推荐(0)
摘要: 1004 Link with Equilateral Triangle 输出No即可 点击查看代码 #include <iostream> #include <algorithm> using namespace std; typedef long long ll; const int mx=3e5 阅读全文
posted @ 2022-07-30 10:36 lmj_1 阅读(57) 评论(0) 推荐(0)
摘要: CodeCraft-22 and Codeforces Round #795 D. Max GEQ Sum 题意:就是问是否对所有的pair都有这个式子成立max(ai,ai+1,,aj1,aj)ai+ai+1++aj1+ajmax(ai,ai+1,,aj1,aj)ai+ai+1++aj1+aj 做法:考虑对每一个a 阅读全文
posted @ 2022-06-01 16:04 lmj_1 阅读(89) 评论(0) 推荐(1)
摘要: 图论题集锦 最短路 poj3662 题意:求1...n的所有路径中,路径上的边第k+1大最小 做法1:考虑分层图最短路,将每个点设为(x,p)表示到x点p+1边大,那么对于每条边(x,y)就连接了,(x,p) w(x,y) (y,p),(x,p) 0 (y,p+1), 阅读全文
posted @ 2022-05-24 09:47 lmj_1 阅读(35) 评论(0) 推荐(0)
摘要: Educational Codeforces Round 128 C. Binary String 题意:每次可以从一个01串的两头删除0或者1,求最后留在串中的0的数量和删除的1的数量最大值最小是多少 做法:我们枚举从一端删除1的数量,那么其实你可以发现随着另一端删除1的数量增加,答案会随着变小到 阅读全文
posted @ 2022-05-15 20:19 lmj_1 阅读(26) 评论(0) 推荐(0)
摘要: Codeforces Round #788 (Div. 2) E.Hemose on the Tree 题意:给定一颗节点个数为n=2p个的树,需要给每条边和每个点赋值(1,2*n-1),每个数不重复,要求使得一条路径上的最大异或和最小的方案 做法:其实这个有点脑经急转弯的意思,因为发现其实不 阅读全文
posted @ 2022-05-09 22:27 lmj_1 阅读(66) 评论(0) 推荐(0)
摘要: Codeforces Round #785 (Div. 2) B.A Perfectly Balanced String? 前面补下B比较坑 题意:给一个字符串,他的任意连续字串中任意两个字母出现次数只差不能大于1, 做法:首先考虑特殊情况,有相同字母连续出现,这种情况必然好判,然后考虑,其实只要任 阅读全文
posted @ 2022-05-01 21:31 lmj_1 阅读(44) 评论(0) 推荐(0)
摘要: The 2021 ICPC Asia Kunming Regional Contest D-Divisions 做法:我们发现,当构造成a a a b b b c c c (a<b<c)这样的时候,答案就是2num(a)1+2num(b)1+2num(c)1+1,我们 阅读全文
posted @ 2022-04-27 20:44 lmj_1 阅读(63) 评论(0) 推荐(0)
摘要: Educational Codeforces Round 127 (Rated for Div. 2) E. Preorder 题意:给一颗点权仅为AB的完全二叉树,可以对每个点的两个子树进行交换,求前序遍历共有多少种 做法:其实很好想,设dp[x],表示以x为子树的方案有多少种,那么假如两棵子树完 阅读全文
posted @ 2022-04-25 20:00 lmj_1 阅读(41) 评论(0) 推荐(0)
点击右上角即可分享
微信分享提示