F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

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


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-19 20:54:16, Gzip enabled