#472
Se dă lista muchiilor unui graf neorientat cu n vârfuri, etichetate de la 1 la n. Să se verifice dacă graful este bipartit.
| Problema | Bipartit1 | Operații I/O |
bipartit1.in/bipartit1.out
|
|---|---|---|---|
| Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #63735923 | Utilizator | |
| Fișier | bipartit1.cpp | Dimensiune | 960 B |
| Data încărcării | 17 Martie 2026, 10:27 | Scor/rezultat | Eroare de compilare |
bipartit1.cpp:6:31: error: expected ',' or ';' before ':' token ofstream cout("bipartit1.out"): ^ bipartit1.cpp: In function 'void citire()': bipartit1.cpp:10:7: error: 'n' was not declared in this scope cin>>n>>m; ^ bipartit1.cpp:10:10: error: 'm' was not declared in this scope cin>>n>>m; ^ bipartit1.cpp:15:3: error: 'a' was not declared in this scope a[x][y]=a[y][x]=1; ^ bipartit1.cpp: In function 'bool BFS(int)': bipartit1.cpp:23:2: error: 'viz' was not declared in this scope viz[vf]=1; ^ bipartit1.cpp:28:19: error: 'n' was not declared in this scope for(int i=1; i<=n; i++) ^ bipartit1.cpp:29:7: error: 'a' was not declared in this scope if(a[x][i]==1) ^ bipartit1.cpp: In function 'int main()': bipartit1.cpp:50:18: error: 'n' was not declared in this scope for(int i=1; i<=n; i++) ^ bipartit1.cpp:51:6: error: 'viz' was not declared in this scope if(viz[i]==0) ^ bipartit1.cpp:61:18: error: 'n' was not declared in this scope for(int i=1; i<=n; i++) ^ bipartit1.cpp:62:6: error: 'viz' was not declared in this scope if(viz[i]==1) ^ bipartit1.cpp:65:21: error: 'n' was not declared in this scope for(int i=1; i<=n; i++) ^ bipartit1.cpp:66:8: error: 'viz' was not declared in this scope if(viz[i]==2) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Bipartit1 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ă.