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_36679706_14560.cpp: In function 'int main()':
0_0_36679706_14560.cpp:31:264: error: expected '}' at end of input
 using namespace std;const int maxn = 1010;int dp[maxn];int num[maxn];int main(){    int n;    while(scanf("%d",&n) && n)    {        int money,Max = 0;        for(int i=0; i<n; i++)            scanf("%d",&num[i]);        scanf("%d",&money);        sort(num,num+n);//        if(money < 5)//5        {            printf("%d\n",money);            continue;        }        money -= 5;//5        for(int i=0; i<=money; i++)            dp[i] = money;        for(int i=0; i<n-1; i++)//            for(int j=money; j>=num[i]; j--)                if(dp[j-num[i]]-num[i] >= 0)                    dp[j] = min(dp[j],dp[j- num[i]] - num[i]);        printf("%d\n",dp[money]+5-num[n-1]);    }}
                                                                                                                                                                                                                                                                        ^
0_0_36679706_14560.cpp:31:264: 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-22 15:24:29, Gzip enabled