摘要:
https://www.acwing.com/problem/content/280/ \(完全背包变式\) 01背包变式 #include <bits/stdc++.h> using namespace std; #define IO ios::sync_with_stdio(false);cin 阅读全文
摘要:
https://www.acwing.com/problem/content/280/ \(01背包变式\) \(f[i][j]:表示在前i个中选,选出的数和为j的个数.\) for (int i = 1; i <= n; ++i) f[i][0] = 1; for (int i = 1; i <= 阅读全文
摘要:
https://www.acwing.com/problem/content/1024/ 二维01背包 #include <bits/stdc++.h> using namespace std; #define IO ios::sync_with_stdio(false);cin.tie(0); c 阅读全文
摘要:
http://codeforces.com/contest/1513/problem/C dp $f[i][j]:$表示当前数位上为i(0~9), 加法次数为j最终形成的数位. f[i][j] = f[i - 1][j + 1]; f[9][j] = f[1][j + 1] + f[0][j + 1 阅读全文