#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 | #54599211 | Utilizator | |
Fișier | arbore.cpp | Dimensiune | 623 B |
Data încărcării | 03 Decembrie 2024, 12:56 | Scor / rezultat | Eroare de compilare |
arbore.cpp:6:1: error: expected ',' or ';' before 'int' int n,a[50][50],viz[100],t[100],k,x,y; ^ arbore.cpp: In function 'void citire(int&, int&)': arbore.cpp:12:17: error: 'x' was not declared in this scope fin>>x>>y; ^ arbore.cpp:12:20: error: 'y' was not declared in this scope fin>>x>>y; ^ arbore.cpp:13:9: error: 'a' was not declared in this scope a[x][y]=a[y][x]=1; ^ arbore.cpp: In function 'void dfp(int)': arbore.cpp:18:5: error: 'viz' was not declared in this scope viz[vf]=1; ^ arbore.cpp:19:20: error: 'n' was not declared in this scope for(int i=1;i<=n ;i++) ^ arbore.cpp:21:15: error: 'a' was not declared in this scope if(a[vf][i]==1 && viz[i]==0) ^ arbore.cpp:23:16: error: 't' was not declared in this scope t[i]=vf; ^ arbore.cpp: In function 'int main()': arbore.cpp:32:12: error: 'n' was not declared in this scope citire(n,k); ^ arbore.cpp:32:14: error: 'k' was not declared in this scope citire(n,k); ^ arbore.cpp:35:15: error: 't' was not declared in this scope fout<<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ă.