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
|