#639
Inaltime
Se dă vectorul de tați al unui arbore cu rădăcină cu n
noduri. Determinați înălțimea arborelui.
Problema | Inaltime | Operații I/O |
![]() inaltime.in /inaltime.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #50335643 | Utilizator | |
Fișier | inaltime.cpp | Dimensiune | 702 B |
Data încărcării | 05 Aprilie 2024, 08:12 | Scor / rezultat | Eroare de compilare |
inaltime.cpp:5:13: error: variable 'std::ifstream cin' has initializer but incomplete type ifstream cin("inaltime.in"); ^ inaltime.cpp:6:14: error: variable 'std::ofstream cout' has initializer but incomplete type ofstream cout("inaltime.out"); ^ inaltime.cpp: In function 'int main()': inaltime.cpp:13:5: error: reference to 'cin' is ambiguous cin>>n; ^ inaltime.cpp:5:10: note: candidates are: <typeprefixerror>cin ifstream cin("inaltime.in"); ^ In file included from inaltime.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ inaltime.cpp:16:9: error: reference to 'cin' is ambiguous cin>>t[i]; ^ inaltime.cpp:5:10: note: candidates are: <typeprefixerror>cin ifstream cin("inaltime.in"); ^ In file included from inaltime.cpp:1:0: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ inaltime.cpp:37:5: error: reference to 'cout' is ambiguous cout<<niv; ^ inaltime.cpp:6:10: note: candidates are: <typeprefixerror>cout ofstream cout("inaltime.out"); ^ In file included from inaltime.cpp:1:0: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ inaltime.cpp:12:9: warning: unused variable 'x' [-Wunused-variable] int x,k,i,j,n,ok=0; ^ inaltime.cpp:12:11: warning: unused variable 'k' [-Wunused-variable] int x,k,i,j,n,ok=0; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Inaltime 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ă.