You are viewing a single comment's thread. Return to all comments →
int main() {
int n, q, size, value, which, index; cin >> n >> q; vector<vector<int>> vec1; //initializing a 2d vector for (int i = 0; i < n; ++i) { cin >> size; vector<int> vec2; for (int j = 0; j < size; ++j) { cin >> value; vec2.push_back(value); } vec1.push_back(vec2); } for (int k = 0; k < q; ++k) { cin >> which >> index; cout << vec1[which][index] << endl; } return 0;
}
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 →
int main() {
}