Advertisement
kolbka_

Untitled

Jan 17th, 2022
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1.  
  2.  
  3.  
  4. #include <iostream>
  5. #include <cassert>
  6. #include <algorithm>
  7. #include <vector>
  8. #include <unordered_map>
  9. #include "optimization.h"
  10. #include <map>
  11. #include <unordered_set>
  12. #define all(a) a.begin, a.end()
  13. using namespace std;
  14. int main(){
  15. int v = readInt();
  16. int e = readInt();
  17. // cin >> v >> e;
  18. vector<vector<bool>> matrix(v, vector<bool> (e, false));
  19. for (int i = 0; i < e; i++){
  20. int a,b;
  21. // cin >> a >> b;
  22. a = readInt();
  23. b= readInt();
  24. matrix[a-1][i] = true;
  25. matrix[b-1][i] = true;
  26. }
  27. for (auto x: matrix){
  28. for (auto v:x){
  29. // cout << v << " ";
  30. int a = 0;
  31. if (v){
  32. a = 1;
  33. }
  34. writeInt(a, ' ');
  35. }
  36. writeChar('\n');
  37. }
  38. }
  39.  
  40.  
  41.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement