随笔分类 -  DP

摘要:1 int dp[11][11]; 2 int a[11]; 3 4 class Solution { 5 public: 6 long long dfs(int eq,int dep,int sum) 7 { 8 if(!dep)return sum; 9 if(~dp[dep][sum]&&!e 阅读全文
posted @ 2022-01-07 13:29 matt-11 阅读(26) 评论(0) 推荐(0) 编辑
摘要:洛谷 P6218 [USACO06NOV] Round Numbers S 1 #include<bits/stdc++.h> 2 using namespace std; 3 //dp[dep][cnt1][cnt0];//表示1-n中考虑到dep位,1的个数为cnt1个,0的个数为cnt0个,的 阅读全文
posted @ 2021-12-11 17:12 matt-11 阅读(31) 评论(0) 推荐(0) 编辑
摘要:洛谷P4127 [AHOI2009]同类分布 1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 ll dp[20][163][163];//表示余数和为md,考虑到dep位第dep位还未选,数位和为s 阅读全文
posted @ 2021-12-11 14:03 matt-11 阅读(33) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示