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.
intn,q;//number of arrays and queriescin>>n>>q;int*abuffer[n];// array bufferfor(inti=0;i<n;i++){ints,z;cin>>s;abuffer[i]=newint[s];for(intj=0;j<s;j++){scanf("%d",&z);abuffer[i][j]=z;}}inta,p;// array and positionfor(inti=0;i<q;i++){cin>>a>>p;cout<<abuffer[a][p]<<endl;}
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 →
A solution without int ** and cleaner for me