SHARE
TWEET

Untitled

a guest Nov 11th, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. int main() {
  6.     int n, m;
  7.     cin >> n >> m;
  8.     vector <vector<int>> mass(n, vector <int>());
  9.     for (int i = 0; i < m; i++) {
  10.         int a, b;
  11.         cin >> a >> b;
  12.         a--; b--;
  13.         mass[a].push_back(b);
  14.     }
  15.     cout << n << endl;
  16.     for (int i = 0; i < n; i++) {
  17.         for (int j = 0; j < n; j++) {
  18.             cout << mass[i][j] << " ";
  19.         }
  20.     }
  21.     return 0;
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top