#4276
NrCompConexe
Dându-se un graf neorientat cu n
noduri și m
muchii, să se determine numărul componentelor conexe.
Problema | NrCompConexe | Operații I/O |
![]() nrcompconexe.in /nrcompconexe.out
|
---|---|---|---|
Limita timp | 0.2 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #48622291 | Utilizator | |
Fișier | nrcompconexe.cpp | Dimensiune | 1.53 KB |
Data încărcării | 31 Ianuarie 2024, 11:47 | Scor / rezultat | Eroare de compilare |
nrcompconexe.cpp:26:1: error: expected unqualified-id before numeric constant 1707 ^ nrcompconexe.cpp:30:5: error: redefinition of 'int n' int n , x , y , C[101] , m; ^ nrcompconexe.cpp:6:5: error: 'int n' previously declared here int n , m , x , y , viz[100001] , cnt, a[101][101]; ^ nrcompconexe.cpp:30:9: error: redefinition of 'int x' int n , x , y , C[101] , m; ^ nrcompconexe.cpp:6:13: error: 'int x' previously declared here int n , m , x , y , viz[100001] , cnt, a[101][101]; ^ nrcompconexe.cpp:30:13: error: redefinition of 'int y' int n , x , y , C[101] , m; ^ nrcompconexe.cpp:6:17: error: 'int y' previously declared here int n , m , x , y , viz[100001] , cnt, a[101][101]; ^ nrcompconexe.cpp:30:26: error: redefinition of 'int m' int n , x , y , C[101] , m; ^ nrcompconexe.cpp:6:9: error: 'int m' previously declared here int n , m , x , y , viz[100001] , cnt, a[101][101]; ^ nrcompconexe.cpp:31:1: error: 'vector' does not name a type vector <int> G[101]; ^ nrcompconexe.cpp: In function 'void dfs(int, int)': nrcompconexe.cpp:32:6: error: redefinition of 'void dfs(int, int)' void dfs(int v , int x) ^ nrcompconexe.cpp:8:6: error: 'void dfs(int, int)' previously defined here void dfs(int x, int cnt) ^ nrcompconexe.cpp:35:17: error: 'G' was not declared in this scope for(int i : G[v]) ^ nrcompconexe.cpp: In function 'int main()': nrcompconexe.cpp:38:5: error: redefinition of 'int main()' int main() ^ nrcompconexe.cpp:14:5: error: 'int main()' previously defined here int main() ^ nrcompconexe.cpp:44:9: error: 'G' was not declared in this scope G[x].push_back(y); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema NrCompConexe 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ă.