#19
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 lățime a grafului pornind din vârful X
.
Problema | BFS | Operații I/O |
![]() BFS.in /BFS.out
|
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 128 MB
/
Stivă 8 MB
|
Id soluție | #58040004 | Utilizator | |
Fișier | bfs.c | Dimensiune | 1.46 KB |
Data încărcării | 10 Mai 2025, 12:01 | Scor / rezultat | 0 puncte |
bfs.c:37:5: warning: second argument of 'main' should be 'char **' [-Wmain] int main(int argc, char **argv[2]) ^ bfs.c: In function 'main': bfs.c:46:2: warning: missing braces around initializer [-Wmissing-braces] int matrice[MAX][MAX] = { 0 }, i, j, n, nod1, nod2, vizitat[MAX] = { 0 }; ^ bfs.c:46:2: warning: (near initialization for 'matrice[0]') [-Wmissing-braces] bfs.c:48:2: warning: passing argument 1 of 'fopen' from incompatible pointer type [enabled by default] input = fopen(argv[1], "r"); ^ In file included from bfs.c:2:0: /usr/include/stdio.h:272:14: note: expected 'const char * restrict' but argument is of type 'char **' extern FILE *fopen (const char *__restrict __filename, ^ bfs.c:49:7: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result] fgets(buffer, 254, input); ^
Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
---|---|---|---|---|---|---|
1 | 0 secunde | Exited with error status 255 | 10 | 0 | ||
2 | 0 secunde | Exited with error status 255 | 15 | 0 | ||
3 | 0 secunde | Exited with error status 255 | 25 | 0 | ||
4 | 0 secunde | Exited with error status 255 | 10 | 0 | ||
5 | 0 secunde | Exited with error status 255 | 10 | 0 | ||
6 | 0 secunde | Exited with error status 255 | 15 | 0 | ||
7 | 0 secunde | Exited with error status 255 | 15 | 0 | ||
Punctaj total | 0 |
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema BFS 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ă.