03 2023 档案
摘要:题目来源 acwing 题目难度 3星 算法标签 完全背包 + 高等代数 参考程序 #include <iostream> #include <cstring> #include <algorithm> using namespace std; const int N = 105, M = 2500
阅读全文
摘要:题目来源 acwing 题目难度 2星 算法标签 二分 参考程序 // Forward declaration of compare API. // bool compare(int a, int b); // return bool means whether a is less than b.
阅读全文
摘要:num: 2 3 5 7 8 9 //每一个出现的数,从小到大排序好 cnt: 2 1 1 2 3 1 //每个出现的数的数量,比如3表示8出现3次 dp表达方式:dp[n][2] dp[i][0]:表示在区间1~i上,不选num[i]的最大分数划分方案 dp[i][1]:表示在区间1~i上,选择n
阅读全文
摘要:题目来源 acwing 题目难度 3星 算法标签 dp + 优化 参考程序 #include <iostream> using namespace std; const int N = 3005; int n; int a[N], b[N]; //dp[i][j]表示a的前i个数,b的 //前j个数
阅读全文
摘要:题目来源 acwing 题目难度 3星 算法标签 dp+搜索 程序 #include <iostream> #include <cstdio> #include <algorithm> using namespace std; const int N = 55; int n; int up[N];
阅读全文