#643
Se dă vectorul de tați al unui arbore cu rădăcină cu n noduri și un nod k. Determinați drumul de la rădăcina arborelui la nodul k.
| Problema | DetDrum1 | Operații I/O |
detdrum1.in/detdrum1.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #63818880 | Utilizator | |
| Fișier | detdrum1.cpp | Dimensiune | 396 B |
| Data încărcării | 20 Martie 2026, 08:23 | Scor/rezultat | Eroare de compilare |
detdrum1.cpp:6:15: warning: missing terminating " character [enabled by default] ofstream fout("detdrum1.out ^ detdrum1.cpp:6:1: error: missing terminating " character ofstream fout("detdrum1.out ^ detdrum1.cpp:7:15: warning: missing terminating " character [enabled by default] "); ^ detdrum1.cpp:7:15: error: missing terminating " character detdrum1.cpp:8:7: error: 'k' has not been declared int n,k, t[101]; ^ detdrum1.cpp:8:10: error: 't' has not been declared int n,k, t[101]; ^ detdrum1.cpp:8:16: error: expected ')' before ';' token int n,k, t[101]; ^ detdrum1.cpp: In function 'void Citire()': detdrum1.cpp:12:10: error: 'n' was not declared in this scope fin>>n>>k; ^ detdrum1.cpp:12:13: error: 'k' was not declared in this scope fin>>n>>k; ^ detdrum1.cpp:14:14: error: 't' was not declared in this scope fin>>t[i]; ^ detdrum1.cpp: In function 'void Drum(int)': detdrum1.cpp:21:14: error: 't' was not declared in this scope Drum(t[k]); ^ detdrum1.cpp:22:15: error: invalid operands of types 'std::ofstream(int, int, int*) {aka std::basic_ofstream<char>(int, int, int*)}' and 'int' to binary 'operator<<' fout<<k<<" "; ^ detdrum1.cpp: In function 'int main()': detdrum1.cpp:29:10: error: 'k' was not declared in this scope Drum(k); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema DetDrum1 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ă.