#757
BiMax
Se consideră un arbore binar în care nodurile memorează numere naturale nenule. Să se determine valorile maxime din subarborii stâng și drept ai rădăcinii.
Problema | BiMax | Operații I/O |
bimax.in /bimax.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54614105 | Utilizator | |
Fișier | bimax.cpp | Dimensiune | 694 B |
Data încărcării | 03 Decembrie 2024, 18:36 | Scor / rezultat | Eroare de compilare |
bimax.cpp:3:1: error: 'ifstream' does not name a type ifstream fin("bimax.in"); ^ bimax.cpp:4:1: error: 'ofstream' does not name a type ofstream fout("bimax.out"); ^ bimax.cpp: In function 'void creare(int&, int)': bimax.cpp:12:10: error: invalid conversion from 'nod*' to 'int' [-fpermissive] r=new nod; ^ bimax.cpp:13:10: error: base operand of '->' is not a pointer r->info=x; ^ bimax.cpp:14:10: error: base operand of '->' is not a pointer r->st=r->dr=NULL; ^ bimax.cpp:14:16: error: base operand of '->' is not a pointer r->st=r->dr=NULL; ^ bimax.cpp:16:9: error: 'fin' was not declared in this scope fin>>y; ^ bimax.cpp:17:17: error: base operand of '->' is not a pointer creare(r->st,y); ^ bimax.cpp:19:17: error: base operand of '->' is not a pointer creare(r->dr,y); ^ bimax.cpp: In function 'void preordine(int)': bimax.cpp:25:11: warning: NULL used in arithmetic [-Wpointer-arith] if(R!=NULL){ ^ bimax.cpp:26:18: error: base operand of '->' is not a pointer if(max<=R->info) ^ bimax.cpp:27:18: error: base operand of '->' is not a pointer max=R->info; ^ bimax.cpp:28:20: error: base operand of '->' is not a pointer preordine(R->st); ^ bimax.cpp:29:20: error: base operand of '->' is not a pointer preordine(R->dr); ^ bimax.cpp:31:5: error: 'fout' was not declared in this scope fout<<max<<' '; ^ bimax.cpp: In function 'int main()': bimax.cpp:34:15: error: expected ',' or ';' before ':' token nod*R=NULL: ^ bimax.cpp:36:5: error: 'fin' was not declared in this scope fin>>x; ^ bimax.cpp:36:10: error: 'x' was not declared in this scope fin>>x; ^ bimax.cpp:37:15: error: 'Creare' was not declared in this scope Creare(R,x); ^ bimax.cpp:38:20: error: invalid conversion from 'nod*' to 'int' [-fpermissive] preordine(R->st); ^ bimax.cpp:23:6: error: initializing argument 1 of 'void preordine(int)' [-fpermissive] void preordine(int R){ ^ bimax.cpp:39:20: error: invalid conversion from 'nod*' to 'int' [-fpermissive] preordine(R->dr); ^ bimax.cpp:23:6: error: initializing argument 1 of 'void preordine(int)' [-fpermissive] void preordine(int R){ ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema BiMax face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.