#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 | #54950497 | Utilizator | |
Fișier | componenteconexe.cpp | Dimensiune | 877 B |
Data încărcării | 13 Decembrie 2024, 10:43 | Scor / rezultat | Eroare de compilare |
componenteconexe.cpp:4:11: error: variable 'std::ifstream f' has initializer but incomplete type ifstream f("componenteconexe.in") ^ componenteconexe.cpp:5:1: error: expected ',' or ';' before 'ofstream' ofstream g("componenteconexe.out") ^ componenteconexe.cpp: In function 'void bf(int)': componenteconexe.cpp:16:2: error: 'c' was not declared in this scope c[1]=x; ^ componenteconexe.cpp:17:2: error: 'viz' was not declared in this scope viz[x]=nr; ^ componenteconexe.cpp:17:9: error: 'nr' was not declared in this scope viz[x]=nr; ^ componenteconexe.cpp:21:15: error: 'n' was not declared in this scope for(i=1; i<=n; i++) ^ componenteconexe.cpp:23:7: error: 'a' was not declared in this scope if(a[x][i]==1 && viz[i]==0) ^ componenteconexe.cpp: In function 'int main()': componenteconexe.cpp:36:6: error: 'n' was not declared in this scope f>>n; ^ componenteconexe.cpp:38:4: error: 'a' was not declared in this scope a[i][j]=a[j][i]=1; ^ componenteconexe.cpp:41:7: error: 'viz' was not declared in this scope if(viz[i]==0) ^ componenteconexe.cpp:43:5: error: 'nr' was not declared in this scope nr++; ^ componenteconexe.cpp:45:5: error: 'g' was not declared in this scope }g<<nr<<endl; ^ componenteconexe.cpp:45:8: error: 'nr' was not declared in this scope }g<<nr<<endl; ^ componenteconexe.cpp:48:6: error: 'viz' was not declared in this scope if(viz[j]==i) ^ componenteconexe.cpp:50:3: error: expected ';' before 'g' g<<endl;} ^ componenteconexe.cpp:35:8: warning: unused variable 'x' [-Wunused-variable] { int x,i,j,z; ^ componenteconexe.cpp:35:14: warning: unused variable 'z' [-Wunused-variable] { int x,i,j,z; ^
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ă.