#471
Bipartit
Se dă lista muchiilor unui graf neorientat cu n
vârfuri, etichetate de la 1
la n
, precum si o mulțime A
de vârfuri ale grafului. Considerăm mulțimea B
formată din vărfurile grafului care nu aparțin lui A
. Să se verifice dacă graful este bipartit peste partiția formată din mulțimile A
și B
.
Problema | Bipartit | Operații I/O |
bipartit.in /bipartit.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #36533553 | Utilizator | |
Fișier | bipartit.cpp | Dimensiune | 2.33 KB |
Data încărcării | 07 Mai 2022, 14:42 | Scor / rezultat | Eroare de compilare |
bipartit.cpp:48:2: error: stray '#' in program }#include <iostream> ^ bipartit.cpp:80:10: error: stray '#' in program f>>k;#include <iostream> ^ bipartit.cpp: In function 'int main()': bipartit.cpp:26:11: warning: unused variable 'j' [-Wunused-variable] int i,j,x,y,nr,k; ^ bipartit.cpp: At global scope: bipartit.cpp:48:3: error: 'include' does not name a type }#include <iostream> ^ bipartit.cpp:51:11: error: redefinition of 'std::ifstream f' ifstream f("bipartit.in"); ^ bipartit.cpp:4:10: error: 'std::ifstream f' previously declared here ifstream f("bipartit.in"); ^ bipartit.cpp:52:11: error: redefinition of 'std::ofstream g' ofstream g("bipartit.out"); ^ bipartit.cpp:5:10: error: 'std::ofstream g' previously declared here ofstream g("bipartit.out"); ^ bipartit.cpp:53:17: error: redefinition of 'int a [1001][1001]' int a[1001][1001],viz[1001],n,m,i,j; ^ bipartit.cpp:6:5: error: 'int a [1001][1001]' previously declared here int a[1001][1001],viz[1001],n,m,i,j; ^ bipartit.cpp:53:27: error: redefinition of 'int viz [1001]' int a[1001][1001],viz[1001],n,m,i,j; ^ bipartit.cpp:6:19: error: 'int viz [1001]' previously declared here int a[1001][1001],viz[1001],n,m,i,j; ^ bipartit.cpp:53:29: error: redefinition of 'int n' int a[1001][1001],viz[1001],n,m,i,j; ^ bipartit.cpp:6:29: error: 'int n' previously declared here int a[1001][1001],viz[1001],n,m,i,j; ^ bipartit.cpp:53:31: error: redefinition of 'int m' int a[1001][1001],viz[1001],n,m,i,j; ^ bipartit.cpp:6:31: error: 'int m' previously declared here int a[1001][1001],viz[1001],n,m,i,j; ^ bipartit.cpp:53:33: error: redefinition of 'int i' int a[1001][1001],viz[1001],n,m,i,j; ^ bipartit.cpp:6:33: error: 'int i' previously declared here int a[1001][1001],viz[1001],n,m,i,j; ^ bipartit.cpp:53:35: error: redefinition of 'int j' int a[1001][1001],viz[1001],n,m,i,j; ^ bipartit.cpp:6:35: error: 'int j' previously declared here int a[1001][1001],viz[1001],n,m,i,j; ^ bipartit.cpp: In function 'int verif(int*, int)': bipartit.cpp:54:5: error: redefinition of 'int verif(int*, int)' int verif(int viz[101],int n) ^ bipartit.cpp:7:5: error: 'int verif(int*, int)' previously defined here int verif(int viz[101],int n) ^ bipartit.cpp: In function 'int main()': bipartit.cpp:71:5: error: redefinition of 'int main()' int main() ^ bipartit.cpp:24:5: error: 'int main()' previously defined here int main() ^ bipartit.cpp:80:11: error: 'include' was not declared in this scope f>>k;#include <iostream> ^ bipartit.cpp:80:28: error: expected primary-expression before '>' token f>>k;#include <iostream> ^ bipartit.cpp:82:1: error: expected primary-expression before 'using' using namespace std; ^ bipartit.cpp:82:1: error: expected ';' before 'using' bipartit.cpp:85:33: error: redeclaration of 'int i' int a[1001][1001],viz[1001],n,m,i,j; ^ bipartit.cpp:73:9: error: 'int i' previously declared here int i,j,x,y,nr,k; ^ bipartit.cpp:85:35: error: redeclaration of 'int j' int a[1001][1001],viz[1001],n,m,i,j; ^ bipartit.cpp:73:11: error: 'int j' previously declared here int i,j,x,y,nr,k; ^ bipartit.cpp:87:1: error: a function-definition is not allowed here before '{' token { ^ bipartit.cpp:73:11: warning: unused variable 'j' [-Wunused-variable] int i,j,x,y,nr,k; ^ bipartit.cpp:73:17: warning: unused variable 'nr' [-Wunused-variable] int i,j,x,y,nr,k; ^ bipartit.cpp:85:5: warning: unused variable 'a' [-Wunused-variable] int a[1001][1001],viz[1001],n,m,i,j; ^ bipartit.cpp:85:19: warning: unused variable 'viz' [-Wunused-variable] int a[1001][1001],viz[1001],n,m,i,j; ^ bipartit.cpp:85:29: warning: unused variable 'n' [-Wunused-variable] int a[1001][1001],viz[1001],n,m,i,j; ^ bipartit.cpp:85:31: warning: unused variable 'm' [-Wunused-variable] int a[1001][1001],viz[1001],n,m,i,j; ^ bipartit.cpp:142:1: error: expected '}' at end of input } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Bipartit 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ă.