#1603
ComponenteConexe3
Se dă lista muchiilor unui graf neorientat. Pentru fiecare componentă conexă numim cel mai mic vârf de ea reprezentant al componentei conexe. Determinați reprezentantul componentei conexe cu cele mai multe vârfuri și câte noduri conține aceasta.
Problema | ComponenteConexe3 | Operații I/O |
componenteconexe3.in /componenteconexe3.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #47285556 | Utilizator | |
Fișier | componenteconexe3.cpp | Dimensiune | 944 B |
Data încărcării | 08 Decembrie 2023, 13:30 | Scor / rezultat | Eroare de compilare |
componenteconexe3.cpp:6:1: error: expected ',' or ';' before 'int' int n,m,x,viz[101],i,plecare,y,a[101][101],maxnoduri=0,ccmax,nrnoduri=0,plec[101]; ^ componenteconexe3.cpp: In function 'void trav_ad(int)': componenteconexe3.cpp:11:6: error: 'viz' was not declared in this scope { viz[nod]=x; //marcam vizitarea nodului ^ componenteconexe3.cpp:11:15: error: 'x' was not declared in this scope { viz[nod]=x; //marcam vizitarea nodului ^ componenteconexe3.cpp:12:5: error: 'nrnoduri' was not declared in this scope nrnoduri++; ^ componenteconexe3.cpp:14:16: error: 'n' was not declared in this scope for(i=1;i<=n;i++) ^ componenteconexe3.cpp:15:20: error: 'a' was not declared in this scope if(viz[i]==0&&a[nod][i]==1) // cautam noduri nevizitate spre care putem continua drumul ^ componenteconexe3.cpp: In function 'int main()': componenteconexe3.cpp:19:6: error: 'n' was not declared in this scope { f>>n; ^ componenteconexe3.cpp:20:11: error: 'x' was not declared in this scope while(f>>x>>y) ^ componenteconexe3.cpp:20:14: error: 'y' was not declared in this scope while(f>>x>>y) ^ componenteconexe3.cpp:21:3: error: 'a' was not declared in this scope a[x][y]=a[y][x]=1; // marcam latura in matrice ^ componenteconexe3.cpp:22:3: error: 'x' was not declared in this scope x=0; ^ componenteconexe3.cpp:23:7: error: 'plecare' was not declared in this scope for(plecare=1;plecare<=n;plecare++) ^ componenteconexe3.cpp:24:5: error: 'viz' was not declared in this scope if(viz[plecare]==0) ^ componenteconexe3.cpp:26:3: error: 'nrnoduri' was not declared in this scope nrnoduri=0; ^ componenteconexe3.cpp:27:3: error: 'plec' was not declared in this scope plec[x]=plecare; ^ componenteconexe3.cpp:30:14: error: 'maxnoduri' was not declared in this scope if(nrnoduri>maxnoduri) ^ componenteconexe3.cpp:33:6: error: 'ccmax' was not declared in this scope ccmax=x; ^ componenteconexe3.cpp:36:4: error: 'plec' was not declared in this scope g<<plec[ccmax]<<" "<<maxnoduri; ^ componenteconexe3.cpp:36:9: error: 'ccmax' was not declared in this scope g<<plec[ccmax]<<" "<<maxnoduri; ^ componenteconexe3.cpp:36:22: error: 'maxnoduri' was not declared in this scope g<<plec[ccmax]<<" "<<maxnoduri; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ComponenteConexe3 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ă.