摘要: P1095 [NOIP 2007 普及组] 守望者的逃离 点击查看代码 #include<bits/stdc++.h> using namespace std; int main () { int m, s, t; cin >> m >> s >> t; vector<int> dp(t + 1); 阅读全文
posted @ 2025-05-31 12:13 Chuan81 阅读(2) 评论(0) 推荐(0)
摘要: P1832 A+B Problem(再升级) 没开long long会爆炸 这题可以看作选素数作完全背包问题 点击查看代码 #include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<bool> 阅读全文
posted @ 2025-05-29 10:46 Chuan81 阅读(5) 评论(0) 推荐(0)
摘要: P1757 通天之分组背包 点击查看代码 #include<bits/stdc++.h> using namespace std; int main() { int m, n; cin >> m >> n; vector<vector<pair<int, int>>> groups(101); fo 阅读全文
posted @ 2025-05-28 20:54 Chuan81 阅读(3) 评论(0) 推荐(0)
摘要: P1510 精卫填海 点击查看代码 #include<bits/stdc++.h> using namespace std; int main() { int v, n, c; cin >> v >> n >> c; int V[n], cost[n]; vector<int>dp(c + 1, 0 阅读全文
posted @ 2025-05-28 16:42 Chuan81 阅读(3) 评论(0) 推荐(0)
摘要: P1164 小A点菜 点击查看代码 #include<bits/stdc++.h> using namespace std; const int M = 10010, N = 1010; int dp[M]; int main() { int m, n; cin >> n >> m; vector< 阅读全文
posted @ 2025-05-28 16:22 Chuan81 阅读(4) 评论(0) 推荐(0)
摘要: P2871 [USACO07DEC] Charm Bracelet S 不用一维数组优化的话,样例都过不去 点击查看代码 #include<bits/stdc++.h> using namespace std; const int N = 3402, M = 12881; int dp[M]; in 阅读全文
posted @ 2025-05-27 20:21 Chuan81 阅读(3) 评论(0) 推荐(0)
摘要: 1048 [NOIP 2005 普及组] 采药 点击查看代码 #include<bits/stdc++.h> using namespace std; int dp[1010]; int main() { int t, m; cin >> t >> m; int cost[m], v[m]; for 阅读全文
posted @ 2025-05-26 16:53 Chuan81 阅读(1) 评论(0) 推荐(0)
摘要: P1049 [NOIP 2001 普及组] 装箱问题 点击查看代码 #include<bits/stdc++.h> using namespace std; int dp[20005]; int main() { int V, n; cin >> V >> n; int v[n]; for(int 阅读全文
posted @ 2025-05-26 16:36 Chuan81 阅读(4) 评论(0) 推荐(0)
摘要: P1802 五倍经验 点击查看代码 #include<bits/stdc++.h> using namespace std; const int N = 1005; long long dp[N]; int main() { int n, x; cin >> n >> x; int lose, wi 阅读全文
posted @ 2025-05-26 16:36 Chuan81 阅读(3) 评论(0) 推荐(0)
摘要: P1036 [NOIP 2002 普及组] 选数 点击查看代码 #include<bits/stdc++.h> using namespace std; int n, k; vector<int>a; int ans = 0; bool is_prime(int x) { if(x < 2) ret 阅读全文
posted @ 2025-05-23 19:57 Chuan81 阅读(7) 评论(0) 推荐(0)