#539
Se consideră un graf neorientat cu n
vârfuri și m
muchii și un vârf cunoscut X
. Să se afişeze vârfurile vizitate în urma parcurgerii în adâncime a grafului pornind din vârful X
.
Problema | DFS | Operații I/O |
![]() dfs.in /dfs.out
|
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 128 MB
/
Stivă 8 MB
|
Id soluție | #55767222 | Utilizator | |
Fișier | dfs.cpp | Dimensiune | 468 B |
Data încărcării | 25 Ianuarie 2025, 15:00 | Scor / rezultat | Eroare de compilare |
dfs.cpp:8:15: error: two or more data types in declaration of 'a' int a[101][101], viz[101], nod,n,m; ^ dfs.cpp:8:25: error: two or more data types in declaration of 'viz' int a[101][101], viz[101], nod,n,m; ^ dfs.cpp:8:28: error: two or more data types in declaration of 'nod' int a[101][101], viz[101], nod,n,m; ^ dfs.cpp:8:32: error: two or more data types in declaration of 'n' int a[101][101], viz[101], nod,n,m; ^ dfs.cpp:8:34: error: two or more data types in declaration of 'm' int a[101][101], viz[101], nod,n,m; ^ dfs.cpp: In function 'void citire()': dfs.cpp:13:8: error: 'n' was not declared in this scope f >> n >> m >> nod; ^ dfs.cpp:13:13: error: 'm' was not declared in this scope f >> n >> m >> nod; ^ dfs.cpp:13:18: error: 'nod' was not declared in this scope f >> n >> m >> nod; ^ dfs.cpp:17:6: error: 'a' was not declared in this scope a[x][y]=a[y][x]=1; ^ dfs.cpp: In function 'void df(int)': dfs.cpp:24:5: error: 'viz' was not declared in this scope viz[nod]=1; ^ dfs.cpp:25:5: error: 'g' was not declared in this scope g << nod << " "; ^ dfs.cpp:26:21: error: 'n' was not declared in this scope for(int i=1; i<=n;i++) ^ dfs.cpp:27:12: error: 'a' was not declared in this scope if(a[nod][i] && !viz[i]) ^ dfs.cpp: In function 'int main()': dfs.cpp:35:4: error: 'nod' was not declared in this scope df(nod); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema DFS 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ă.