Borderou de evaluare (job #2395800)

Utilizator KonnayDinu Marius Valentin Konnay Data 2 aprilie 2019 21:22:04
Problema Problema rucsacului Status done
Runda Arhiva educationala Compilator cpp-64 | Vezi sursa
Scor 0

Raport evaluator

Eroare de compilare: main.cpp:5:13: error: variable 'std::ifstream cin' has initializer but incomplete type ifstream cin("rucsac.in"); ^ main.cpp:6:14: error: variable 'std::ofstream cout' has initializer but incomplete type ofstream cout("rucsac.out"); ^ main.cpp: In function 'int main()': main.cpp:15:5: error: reference to 'cin' is ambiguous cin>>n>>G; ^~~ main.cpp:5:10: note: candidates are: <typeprefixerror>cin ifstream cin("rucsac.in"); ^~~ In file included from main.cpp:1:0: /usr/include/c++/6/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^~~ main.cpp:18:9: error: reference to 'cin' is ambiguous cin>>g[i]>>val[i]; ^~~ main.cpp:5:10: note: candidates are: <typeprefixerror>cin ifstream cin("rucsac.in"); ^~~ In file included from main.cpp:1:0: /usr/include/c++/6/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^~~ main.cpp:20:16: error: 'dp' was not declared in this scope if(dp[j]!=0 || j==0){ ^~ main.cpp:21:49: error: 'v' was not declared in this scope dp[j+g[i]]=max(dp[j+g[i]],dp[j]+v[i]); ^ main.cpp:27:12: error: 'dp' was not declared in this scope if(dp[i]!=0){ ^~ main.cpp:31:5: error: reference to 'cout' is ambiguous cout<<ans; ^~~~ main.cpp:6:10: note: candidates are: <typeprefixerror>cout ofstream cout("rucsac.out"); ^~~~ In file included from main.cpp:1:0: /usr/include/c++/6/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^~~~ Non zero exit status: 1

Ceva nu functioneaza?