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<cmath>#include<cstdio>#include<vector>#include<iostream>#include<algorithm>usingnamespacestd;intmain(){/* Enter your code here. Read input from STDIN. Print output to STDOUT */introws(0),q(0);cin>>rows>>q;int**array=newint*[rows];for(inti=0;i<rows;i++){intk(0);cin>>k;array[i]=newint[k];for(intj=0;j<k;j++){cin>>array[i][j];}}introwA=0,colA=0;for(inti=0;i<q;i++){cin>>rowA>>colA;cout<<array[rowA][colA]<<endl;}delete[]array;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 →
My C++ code without vector