#19
BFS
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 | #7586029 | Utilizator | |
Fișier | bfs.cpp | Dimensiune | 1.23 KB |
Data încărcării | 18 Decembrie 2017, 12:57 | Scor / rezultat | Eroare de compilare |
bfs.cpp:36:2: error: stray '#' in program }#include<fstream> ^ bfs.cpp:36:3: error: 'include' does not name a type }#include<fstream> ^ bfs.cpp:39:13: error: redefinition of 'std::ifstream fin' ifstream fin("BFS.in"); ^ bfs.cpp:4:10: error: 'std::ifstream fin' previously declared here ifstream fin("BFS.in"); ^ bfs.cpp:40:14: error: redefinition of 'std::ofstream fout' ofstream fout("BFS.out"); ^ bfs.cpp:5:10: error: 'std::ofstream fout' previously declared here ofstream fout("BFS.out"); ^ bfs.cpp:41:5: error: redefinition of 'int n' int n,m,a[105][105],s,d,f,v[105]; ^ bfs.cpp:6:5: error: 'int n' previously declared here int n,m,a[105][105],s,d,f,v[105]; ^ bfs.cpp:41:7: error: redefinition of 'int m' int n,m,a[105][105],s,d,f,v[105]; ^ bfs.cpp:6:7: error: 'int m' previously declared here int n,m,a[105][105],s,d,f,v[105]; ^ bfs.cpp:41:19: error: redefinition of 'int a [105][105]' int n,m,a[105][105],s,d,f,v[105]; ^ bfs.cpp:6:9: error: 'int a [105][105]' previously declared here int n,m,a[105][105],s,d,f,v[105]; ^ bfs.cpp:41:21: error: redefinition of 'int s' int n,m,a[105][105],s,d,f,v[105]; ^ bfs.cpp:6:21: error: 'int s' previously declared here int n,m,a[105][105],s,d,f,v[105]; ^ bfs.cpp:41:23: error: redefinition of 'int d' int n,m,a[105][105],s,d,f,v[105]; ^ bfs.cpp:6:23: error: 'int d' previously declared here int n,m,a[105][105],s,d,f,v[105]; ^ bfs.cpp:41:25: error: redefinition of 'int f' int n,m,a[105][105],s,d,f,v[105]; ^ bfs.cpp:6:25: error: 'int f' previously declared here int n,m,a[105][105],s,d,f,v[105]; ^ bfs.cpp:41:32: error: redefinition of 'int v [105]' int n,m,a[105][105],s,d,f,v[105]; ^ bfs.cpp:6:27: error: 'int v [105]' previously declared here int n,m,a[105][105],s,d,f,v[105]; ^ bfs.cpp:42:11: error: redefinition of 'std::queue<int> q' queue<int>q; ^ bfs.cpp:7:11: error: 'std::queue<int> q' previously declared here queue<int>q; ^ bfs.cpp: In function 'void ve()': bfs.cpp:43:6: error: redefinition of 'void ve()' void ve() ^ bfs.cpp:8:6: error: 'void ve()' previously defined here void ve() ^ bfs.cpp: In function 'int main()': bfs.cpp:59:5: error: redefinition of 'int main()' int main() ^ bfs.cpp:24:5: error: 'int main()' previously defined here int main() ^
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ă.