#4781
Se dă lista muchiilor unui graf neorientat. Să se afișeze componentele conexe ale acestui graf.
| Problema | ComponenteConexe6 | Operații I/O |
componenteconexe6.in/componenteconexe6.out
|
|---|---|---|---|
| Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #63926622 | Utilizator | |
| Fișier | componenteconexe6.cpp | Dimensiune | 764 B |
| Data încărcării | 27 Martie 2026, 08:43 | Scor/rezultat | Eroare de compilare |
componenteconexe6.cpp:5:1: error: expected ',' or ';' before 'ofstream' ofstream g("componenteconexe6.out") ^ componenteconexe6.cpp: In function 'int bfs(int, int)': componenteconexe6.cpp:10:3: error: 'v' was not declared in this scope { v[start]=k ^ componenteconexe6.cpp:11:3: error: expected ';' before 'int' int i,k,st,dr; ^ componenteconexe6.cpp:13:3: error: 'st' was not declared in this scope st=dr=1; ^ componenteconexe6.cpp:13:6: error: 'dr' was not declared in this scope st=dr=1; ^ componenteconexe6.cpp:14:3: error: 'x' was not declared in this scope x[1]=start; ^ componenteconexe6.cpp:19:9: error: 'i' was not declared in this scope for(i=1;i<=n;i++) ^ componenteconexe6.cpp:19:16: error: 'n' was not declared in this scope for(i=1;i<=n;i++) ^ componenteconexe6.cpp:20:21: error: 'a' was not declared in this scope if(v[i]==0 && a[k][i]==1) ^ componenteconexe6.cpp: In function 'int main()': componenteconexe6.cpp:31:5: error: 'n' was not declared in this scope {f>>n; ^ componenteconexe6.cpp:32:11: error: 'i' was not declared in this scope while (f>>i>>j) ^ componenteconexe6.cpp:32:14: error: 'j' was not declared in this scope while (f>>i>>j) ^ componenteconexe6.cpp:33:1: error: 'a' was not declared in this scope a[i][j]=a[j][i]=1; ^ componenteconexe6.cpp:35:4: error: 'v' was not declared in this scope if(v[i]==0) ^ componenteconexe6.cpp:35:6: error: 'i' was not declared in this scope if(v[i]==0) ^ componenteconexe6.cpp:36:6: error: 'nod' was not declared in this scope {nod=i; ^ componenteconexe6.cpp:38:5: error: 'nod' was not declared in this scope if (nod!=0) ^ componenteconexe6.cpp:40:5: error: 'nr' was not declared in this scope nr++; ^ componenteconexe6.cpp:43:1: error: expected ';' before '}' token }} while(nod!=0) ^ componenteconexe6.cpp:43:10: error: 'nod' was not declared in this scope }} while(nod!=0) ^ componenteconexe6.cpp:44:1: error: expected ';' before 'g' g<<nr<<endl; ^ componenteconexe6.cpp:44:1: error: 'g' was not declared in this scope componenteconexe6.cpp:44:4: error: 'nr' was not declared in this scope g<<nr<<endl; ^ componenteconexe6.cpp:45:5: error: 'i' was not declared in this scope for(i=1;i<=n;i++) ^ componenteconexe6.cpp:46:9: error: 'j' was not declared in this scope for(j==1;j<=m;j++) ^ componenteconexe6.cpp:46:17: error: 'm' was not declared in this scope for(j==1;j<=m;j++) ^ componenteconexe6.cpp:47:8: error: 'v' was not declared in this scope if(v[j]==i) ^ componenteconexe6.cpp: In function 'int bfs(int, int)': componenteconexe6.cpp:28:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ComponenteConexe6 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ă.