| 10 | |
| 11 | |
| 12 | int main() { |
| 13 | |
| 14 | int n, q ,k; |
| 15 | cin >> n >> q; |
| 16 | int a[n]; |
| 17 | int **arr = new int*[n]; |
| 18 | for(int i = 0; i < n; i++) { |
| 19 | cin >> k; |
| 20 | a[i] = k; |
| 21 | arr[i] = new int[k]; |
| 22 | for(int j = 0; j < k; j++) { |
| 23 | cin >> arr[i][j]; |
| 24 | } |
| 25 | } |
| 26 | for(int i = 0; i < q; i++) { |
| 27 | int p, q; |
| 28 | cin >> p >> q; |
| 29 | cout << arr[p][q] << endl; |
| 30 | } |
| 31 | return 0; |
| 32 | } |
| 33 | // used 'new' opeator for dynamic memory allocation ,if you check out the problem statement |
| 34 | // you will encounter that the array elements are not taken in a continuous manner form the input |
| 35 | // first the size of the 1D array is given and then the array elemnts |
nothing calls this directly
no outgoing calls
no test coverage detected