#637
Se dă vectorul de tați al unui arbore cu rădăcină cu n noduri. Determinați rădăcina arborelui și frunzele acestuia.
| Problema | Frunze | Operații I/O |
frunze.in/frunze.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64236335 | Utilizator | |
| Fișier | frunze.cpp | Dimensiune | 365 B |
| Data încărcării | 24 Aprilie 2026, 14:07 | Scor/rezultat | Eroare de compilare |
frunze.cpp:1:1: error: ‘include’ does not name a type 1 | include <bits//stdc++.h> | ^~~~~~~ frunze.cpp:3:1: error: ‘ifstream’ does not name a type 3 | ifstream f("nivele.in"); | ^~~~~~~~ frunze.cpp:4:1: error: ‘ofstream’ does not name a type 4 | ofstream g("nivele.out"); | ^~~~~~~~ frunze.cpp: In function ‘int main()’: frunze.cpp:7:2: error: ‘f’ was not declared in this scope 7 | {f>>n; | ^ frunze.cpp:8:2: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 8 | for(i=1;i<=n;i++) | ^~~ frunze.cpp:10:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 10 | if(t[i]==0) | ^~ frunze.cpp:11:9: error: ‘g’ was not declared in this scope 11 | g<<i; | ^ frunze.cpp:15:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 15 | for(i=1;i<=n;i++) | ^~~ frunze.cpp:18:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 18 | g<<i<<" "; | ^ frunze.cpp:18:9: error: ‘g’ was not declared in this scope frunze.cpp:19:14: error: expected ‘}’ at end of input 19 | return 0; | ^ frunze.cpp:7:1: note: to match this ‘{’ 7 | {f>>n; | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Frunze 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ă.