You are viewing a single comment's thread. Return to all comments →
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; int main(){ int a,b,x; cin>>a>>b; int* arr[a]; int c[b][2],d[a]; vector<int> v; for(int i=0;i<a;i++){ int k; cin>>k; for(int j=0;j<k;j++){ cin>>x; v.push_back(x); } d[i]=k; } for(int k=0;k<b;k++){ cin>>(c[k][0])>>(c[k][1]); } int* p = &v[0]; for(int i=0;i<a;i++){ arr[i]=p; p += d[i]; } for(int i=0;i<b;i++){ cout<<*(arr[c[i][0]] + c[i][1])<<endl; } }
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 →