#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 | #50130632 | Utilizator | |
Fișier | arbore.cpp | Dimensiune | 690 B |
Data încărcării | 28 Martie 2024, 08:49 | Scor / rezultat | Eroare de compilare |
arbore.cpp:4:28: warning: missing terminating ' character [enabled by default] ofstream cout("arbore.out")' ^ arbore.cpp:4:1: error: missing terminating ' character ofstream cout("arbore.out")' ^ arbore.cpp:5:1: error: expected ',' or ';' before 'int' int n, a[101][101], k, s[101], t[101]; ^ arbore.cpp: In function 'void citire()': arbore.cpp:8:12: error: 'n' was not declared in this scope cin >> n >> k; ^ arbore.cpp:8:17: error: 'k' was not declared in this scope cin >> n >> k; ^ arbore.cpp:13:9: error: 'a' was not declared in this scope a[x][y] = a[y][x] = 1; ^ arbore.cpp: In function 'void DFS(int)': arbore.cpp:18:5: error: 's' was not declared in this scope s[nod] = 1; ^ arbore.cpp:19:26: error: 'n' was not declared in this scope for(int i = 1 ; i <= n ;++i) ^ arbore.cpp:21:12: error: 'a' was not declared in this scope if(a[i][nod]) ^ arbore.cpp:26:17: error: 't' was not declared in this scope t[i] = nod; ^ arbore.cpp: In function 'int main()': arbore.cpp:35:9: error: 'k' was not declared in this scope DFS(k); ^ arbore.cpp:36:26: error: 'n' was not declared in this scope for(int i = 1 ; i <= n ; ++i) ^ arbore.cpp:37:17: error: 't' was not declared in this scope cout << 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ă.