Advertisement
_fur

_fur | C++ Koko Sip

Dec 18th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. #include <cmath>
  2. #include <cstdio>
  3. #include <vector>
  4. #include <iostream>
  5. #include <algorithm>
  6. using namespace std;
  7.  
  8.  
  9. int main() {
  10.     int n, t;
  11.     int temp, temp2;
  12.     cin >> n >> t;
  13.     vector<vector<int> > mat(n);
  14.    
  15.     for (int i = 0; i < n; i++) {
  16.         cin >> temp;
  17.         mat.push_back(vector<int>(temp));
  18.         for (int j = 0; j < temp; j++) {
  19.             cin >> temp2;
  20.             mat[i].push_back(temp2);
  21.         }
  22.     }
  23.    
  24.     for (int i = 0; i < t; i++) {
  25.         cin >> temp >> temp2;
  26.         cout << mat[temp][temp2] << endl;
  27.     }
  28.    
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement