#645
Se dă vectorul de tați al unui arbore cu rădăcină cu n noduri în care fiecare nod are asociată o valoare numerică. Determinați drumul de la rădăcină la un nod terminal pentru care suma valorilor asociate nodurilor este maximă.
| Problema | DetDrum3 | Operații I/O |
detdrum3.in/detdrum3.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64350809 | Utilizator | |
| Fișier | detdrum3.cpp | Dimensiune | 949 B |
| Data încărcării | 01 Mai 2026, 14:31 | Scor/rezultat | 100 puncte |
detdrum3.cpp: In function ‘int main()’: detdrum3.cpp:34:2: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 34 | for (int l=1; l<=n; l++) | ^~~ detdrum3.cpp:37:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 37 | while (x!=0) | ^~~~~ detdrum3.cpp:44:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 44 | for (int j=k; j>=1; j--) | ^~~ detdrum3.cpp:46:6: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 46 | fout<<endl; break;}} | ^~~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.003 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 DetDrum3 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ă.