Borderou de evaluare (job #3160893)

Utilizator bianca_ioanaGhetea Bianca bianca_ioana Data 25 octombrie 2023 11:18:09
Problema Problema rucsacului Status done
Runda Arhiva educationala Compilator cpp-64 | Vezi sursa
Scor 0

Raport evaluator

Eroare de compilare: main.cpp:5:10: error: redefinition of 'std::ifstream fin' 5 | ifstream fin ("rucsac.out"); | ^~~ main.cpp:4:10: note: 'std::ifstream fin' previously declared here 4 | ifstream fin ("rucsac.in"); | ^~~ main.cpp:14:49: error: 'objs' has not been declared 14 | int dpprofit (int idx, int capacitate, tobject, objs[]) | ^~~~ main.cpp: In function 'int dpprofit(int, int, tobject, int*)': main.cpp:19:9: error: 'objs' was not declared in this scope 19 | if (objs[idx].greutate>capacitate) | ^~~~ main.cpp:24:16: error: expected initializer before numeric constant 24 | int profit 1=dpprofit(idx-1, capacitate, objs); | ^ main.cpp:25:5: error: 'intnewcapacitate' was not declared in this scope; did you mean 'capacitate'? 25 | intnewcapacitate=capacitate-objs[idx].greutate; | ^~~~~~~~~~~~~~~~ | capacitate main.cpp:25:33: error: 'objs' was not declared in this scope 25 | intnewcapacitate=capacitate-objs[idx].greutate; | ^~~~ main.cpp:26:17: error: 'onjs' was not declared in this scope 26 | int profit2=onjs[idx].profit+dpprofit(idx-1, newcapacitate, objs); | ^~~~ main.cpp:26:50: error: 'newcapacitate' was not declared in this scope; did you mean 'capacitate'? 26 | int profit2=onjs[idx].profit+dpprofit(idx-1, newcapacitate, objs); | ^~~~~~~~~~~~~ | capacitate main.cpp:27:31: error: 'profit1' was not declared in this scope; did you mean 'profit2'? 27 | memo[idx][capacitate]=max(profit1, profit2); | ^~~~~~~ | profit2 main.cpp: In function 'int main()': main.cpp:44:17: error: 'onjs' was not declared in this scope; did you mean 'objs'? 44 | objs[i]=onjs; | ^~~~ | objs main.cpp:43:17: warning: unused variable 'obj' [-Wunused-variable] 43 | tobject obj={greutate, profit}; | ^~~ Non zero exit status: 1

Ceva nu functioneaza?