随笔分类 - 刷题
刷题记录
摘要:题目来源 acwing 题目难度 2星 算法标签 二分 参考程序 // Forward declaration of compare API. // bool compare(int a, int b); // return bool means whether a is less than b.
阅读全文
摘要:题目来源 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];
阅读全文
摘要:AcWing 1012友好城市 #include <iostream> #include <cstdio> #include <algorithm> using namespace std; const int N = 5e3+5; int n; struct Node{ int a, b; boo
阅读全文
摘要:AcWing 896 最长上升子序列II #include <iostream> #include <cstdio> using namespace std; const int N = 1e5+5; int n; int h[N]; int d[N]; //d[i]: 表示长度为i的递增序列的末尾
阅读全文