0_0_16817883_13980.cpp: In function 'int main()':
0_0_16817883_13980.cpp:2:784: error: expected '}' at end of input
int dis[205];int dp[40][205];int cost[205][205];int min(int a,int b){ if(a>b)a=b; return a;}int main(){ int n,m; int t=1; while(scanf("%d %d",&n,&m)!=EOF) { if(!n&&!m)break; for(int i=1;i<=n;i++) scanf("%d",&dis[i]); for(int i=1;i<=n;i++) for(int j=1;j<=n;j++) { cost[i][j]=0; for(int k=i;k<=j;k++) cost[i][j]+=abs(dis[k]-dis[(i+j)/2]); } for(int i=1;i<=n;i++) dp[1][i]=cost[1][i]; for(int i=2;i<=m;i++) for(int j=i;j<=n;j++) { dp[i][j]=10000000; for(int k=i-1;k<=j-1;k++) dp[i][j]=min(dp[i][j],dp[i-1][k]+cost[k+1][j]); } printf("Chain %d\n",t++); printf("Total distance sum = %d\n\n",dp[m][n]);//�����س� } return 0;}
^
0_0_16817883_13980.cpp:2:784: error: expected '}' at end of input
|