Advertisement
Guest User

Untitled

a guest
Dec 17th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. ifstream f("bipartitcomplet.in");
  4. ofstream g("bipartitcomplet.out");
  5. int n,m,ma[101][101],i,cnt,j,v[101];
  6. int ver(int um)
  7. {
  8. for(int q=1; q<=m; q++)if(um==v[q])return 0;
  9. return 1;
  10. }
  11. int main()
  12. {
  13.  
  14. f>>n>>m;
  15. for(i=1; i<=m; i++)f>>v[i];
  16.  
  17. for(i=1; i<=n; i++)
  18. {
  19. for(j=1; j<=n; j++)
  20. {
  21. if(ver(j)!=ver(i)) ma[i][j]=1;
  22. else ma[i][j]=0;
  23. }
  24. }
  25. for(i=1; i<=n; i++)
  26. {
  27. for(j=1; j<=n; j++)
  28. g<<ma[i][j]<<' ';
  29. g<<endl;
  30. }
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement