Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- using namespace std;
- int main() {
- int n, m;
- cin >> n >> m;
- vector <vector<int>> mass(n, vector <int>());
- for (int i = 0; i < m; i++) {
- int a, b;
- cin >> a >> b;
- a--; b--;
- mass[a].push_back(b);
- }
- cout << n << endl;
- for (int i = 0; i < n; i++) {
- for (int j = 0; j < n; j++) {
- cout << mass[i][j] << " ";
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement