#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 | #4903442 | Utilizator | |
Fișier | componenteconexe1.cpp | Dimensiune | 729 B |
Data încărcării | 04 Aprilie 2017, 15:43 | Scor / rezultat | Eroare de compilare |
componenteconexe1.cpp:5:33: warning: missing terminating " character [enabled by default] ofstream g(componenteconexe1.out"); ^ componenteconexe1.cpp:5:1: error: missing terminating " character ofstream g(componenteconexe1.out"); ^ componenteconexe1.cpp:5:12: error: 'componenteconexe1' was not declared in this scope ofstream g(componenteconexe1.out"); ^ componenteconexe1.cpp:6:8: error: 'm' was not declared in this scope int n, m, a[101][101], i, y, k, viz[101], p, u, q[101], ok, x, nc, j; ^ componenteconexe1.cpp:6:11: error: 'a' was not declared in this scope int n, m, a[101][101], i, y, k, viz[101], p, u, q[101], ok, x, nc, j; ^ componenteconexe1.cpp:6:24: error: 'i' was not declared in this scope int n, m, a[101][101], i, y, k, viz[101], p, u, q[101], ok, x, nc, j; ^ componenteconexe1.cpp:6:27: error: 'y' was not declared in this scope int n, m, a[101][101], i, y, k, viz[101], p, u, q[101], ok, x, nc, j; ^ componenteconexe1.cpp:6:30: error: 'k' was not declared in this scope int n, m, a[101][101], i, y, k, viz[101], p, u, q[101], ok, x, nc, j; ^ componenteconexe1.cpp:6:33: error: 'viz' was not declared in this scope int n, m, a[101][101], i, y, k, viz[101], p, u, q[101], ok, x, nc, j; ^ componenteconexe1.cpp:6:43: error: 'p' was not declared in this scope int n, m, a[101][101], i, y, k, viz[101], p, u, q[101], ok, x, nc, j; ^ componenteconexe1.cpp:6:46: error: 'u' was not declared in this scope int n, m, a[101][101], i, y, k, viz[101], p, u, q[101], ok, x, nc, j; ^ componenteconexe1.cpp:6:49: error: 'q' was not declared in this scope int n, m, a[101][101], i, y, k, viz[101], p, u, q[101], ok, x, nc, j; ^ componenteconexe1.cpp:6:57: error: 'ok' was not declared in this scope int n, m, a[101][101], i, y, k, viz[101], p, u, q[101], ok, x, nc, j; ^ componenteconexe1.cpp:6:61: error: 'x' was not declared in this scope int n, m, a[101][101], i, y, k, viz[101], p, u, q[101], ok, x, nc, j; ^ componenteconexe1.cpp:6:64: error: 'nc' was not declared in this scope int n, m, a[101][101], i, y, k, viz[101], p, u, q[101], ok, x, nc, j; ^ componenteconexe1.cpp:6:68: error: 'j' was not declared in this scope int n, m, a[101][101], i, y, k, viz[101], p, u, q[101], ok, x, nc, j; ^ componenteconexe1.cpp: In function 'void BF(int)': componenteconexe1.cpp:10:5: error: 'viz' was not declared in this scope viz[start]=nc; ^ componenteconexe1.cpp:10:16: error: 'nc' was not declared in this scope viz[start]=nc; ^ componenteconexe1.cpp:11:17: error: 'n' was not declared in this scope for(i=1; i<=n; i++) ^ componenteconexe1.cpp:12:8: error: 'a' was not declared in this scope if(a[start][i]==1 &&viz[i]==0) BF(i); ^ componenteconexe1.cpp: In function 'int main()': componenteconexe1.cpp:16:8: error: 'n' was not declared in this scope f>>n; ^ componenteconexe1.cpp:17:14: error: 'x' was not declared in this scope while(f>>x>>y) ^ componenteconexe1.cpp:17:17: error: 'y' was not declared in this scope while(f>>x>>y) ^ componenteconexe1.cpp:18:9: error: 'a' was not declared in this scope a[x][y]=a[y][x]=1; ^ componenteconexe1.cpp:19:9: error: 'i' was not declared in this scope for(i=1; i<=n; i++) ^ componenteconexe1.cpp:20:12: error: 'viz' was not declared in this scope if(viz[i]==0) ^ componenteconexe1.cpp:22:13: error: 'nc' was not declared in this scope nc++; ^ componenteconexe1.cpp:25:8: error: 'nc' was not declared in this scope g<<nc-1<<'\n'; ^ componenteconexe1.cpp:26:9: error: 'i' was not declared in this scope for(i=1; i<=n; i++) ^ componenteconexe1.cpp:28:11: error: 'viz' was not declared in this scope if(viz[i]!=1) ^ componenteconexe1.cpp:30:12: error: 'j' was not declared in this scope for(j=i+1; j<=n; j++) ^
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ă.