#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 | #58096905 | Utilizator | |
Fișier | dfs.c | Dimensiune | 3.45 KB |
Data încărcării | 13 Mai 2025, 23:24 | Scor / rezultat | 0 puncte |
dfs.c: In function 'compconex': dfs.c:129:5: warning: passing argument 1 of 'BFS' from incompatible pointer type [enabled by default] BFS(a, 1, n, fout, &k); ^ dfs.c:62:6: note: expected 'int (*)[100]' but argument is of type 'int (*)[105]' void BFS(int a[][100], int s,int n,FILE *fout,int *k) ^ dfs.c:137:13: warning: passing argument 1 of 'BFS' from incompatible pointer type [enabled by default] BFS(a, i, n, fout, &k); ^ dfs.c:62:6: note: expected 'int (*)[100]' but argument is of type 'int (*)[105]' void BFS(int a[][100], int s,int n,FILE *fout,int *k) ^ dfs.c: In function 'main': dfs.c:184:5: warning: passing argument 1 of 'DFS' from incompatible pointer type [enabled by default] DFS(a, nod, n, fout); ^ dfs.c:91:6: note: expected 'int (*)[100]' but argument is of type 'int (*)[105]' void DFS(int a[][100], int s, int n, FILE* fout) ^ dfs.c:182:9: warning: unused variable 'k' [-Wunused-variable] int k = 0; ^ dfs.c:173:11: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result] fscanf(fin, "%d %d %d", &n, &m, &nod); ^
Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
---|---|---|---|---|---|---|
1 | 0 secunde | Raspuns gresit. | 20 | 0 | Exemplu | |
2 | 0 secunde | Raspuns gresit. | 40 | 0 | ||
3 | 0 secunde | Raspuns gresit. | 40 | 0 | ||
Punctaj total | 0 |
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ă.