#4067
Se dă un graf neorientat cu n
vârfuri. Determinați numărul maxim de vârfuri dintr-o componentă conexă și numarul de componente conexe care au acest număr maxim de vârfuri.
Problema | ccmax | Operații I/O |
![]() ccmax.in /ccmax.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #49355886 | Utilizator | |
Fișier | ccmax.cpp | Dimensiune | 584 B |
Data încărcării | 27 Februarie 2024, 14:09 | Scor / rezultat | Eroare de compilare |
ccmax.cpp:8:1: error: expected ',' or ';' before 'int' int A[501][501],v[501],n,x,y,M=-1,k,cnt=0; ^ ccmax.cpp: In function 'int f(int)': ccmax.cpp:12:5: error: 'v' was not declared in this scope v[nod]=1; ^ ccmax.cpp:13:20: error: 'n' was not declared in this scope for(int i=1;i<=n;i++){ ^ ccmax.cpp:14:12: error: 'A' was not declared in this scope if(A[nod][i]==1 and v[i]==0){ ^ ccmax.cpp:19:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^ ccmax.cpp: In function 'int main()': ccmax.cpp:24:9: error: 'n' was not declared in this scope in>>n; ^ ccmax.cpp:25:15: error: 'x' was not declared in this scope while(in>>x>>y) ^ ccmax.cpp:25:18: error: 'y' was not declared in this scope while(in>>x>>y) ^ ccmax.cpp:27:12: error: 'A' was not declared in this scope if(A[x][y]==0) ^ ccmax.cpp:31:9: error: 'k' was not declared in this scope k=0; ^ ccmax.cpp:32:12: error: 'v' was not declared in this scope if(v[i]==0) f(i); ^ ccmax.cpp:33:14: error: 'M' was not declared in this scope if(k>M) {M=k;cnt=1;} ^ ccmax.cpp:33:22: error: 'cnt' was not declared in this scope if(k>M) {M=k;cnt=1;} ^ ccmax.cpp:34:15: error: 'M' was not declared in this scope if(k==M) cnt++; ^ ccmax.cpp:34:18: error: 'cnt' was not declared in this scope if(k==M) cnt++; ^ ccmax.cpp:36:10: error: 'M' was not declared in this scope out<<M<<' '<<cnt; ^ ccmax.cpp:36:18: error: 'cnt' was not declared in this scope out<<M<<' '<<cnt; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ccmax 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ă.