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.
//check my code#include<cmath>#include<cstdio>#include<vector>#include<iostream>#include<algorithm>#include<utility>intmain(){intn,q,t;std::cin>>n>>q;std::vector<std::vector<int>>v;for(inti=0;i<n;i++){std::cin>>t;std::vector<int>vt;vt.assign(t,0);for(intj=0;j<t;j++){std::cin>>vt[j];}v.push_back(vt);}std::vector<std::pair<int,int>>k;intfirst,second;for(inti=0;i<q;i++){std::cin>>first>>second;k.push_back({first,second});}for(inti=0;i<q;i++){std::cout<<v[k[i].first][k[i].second]<<std::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 →