#438
ComponenteConexe
Se dă lista muchiilor unui graf neorientat. Să se afișeze componentele conexe ale acestui graf.
Problema | ComponenteConexe | Operații I/O |
componenteconexe.in /componenteconexe.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #49589792 | Utilizator | |
Fișier | componenteconexe.cpp | Dimensiune | 659 B |
Data încărcării | 08 Martie 2024, 09:36 | Scor / rezultat | Eroare de compilare |
componenteconexe.cpp:1:1: error: 'ifstream' does not name a type ifstream in ("componenteconexe.in"); ^ componenteconexe.cpp:2:1: error: 'ofstream' does not name a type ofstream out ("componenteconexe.out"); ^ componenteconexe.cpp: In function 'void dfs(int, int)': componenteconexe.cpp:5:5: error: 'viz' was not declared in this scope viz[nod] = nr; ^ componenteconexe.cpp:7:25: error: 'n' was not declared in this scope for(int j = 1; j <= n; j++) ^ componenteconexe.cpp:8:19: error: 'a' was not declared in this scope if(!viz[j] && a[nod][j] == 1) { ^ componenteconexe.cpp: In function 'int main()': componenteconexe.cpp:16:5: error: 'in' was not declared in this scope in >> n; ^ componenteconexe.cpp:16:11: error: 'n' was not declared in this scope in >> n; ^ componenteconexe.cpp:19:9: error: 'a' was not declared in this scope a[i][j] = a[j][i] = 1; ^ componenteconexe.cpp:23:13: error: 'viz' was not declared in this scope if(!viz[i]) { ^ componenteconexe.cpp:24:13: error: 'nr' was not declared in this scope nr++; ^ componenteconexe.cpp:30:1: error: 'out' was not declared in this scope out << nr << endl; ^ componenteconexe.cpp:30:8: error: 'nr' was not declared in this scope out << nr << endl; ^ componenteconexe.cpp:30:14: error: 'endl' was not declared in this scope out << nr << endl; ^ componenteconexe.cpp:33:8: error: 'viz' was not declared in this scope if(viz[j] == i) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ComponenteConexe 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ă.