#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 | #64536215 | Utilizator | |
| Fișier | ccmax.cpp | Dimensiune | 1.10 KB |
| Data încărcării | 13 Mai 2026, 08:38 | Scor/rezultat | Eroare de compilare |
ccmax.cpp: In function ‘void dfs2(int)’: ccmax.cpp:14:38: error: too few arguments to function ‘void dfs(int, int)’ 14 | if(!c[i] && a[x][i] == 1) dfs(i) , c[i] = 1; | ~~~^~~ ccmax.cpp:4:6: note: declared here 4 | void dfs(int nod,int k){ | ^~~ ccmax.cpp: In function ‘bool econex(int, int*)’: ccmax.cpp:19:32: error: ‘ok’ was not declared in this scope; did you mean ‘k’? 19 | for(int i = 1 ; i <= n && !ok; i++) | ^~ | k ccmax.cpp:21:8: error: ‘ok’ was not declared in this scope; did you mean ‘k’? 21 | if(ok != 0) return 0; | ^~ | k ccmax.cpp: In function ‘int vf(int, int (*)[101])’: ccmax.cpp:28:23: warning: suggest parentheses around assignment used as truth value [-Wparentheses] 28 | if(a[i][j]=1) rez++; | ~~~~~~~^~ ccmax.cpp: In function ‘int vmx(int, int*)’: ccmax.cpp:35:17: error: cannot convert ‘int*’ to ‘int (*)[101]’ 35 | if(mx<vf(n, v)) mx=vf(n,v); | ^ | | | int* ccmax.cpp:24:19: note: initializing argument 2 of ‘int vf(int, int (*)[101])’ 24 | int vf(int n, int a[101][101]){ | ~~~~^~~~~~~~~~~ ccmax.cpp:35:29: error: cannot convert ‘int*’ to ‘int (*)[101]’ 35 | if(mx<vf(n, v)) mx=vf(n,v); | ^ | | | int* ccmax.cpp:24:19: note: initializing argument 2 of ‘int vf(int, int (*)[101])’ 24 | int vf(int n, int a[101][101]){ | ~~~~^~~~~~~~~~~ ccmax.cpp:37:12: error: invalid conversion from ‘int (*)(int, int*)’ to ‘int’ [-fpermissive] 37 | return vmx; | ^~~ | | | int (*)(int, int*) ccmax.cpp: In function ‘int main()’: ccmax.cpp:46:53: error: cannot convert ‘int*’ to ‘int (*)[101]’ 46 | for(int l=0; l<=n; l++) if(econex(n, c) && vf(n,c)==vmx(n,c)) m++; | ^ | | | int* ccmax.cpp:24:19: note: initializing argument 2 of ‘int vf(int, int (*)[101])’ 24 | int vf(int n, int a[101][101]){ | ~~~~^~~~~~~~~~~ ccmax.cpp:49:19: error: invalid operands of types ‘int’ and ‘<unresolved overloaded function type>’ to binary ‘operator<<’ 49 | cout<<m<<' '[k<<endl; | ~^~~~~~ ccmax.cpp:49:25: error: expected ‘]’ before ‘;’ token 49 | cout<<m<<' '[k<<endl; | ^ | ] ccmax.cpp: In function ‘bool econex(int, int*)’: ccmax.cpp:19:13: warning: control reaches end of non-void function [-Wreturn-type] 19 | for(int i = 1 ; i <= n && !ok; i++) | ^
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ă.