摘要:
题目 题解 动态规划 用二进制表示每种味道尝了没有,如:一共有五种味道,吃了前三种——00111,吃了五种——11111 每包糖果都可以选或不选 dp(i,j) i代表前i包糖果, j代表所能到达的状态(吃了几种种味) 其实就是01背包问题 dp[i-1][j & (~w[i])]+1 意味着:选这 阅读全文
posted @ 2022-04-19 22:22
czyaaa
阅读(63)
评论(0)
推荐(0)
摘要:
题目 题解 #include <iostream> using namespace std; int k; string str; int dfs() { int res = 0; while(k < str.size()) { if(str[k] == '('){ //处理(.....) k ++ 阅读全文
posted @ 2022-04-19 16:44
czyaaa
阅读(27)
评论(0)
推荐(0)
摘要:
题目 题解 #include <iostream> #include <algorithm> using namespace std; typedef long long LL; const int N = 110; int n; int cnt; LL a[N],b[N],c[N]; //a为分子 阅读全文
posted @ 2022-04-19 12:13
czyaaa
阅读(54)
评论(0)
推荐(0)