随笔分类 -  DP专题

摘要:比赛链接 C题 一个二维背包问题 //二维背包 #include <bits/stdc++.h> using namespace std; const int MAXN = 1010; int t[MAXN], a[MAXN], w[MAXN]; int dp[MAXN][MAXN]; int ma 阅读全文
posted @ 2020-10-07 19:39 LightAc 阅读(133) 评论(0) 推荐(0) 编辑
摘要:注:一日恰饭之余,LL大佬说刷啥线段树不如做些DP题,想想也是==然后刷了几道DP题 https://vjudge.net/contest/399437#overview 后续写了上面contest的题,在这篇随笔继续更新 两道下饭题 思路:数字三角形,最简单的DP,没有之一 #include <b 阅读全文
posted @ 2020-10-06 21:27 LightAc 阅读(217) 评论(0) 推荐(1) 编辑
摘要:#include using namespace std; typedef long long ll; int n,tot; ll p[200],f[2000],ans; int main(){ scanf("%d",&n); for (int i=2;i=p[i];--j) for(int k=p[i];k<=j;k*=p[i]) f[j]+=f[... 阅读全文
posted @ 2019-04-22 13:36 LightAc 阅读(120) 评论(0) 推荐(0) 编辑
摘要:#include using namespace std; int dp[1005],f[1005]; int main(){ ios::sync_with_sidio(false); int t; cin >>t; while(t--){ memset(dp,0,sizeof(dp)); int n,m; ... 阅读全文
posted @ 2019-04-21 22:34 LightAc 阅读(267) 评论(0) 推荐(0) 编辑
摘要:#include using namespace std; const int MAXN = 33000; long long dp[MAXN] = {0}; int main () { dp[0] = 1; for (int i = 1; i <= 3; i++) { for (int j = i; j < MAXN; j++) { ... 阅读全文
posted @ 2019-04-21 22:21 LightAc 阅读(195) 评论(0) 推荐(0) 编辑

返回顶端
点击右上角即可分享
微信分享提示