#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 | #64734219 | Utilizator | |
| Fișier | frunze.cpp | Dimensiune | 632 B |
| Data încărcării | 26 Mai 2026, 18:46 | Scor/rezultat | 100 puncte |
frunze.cpp: In function ‘int main()’: frunze.cpp:14:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 14 | if(t[i]==0) | ^~ frunze.cpp:16:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 16 | fout<<r; | ^~~~ frunze.cpp:18:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 18 | for(int i=1;i<+n;++i) | ^~~ frunze.cpp:21:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 21 | int k=0; | ^~~ frunze.cpp:22:2: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 22 | for(int i=1;i<=n;i++) | ^~~ frunze.cpp:25:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 25 | fout<<k; | ^~~~ frunze.cpp:27:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 27 | for(int i=1;i<=n;i++) | ^~~ frunze.cpp:30:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 30 | return 0; | ^~~~~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.001 secunde | OK. | 20 | 20 | Exemplu | |
| 2 | 0.001 secunde | OK. | 40 | 40 | ||
| 3 | 0.001 secunde | OK. | 40 | 40 | ||
| Punctaj total | 100 | |||||
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ă.