Monkey Party Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 1699 Accepted Submission(s): 769 Problem Description Far away from our world, there is a banana forest. And many lovely monkeys l…
思路 :一道经典的区间dp 唯一不同的时候 终点和起点相连 所以要拆环成链 只需要把1-n的数组在n+1-2*n复制一遍就行了 #include<bits/stdc++.h> using namespace std; const int maxn=10005; int dp[maxn][maxn],dp1[maxn][maxn]; const int INF=10000000; int a[maxn]; int sum[maxn]; int dist(int x,int y){ // c…