- 博客(4)
- 收藏
- 关注
原创 uva 242 DP 求s张邮票可以连续组合成最大面值多少的邮票
#include #include #include using namespace std; int d[36][36],dp[1036],res[36]; int main(){ int s,n; while(scanf("%d",&s) == 1 && s){ scanf("%d",&n); for(int i = 1;i <= n;i++){ scanf("%d",&d[
2017-11-06 09:10:25 302
原创 uva 1630 KMP判断周期串 和 区间DP 压缩字符串
#include #include #include #include #include using namespace std; string dp[160][160]; char s[160],t[160]; int f[160]; string ToString(int x){ string res = ""; while(x){ res += (char)('0' + (x % 1
2017-11-06 08:22:50 342
原创 uva1629 切方格使得每个方格中只有一个物品,求最少切割费用 记忆化搜索
#include #include #include #define INF 0x3f3f3f3f using namespace std; int dp[36][36][36][36],x[500],y[500],n,m,k; int dfs(int x1,int y1,int x2,int y2){ int &t = dp[x1][y1][x2][y2]; if(t != -1) retu
2017-11-06 07:21:03 242
原创 uva 10118 Free Candies
#include #include #include using namespace std; int vis[30],top[5],dp[60][60][60][60],n,d[4][60]; int dfs(int k){ int &t=dp[top[0]][top[1]][top[2]][top[3]]; if(t != -1) return t; t=0; if(k >= 5 ||
2017-11-06 07:18:42 238
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人