We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
#include<bits/stdc++.h>usingnamespacestd;intmain(){ios_base::sync_with_stdio(0),cin.tie(0);//optimization linesintn,q;cin>>n>>q;vector<vector<int>>arr(n);//create an array of arraysfor(inti=0;i<n;i++){//fill the array of arraysintk;cin>>k;arr[i].resize(k);// we give the array in position i the size of k for(intj=0;j<k;j++){cin>>arr[i][j];}}for(inti=0;i<q;i++){intx,y;cin>>x>>y;cout<<arr[x][y]<<endl;}return0;}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Variable Sized Arrays
You are viewing a single comment's thread. Return to all comments →