QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#65649#4585. Greedy KnapsackZhangYiDeCompile Error//C309b2022-12-02 19:08:452022-12-02 19:08:48

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.