#4067
ccmax
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 | #54430778 | Utilizator | |
Fișier | ccmax.cpp | Dimensiune | 850 B |
Data încărcării | 28 Noiembrie 2024, 10:56 | Scor / rezultat | Eroare de compilare |
ccmax.cpp:4:27: warning: missing terminating ' character [enabled by default] ofstream cout("ccmax.out")' ^ ccmax.cpp:4:1: error: missing terminating ' character ofstream cout("ccmax.out")' ^ ccmax.cpp:5:1: error: expected ',' or ';' before 'int' int n,a[101][101],x,y,p,r[101],v[101],c[101],nrc,i,m; ^ ccmax.cpp: In function 'void bfs(int)': ccmax.cpp:9:7: error: 'p' was not declared in this scope u=p; ^ ccmax.cpp:10:5: error: 'v' was not declared in this scope v[x]=nrc; ^ ccmax.cpp:10:10: error: 'nrc' was not declared in this scope v[x]=nrc; ^ ccmax.cpp:11:5: error: 'c' was not declared in this scope c[p]=x; ^ ccmax.cpp:15:20: error: 'n' was not declared in this scope for(i=1;i<=n;++i) ^ ccmax.cpp:16:16: error: 'a' was not declared in this scope if(a[x][i]==1&&!v[i]) ^ ccmax.cpp: In function 'int main()': ccmax.cpp:26:10: error: 'n' was not declared in this scope cin>>n; ^ ccmax.cpp:27:16: error: 'x' was not declared in this scope while(cin>>x>>y) ^ ccmax.cpp:27:19: error: 'y' was not declared in this scope while(cin>>x>>y) ^ ccmax.cpp:28:9: error: 'a' was not declared in this scope a[x][y]=a[y][x]=1; ^ ccmax.cpp:29:5: error: 'p' was not declared in this scope p=1,nrc=1; ^ ccmax.cpp:29:9: error: 'nrc' was not declared in this scope p=1,nrc=1; ^ ccmax.cpp:30:9: error: 'i' was not declared in this scope for(i=1;i<=n;i++) ^ ccmax.cpp:31:9: error: 'v' was not declared in this scope if(!v[i]){ ^ ccmax.cpp:35:9: error: 'i' was not declared in this scope for(i=1;i<=n;i++) ^ ccmax.cpp:36:9: error: 'r' was not declared in this scope r[v[i]]++; ^ ccmax.cpp:36:11: error: 'v' was not declared in this scope r[v[i]]++; ^ ccmax.cpp:38:9: error: 'i' was not declared in this scope for(i=1;i<=nrc;i++) ^ ccmax.cpp:39:12: error: 'r' was not declared in this scope if(r[i]>ma) ^ ccmax.cpp:42:9: error: 'i' was not declared in this scope for(i=1;i<=nrc;i++) ^ ccmax.cpp:43:12: error: 'r' was not declared in this scope if(r[i]==ma) ^
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ă.