摘要: CodeForces - Problem 1442 A - Extreme Subtraction - DP 这是一道构造题,之前没练过构造.思路是贪心,DP #include <bits/stdc++.h> using namespace std; int n,t; int v[30000+4]; 阅读全文
posted @ 2020-11-17 15:35 popozyl 阅读(135) 评论(0) 推荐(0) 编辑
摘要: CodeForces - Problem 1447 - Catching Cheaters - DP #include <bits/stdc++.h> using namespace std; const int N = 5000+5; char a[N],b[N]; int dp[N][N]; / 阅读全文
posted @ 2020-11-17 12:22 popozyl 阅读(84) 评论(0) 推荐(0) 编辑
摘要: CodeForces - Problem 1446 - Knapsack - 思维 对于所有物品按照重量从小到大排序,然后从后向前遍历: 对于重量已经超过了$\omega$的物品,将其忽略掉; 对于重量处于$[\lceil \frac{\omega}{2} \rceil,\omega]$的物品(如果 阅读全文
posted @ 2020-11-17 10:23 popozyl 阅读(238) 评论(0) 推荐(0) 编辑