You are viewing a single comment's thread. Return to all comments →
int main() { int array_size, number_of_queries; cin >> array_size >> number_of_queries; vector<int> array_of_vectors[array_size]; for (int i = 0; i < array_size; i++) { int vector_size; cin >> vector_size; array_of_vectors[i] = vector<int>(vector_size); for (int j = 0; j < vector_size; j++) { cin >> array_of_vectors[i][j]; } } for (int i = 0; i < number_of_queries; i++) { int n_vector, n_element; cin >> n_vector >> n_element; cout << array_of_vectors[n_vector][n_element] << 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 →