#441
ComponenteConexe1
Se dă lista muchiilor unui graf neorientat. Să se determine numărul minim de muchii care trebuie adăugate pentru ca graful să devină conex, precum și un set de asemenea muchii.
Problema | ComponenteConexe1 | Operații I/O |
componenteconexe1.in /componenteconexe1.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53112862 | Utilizator | |
Fișier | componenteconexe1.cpp | Dimensiune | 773 B |
Data încărcării | 17 Octombrie 2024, 22:06 | Scor / rezultat | Eroare de compilare |
componenteconexe1.cpp:7:15: warning: missing terminating " character [enabled by default] ofstream fout("componenteconexe1.out); ^ componenteconexe1.cpp:7:1: error: missing terminating " character ofstream fout("componenteconexe1.out); ^ componenteconexe1.cpp:9:18: error: 'v' has not been declared int a[101][101], v[101], c[101], ultim, prim, nod, p, nc, n, x, y; ^ componenteconexe1.cpp:9:26: error: 'c' has not been declared int a[101][101], v[101], c[101], ultim, prim, nod, p, nc, n, x, y; ^ componenteconexe1.cpp:9:34: error: 'ultim' has not been declared int a[101][101], v[101], c[101], ultim, prim, nod, p, nc, n, x, y; ^ componenteconexe1.cpp:9:41: error: 'prim' has not been declared int a[101][101], v[101], c[101], ultim, prim, nod, p, nc, n, x, y; ^ componenteconexe1.cpp:9:47: error: 'nod' has not been declared int a[101][101], v[101], c[101], ultim, prim, nod, p, nc, n, x, y; ^ componenteconexe1.cpp:9:52: error: 'p' has not been declared int a[101][101], v[101], c[101], ultim, prim, nod, p, nc, n, x, y; ^ componenteconexe1.cpp:9:55: error: 'nc' has not been declared int a[101][101], v[101], c[101], ultim, prim, nod, p, nc, n, x, y; ^ componenteconexe1.cpp:9:59: error: 'n' has not been declared int a[101][101], v[101], c[101], ultim, prim, nod, p, nc, n, x, y; ^ componenteconexe1.cpp:9:62: error: 'x' has not been declared int a[101][101], v[101], c[101], ultim, prim, nod, p, nc, n, x, y; ^ componenteconexe1.cpp:9:65: error: 'y' has not been declared int a[101][101], v[101], c[101], ultim, prim, nod, p, nc, n, x, y; ^ componenteconexe1.cpp:9:66: error: expected ')' before ';' token int a[101][101], v[101], c[101], ultim, prim, nod, p, nc, n, x, y; ^ componenteconexe1.cpp: In function 'void BFS(int, int)': componenteconexe1.cpp:13:2: error: 'ultim' was not declared in this scope ultim=prim=1; ^ componenteconexe1.cpp:13:8: error: 'prim' was not declared in this scope ultim=prim=1; ^ componenteconexe1.cpp:14:2: error: 'v' was not declared in this scope v[p]=nc; ^ componenteconexe1.cpp:15:2: error: 'c' was not declared in this scope c[1]=p; ^ componenteconexe1.cpp:18:6: error: 'nod' was not declared in this scope nod=c[ultim]; ^ componenteconexe1.cpp:19:18: error: 'n' was not declared in this scope for(int i=1;i<=n;i++) ^ componenteconexe1.cpp:20:16: error: 'a' was not declared in this scope if(v[i]==0&&a[nof][i]==1) ^ componenteconexe1.cpp:20:18: error: 'nof' was not declared in this scope if(v[i]==0&&a[nof][i]==1) ^ componenteconexe1.cpp: In function 'int main()': componenteconexe1.cpp:31:10: error: 'n' was not declared in this scope fin>>n; ^ componenteconexe1.cpp:32:18: error: 'x' was not declared in this scope while(fin>>x>>y) ^ componenteconexe1.cpp:32:21: error: 'y' was not declared in this scope while(fin>>x>>y) ^ componenteconexe1.cpp:33:6: error: 'a' was not declared in this scope a[x][y]=a[y][x]=1; ^ componenteconexe1.cpp:35:6: error: 'v' was not declared in this scope if(v[i]==0) ^ componenteconexe1.cpp:37:4: error: 'nc' was not declared in this scope nc++; ^ componenteconexe1.cpp:40:8: error: 'nc' was not declared in this scope fout<<nc-1<<'\n'; ^ componenteconexe1.cpp:43:3: error: 'p' was not declared in this scope p=0; ^ componenteconexe1.cpp:45:7: error: 'v' was not declared in this scope if(v[j]==i) p=j; ^ componenteconexe1.cpp:46:9: error: invalid operands of types 'std::ofstream(int (*)[101], int*, int*, int, int, int, int, int, int, int, int) {aka std::basic_ofstream<char>(int (*)[101], int*, int*, int, int, int, int, int, int, int, int)}' and 'int' to binary 'operator<<' fout<<1<<" "<<p<<'\n'; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ComponenteConexe1 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ă.