随笔分类 -  动态规划

摘要:并查集 + 01背包 点击查看代码 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1e5 + 10; int n, m, k; int p[N]; int v[N], w[N]; in 阅读全文
posted @ 2022-07-16 11:05 wKingYu 阅读(29) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<cstring> using namespace std; typedef long long LL; const int N = 1e6 + 10; int n; int h[N], e[N], ne[N], w[N], idx 阅读全文
posted @ 2022-07-11 21:24 wKingYu 阅读(31) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<cstring> #include<cmath> using namespace std; typedef long long LL; const int N = 10, M = 20; const double INF = 1e 阅读全文
posted @ 2022-07-09 18:48 wKingYu 阅读(24) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<cstring> using namespace std; typedef long long LL; const int N = 60, M = 50; int n; int w[N]; LL f[N][N][M]; void 阅读全文
posted @ 2022-07-08 21:48 wKingYu 阅读(24) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<cstring> using namespace std; typedef long long LL; const int N = 50; int n; int w[N]; int f[N][N], g[N][N]; void d 阅读全文
posted @ 2022-07-07 23:27 wKingYu 阅读(20) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<cstring> using namespace std; typedef long long LL; const int N = 210; const int INF = 0x3f3f3f3f; int n; int w[N]; 阅读全文
posted @ 2022-07-07 22:30 wKingYu 阅读(18) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<cstring> using namespace std; const int N = 410; const int INF = 0x3f3f3f3f; int n; int w[N], s[N]; int f[N][N], g[ 阅读全文
posted @ 2022-07-07 22:03 wKingYu 阅读(30) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<cstring> #include<vector> #include<cmath> using namespace std; const int N = 18, M = 1 << N; int n, m; int path[N][ 阅读全文
posted @ 2022-07-07 09:13 wKingYu 阅读(18) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<cstring> #include<vector> using namespace std; typedef long long LL; const int N = 110, M = 1 << 10; int n, m; int 阅读全文
posted @ 2022-07-06 23:03 wKingYu 阅读(32) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<cstring> #include<vector> using namespace std; typedef long long LL; const int N = 14, M = 1 << 12; const int mod = 阅读全文
posted @ 2022-07-06 20:51 wKingYu 阅读(17) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<cstring> #include<vector> using namespace std; typedef long long LL; const int N = 12, M = 1 << 10, K = 110; int n, 阅读全文
posted @ 2022-07-06 00:02 wKingYu 阅读(35) 评论(0) 推荐(1) 编辑
摘要:KMP + 状态机 点击查看代码 #include<iostream> #include<vector> #include<cstring> #include<algorithm> using namespace std; const int N = 60; const int mod = 1e9 阅读全文
posted @ 2022-06-24 23:02 wKingYu 阅读(21) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<cstring> #include<algorithm> using namespace std; const int N = 1e5 + 10; int n; int a[N]; int f[N][3]; int main() 阅读全文
posted @ 2022-06-24 21:47 wKingYu 阅读(10) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<cstring> using namespace std; const int N = 100010, M = 110; int n, m; int w[N]; int f[N][M][2]; int main() { cin > 阅读全文
posted @ 2022-06-21 23:09 wKingYu 阅读(20) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> using namespace std; const int N = 100010; const int INF = 0x3f3f3f3f; int n, w; int f[N][2]; int main() { int T; cin >> T; 阅读全文
posted @ 2022-06-21 21:40 wKingYu 阅读(28) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<vector> #define fi first #define se second using namespace std; typedef pair<int,int> PII; const int N = 70, M = 32 阅读全文
posted @ 2022-06-21 14:32 wKingYu 阅读(14) 评论(0) 推荐(0) 编辑
摘要:贪心 + 01背包模型 点击查看代码 #include<iostream> #include<cstring> #include<algorithm> using namespace std; const int N = 10010; int n; int f[N]; struct Stone { 阅读全文
posted @ 2022-06-21 12:07 wKingYu 阅读(27) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<vector> using namespace std; const int N = 1010; int n, m; int v[N], w[N]; int f[N][N]; int main() { cin >> n >> m; 阅读全文
posted @ 2022-06-21 00:46 wKingYu 阅读(12) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<cstring> using namespace std; const int N = 1010, mod = 1e9 + 7; int n, m; int f[N], g[N]; int main() { cin >> n >> 阅读全文
posted @ 2022-06-21 00:04 wKingYu 阅读(14) 评论(0) 推荐(0) 编辑
摘要:点击查看代码 #include<iostream> #include<cstring> using namespace std; const int N = 110; int n, m; int h[N], e[N], ne[N], idx; int v[N], w[N], f[N][N]; voi 阅读全文
posted @ 2022-06-20 23:25 wKingYu 阅读(16) 评论(0) 推荐(0) 编辑

欢迎阅读『动态规划』
点击右上角即可分享
微信分享提示