#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 | #34978191 | Utilizator | |
Fișier | componenteconexe.cpp | Dimensiune | 775 B |
Data încărcării | 21 Februarie 2022, 20:26 | Scor / rezultat | Eroare de compilare |
componenteconexe.cpp:6:12: warning: missing terminating " character [enabled by default] ofstream g("componenteconexe.out); ^ componenteconexe.cpp:6:1: error: missing terminating " character ofstream g("componenteconexe.out); ^ componenteconexe.cpp:7:17: error: 'n' has not been declared int a[100][100],n,viz[100],v[100],x,y,nrc,cc[100]; ^ componenteconexe.cpp:7:19: error: 'viz' has not been declared int a[100][100],n,viz[100],v[100],x,y,nrc,cc[100]; ^ componenteconexe.cpp:7:28: error: 'v' has not been declared int a[100][100],n,viz[100],v[100],x,y,nrc,cc[100]; ^ componenteconexe.cpp:7:35: error: 'x' has not been declared int a[100][100],n,viz[100],v[100],x,y,nrc,cc[100]; ^ componenteconexe.cpp:7:37: error: 'y' has not been declared int a[100][100],n,viz[100],v[100],x,y,nrc,cc[100]; ^ componenteconexe.cpp:7:39: error: 'nrc' has not been declared int a[100][100],n,viz[100],v[100],x,y,nrc,cc[100]; ^ componenteconexe.cpp:7:43: error: 'cc' has not been declared int a[100][100],n,viz[100],v[100],x,y,nrc,cc[100]; ^ componenteconexe.cpp:7:50: error: expected ')' before ';' token int a[100][100],n,viz[100],v[100],x,y,nrc,cc[100]; ^ componenteconexe.cpp: In function 'void df(int)': componenteconexe.cpp:12:5: error: 'cc' was not declared in this scope cc[v]=ncc; ^ componenteconexe.cpp:13:17: error: 'n' was not declared in this scope for(i=1; i<=n; i++) ^ componenteconexe.cpp:14:14: error: 'a' was not declared in this scope if( (a[v][i]==1) && (cc[i]==0) ) ^ componenteconexe.cpp: In function 'int main()': componenteconexe.cpp:18:8: error: 'n' was not declared in this scope f>>n; ^ componenteconexe.cpp:19:14: error: 'x' was not declared in this scope while(f>>x>>y) ^ componenteconexe.cpp:19:17: error: 'y' was not declared in this scope while(f>>x>>y) ^ componenteconexe.cpp:20:9: error: 'a' was not declared in this scope a[x][y]=a[y][x]=1; ^ componenteconexe.cpp:22:29: error: 'cc' was not declared in this scope for(int i=1; i<=n; i++) cc[i]=0; ^ componenteconexe.cpp:24:13: error: 'cc' was not declared in this scope if (cc[i]==0) { ^ componenteconexe.cpp:28:8: error: invalid operands of types 'std::ofstream(int (*)[100], int, int*, int*, int, int, int, int*) {aka std::basic_ofstream<char>(int (*)[100], int, int*, int*, int, int, int, int*)}' and 'int' to binary 'operator<<' g<<ncc<<endl; ^ componenteconexe.cpp:31:16: error: 'cc' was not declared in this scope if(cc[j]==i) ^ componenteconexe.cpp:32:20: error: invalid operands of types 'std::ofstream(int (*)[100], int, int*, int*, int, int, int, int*) {aka std::basic_ofstream<char>(int (*)[100], int, int*, int*, int, int, int, int*)}' and 'int' to binary 'operator<<' g<<j<<" "; ^ componenteconexe.cpp:33:12: error: invalid operands of types 'std::ofstream(int (*)[100], int, int*, int*, int, int, int, int*) {aka std::basic_ofstream<char>(int (*)[100], int, int*, int*, int, int, int, int*)}' and '<unresolved overloaded function type>' to binary 'operator<<' g<<endl; ^
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ă.