细节被坑惨
1 #include2 using namespace std; 3 const int maxn=1e6+5; 4 const int INF=1e9+7; 5 int n,ans,dp[305][305]; 6 template void red(t &x) 7 { 8 x=0; 9 int w=1;10 char ch=getchar();11 while(ch<'0'||ch>'9')12 {13 if(ch=='-')14 w=-1;15 ch=getchar();16 }17 while(ch>='0'&&ch<='9')18 {19 x=(x<<3)+(x<<1)+ch-'0';20 ch=getchar();21 }22 x*=w;23 }24 void input()25 {26 freopen("input.txt","r",stdin);27 }28 void read()29 {30 red(n);31 for(int i=1;i<=n;++i)32 red(dp[i][i]); 33 }34 void work()35 {36 for(int i=1;i<=n;++i)37 for(int j=1;j+i<=n+1;++j)38 {39 int e=i+j-1;40 for(int k=j;k