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_17386023_23962.c:1:945: fatal error: iostream: No such file or directory
 #include <iostream> #include <cstdio> #include <cstring> #include <cmath> #include <queue> #include <algorithm> #define LL long long using namespace std; const int INF = 0x3f3f3f3f; const int MAX = 20001; int dp[MAX]; int Dp[MAX]; int w[120]; int c[120]; int MIN; int main() { int n,m; int W=1; while(scanf("%d %d",&n,&m)&&(n||m)) { for(int i=0;i<n;i++) { scanf("%d",&w[i]); } for(int i=0;i<n;i++) { scanf("%d",&c[i]); } memset(Dp,INF,sizeof(Dp)); memset(dp,INF,sizeof(dp)); Dp[0]=0; dp[0]=0; for(int i=0;i<n;i++) { int bite=1; int num=c[i]; while(num) { num-=bite; for(int j=MAX-1;j>=w[i]*bite;j--) { Dp[j]=min(Dp[j],Dp[j-w[i]*bite]+bite); } if(bite*2<num) { bite*=2; } else { bite=num; } } } for(int i=0;i<n;i++) { for(int j=w[i];j<MAX;j++) { dp[j]=min(dp[j],dp[j-w[i]]+1); } } MIN=INF; for(int i=m;i<MAX;i++) { MIN=min(MIN,Dp[i]+dp[i-m]); } printf("Case %d: ",W++); if(MIN==INF) { printf("-1\n"); } else { printf("%d\n",MIN); } } return 0; }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 ^
compilation terminated.


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-12-03 16:14:01, Gzip enabled