QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#65649 | #4585. Greedy Knapsack | ZhangYiDe | Compile Error | / | / | C | 309b | 2022-12-02 19:08:45 | 2022-12-02 19:08:48 |
Due to the privacy settings of the submitter, you are not allowed to view this code.
Details
answer.code:1:25: warning: extra tokens at end of #include directive 1 | #include<bits/stdc++.h> using namespace std; int c[105],v[105]; int f[10050]; int main() { int N,W; while(cin>>N>>W) //???? { for(int i=1;i<=N;i++) cin>>v[i]>>c[i]; memset(f,0,sizeof(f)); //??f????????0 for(int i=1;i<=N;i++) for(int j=W;j>=c[i];j--) f[j]=max(f[j],f[j-c[i]]+v[i]); //???? cout<<f[W]<<endl; } } | ^~~~~ answer.code:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> using namespace std; int c[105],v[105]; int f[10050]; int main() { int N,W; while(cin>>N>>W) //???? { for(int i=1;i<=N;i++) cin>>v[i]>>c[i]; memset(f,0,sizeof(f)); //??f????????0 for(int i=1;i<=N;i++) for(int j=W;j>=c[i];j--) f[j]=max(f[j],f[j-c[i]]+v[i]); //???? cout<<f[W]<<endl; } } | ^~~~~~~~~~~~~~~ compilation terminated.