上一页 1 2 3 4 5 6 7 ··· 9 下一页
摘要: 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 阅读(42) 评论(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 阅读(40) 评论(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 阅读(60) 评论(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 阅读(52) 评论(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 阅读(92) 评论(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 阅读(9) 评论(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 阅读(15) 评论(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 阅读(96) 评论(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 阅读(71) 评论(0) 推荐(0)
摘要: P1257 平面上的最接近点对 这题的数据其实直接暴力枚举就可以了,但是书里是放在分治章节的。 题目越来越难了,我现在感觉真的很吃力😟 点击查看暴力枚举代码 #include<bits/stdc++.h> using namespace std; const int N = 10005; stru 阅读全文
posted @ 2025-05-23 19:06 Chuan81 阅读(54) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 ··· 9 下一页