传送门 太难了,完全不懂 设\(dp[i][j]\)为第i天到第j天的最少代价 \(dp[i][j]=dp[i][j-1]+1\)(第j天多穿一件衣服) \(dp[i][j]=min(dp[i][j],dp[i][k]+dp[k+1][j-1])\);(往前找一天k与j衣服相同,把中间的衣服都脱掉) #include <bits/stdc++.h> using namespace std; int n,m,dp[209][209],a[209]; int main() { int t,o=1;…
1422 - Halloween Costumes PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB Gappu has a very busy weekend ahead of him. Because, next weekend is Halloween, and he is planning to attend as many parties as he can. Since it's…
B - Halloween Costumes Time Limit:2000MS Memory Limit:32768KB 64bit IO Format:%lld & %llu Submit Status Practice LightOJ 1422 Description Gappu has a very busy weekend ahead of him. Because, next weekend is Halloween, and he is planning to attend as…
题目链接:https://vjudge.net/problem/LightOJ-1422 1422 - Halloween Costumes PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB Gappu has a very busy weekend ahead of him. Because, next weekend is Halloween, and he is planning to…
Description Gappu has a very busy weekend ahead of him. Because, next weekend is Halloween, and he is planning to attend as many parties as he can. Since it's Halloween, these parties are all costume parties, Gappu always selects his costumes in such…
Gappu has a very busy weekend ahead of him. Because, next weekend is Halloween, and he is planning to attend as many parties as he can. Since it's Halloween, these parties are all costume parties, Gappu always selects his costumes in such a way that…