#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 | #39987586 | Utilizator | |
Fișier | componenteconexe1.cpp | Dimensiune | 568 B |
Data încărcării | 23 Noiembrie 2022, 11:38 | Scor / rezultat | Eroare de compilare |
componenteconexe1.cpp:6:1: error: expected ',' or ';' before 'int' int cc,n,m,x,viz[101],i,plecare,y,a[101][101],c[100]; ^ componenteconexe1.cpp: In function 'void trav_ad(int)': componenteconexe1.cpp:9:5: error: 'viz' was not declared in this scope viz[nod]=1; ^ componenteconexe1.cpp:11:16: error: 'n' was not declared in this scope for(i=1;i<=n;i++) ^ componenteconexe1.cpp:12:20: error: 'a' was not declared in this scope if(viz[i]==0&&a[nod][i]==1) ^ componenteconexe1.cpp: In function 'int main()': componenteconexe1.cpp:16:6: error: 'n' was not declared in this scope { f>>n; ^ componenteconexe1.cpp:17:11: error: 'x' was not declared in this scope while(f>>x>>y) ^ componenteconexe1.cpp:17:14: error: 'y' was not declared in this scope while(f>>x>>y) ^ componenteconexe1.cpp:18:3: error: 'a' was not declared in this scope {a[x][y]=a[y][x]=1;} ^ componenteconexe1.cpp:19:7: error: 'plecare' was not declared in this scope for(plecare=1;plecare<=n;plecare++) ^ componenteconexe1.cpp:20:5: error: 'viz' was not declared in this scope if(viz[plecare]==0) ^ componenteconexe1.cpp:21:4: error: 'cc' was not declared in this scope { cc++; ^ componenteconexe1.cpp:22:2: error: 'c' was not declared in this scope c[cc]=plecare; ^ componenteconexe1.cpp:24:5: error: 'cc' was not declared in this scope g<<cc-1<<endl; ^ componenteconexe1.cpp:25:6: error: 'i' was not declared in this scope for(i=1;i<=cc;i++) ^ componenteconexe1.cpp:26:8: error: 'c' was not declared in this scope g<<c[i]<<" "<<c[i+1]<<endl;; ^
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ă.