#642
DetDrum
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 nodul k
la rădăcina arborelui.
Problema | DetDrum | Operații I/O |
detdrum.in /detdrum.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #44026969 | Utilizator | |
Fișier | detdrum.cpp | Dimensiune | 553 B |
Data încărcării | 09 Iunie 2023, 11:49 | Scor / rezultat | Eroare de compilare |
detdrum.cpp:7:10: error: expected unqualified-id before 'int' int rad, int viz[101]; ^ detdrum.cpp: In function 'void DFS(int, int)': detdrum.cpp:10:3: error: 'viz' was not declared in this scope viz[x]=1; ^ detdrum.cpp:12:26: error: return-statement with a value, in function returning 'void' [-fpermissive] {if(T[x]==rad) return 0; ^ detdrum.cpp:13:28: error: too few arguments to function 'void DFS(int, int)' else return 1- DFS(T[x]); ^ detdrum.cpp:9:6: note: declared here void DFS(int x, int rad){ ^ detdrum.cpp:13:28: error: return-statement with a value, in function returning 'void' [-fpermissive] else return 1- DFS(T[x]); ^ detdrum.cpp: In function 'int main()': detdrum.cpp:23:10: error: too few arguments to function 'void DFS(int, int)' DFS(k); ^ detdrum.cpp:9:6: note: declared here void DFS(int x, int rad){ ^ detdrum.cpp:25:12: error: 'viz' was not declared in this scope if(viz[i]==1){ ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema DetDrum 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ă.