#636
Arbore
Se dau cele n-1
muchii ale unui arbore cu n
noduri și un nod k
. Afișați vectorul de tați al arborelui cu rădăcina în k
.
Problema | Arbore | Operații I/O |
![]() arbore.in /arbore.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #58318711 | Utilizator | |
Fișier | arbore.cpp | Dimensiune | 436 B |
Data încărcării | 27 Mai 2025, 08:14 | Scor / rezultat | Eroare de compilare |
arbore.cpp: In function 'void parc(int, int)': arbore.cpp:4:5: error: 'T' was not declared in this scope T[nc]=tata; ^ arbore.cpp:5:16: error: 'n' was not declared in this scope for(i=1;i<=n;i++) ^ arbore.cpp:7:12: error: 'A' was not declared in this scope if(A[nc][i]==1 && i!=tata) ^ arbore.cpp: In function 'int main()': arbore.cpp:14:5: error: 'ifstream' was not declared in this scope ifstream f("arbore.in"); ^ arbore.cpp:14:14: error: expected ';' before 'f' ifstream f("arbore.in"); ^ arbore.cpp:15:5: error: 'ofstream' was not declared in this scope ofstream g("arbore.out"); ^ arbore.cpp:15:14: error: expected ';' before 'g' ofstream g("arbore.out"); ^ arbore.cpp:17:5: error: 'f' was not declared in this scope f>>n>>k; ^ arbore.cpp:17:8: error: 'n' was not declared in this scope f>>n>>k; ^ arbore.cpp:21:9: error: 'A' was not declared in this scope A[x][y]=1; ^ arbore.cpp:26:9: error: 'g' was not declared in this scope g<<T[i]<<' '; ^ arbore.cpp:26:12: error: 'T' was not declared in this scope g<<T[i]<<' '; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Arbore 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ă.