-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathhr2.cpp
35 lines (30 loc) · 797 Bytes
/
hr2.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
int number_arrays, number_queries;
cin >> number_arrays;
cin >> number_queries;
vector<int> arrays[number_arrays];
for (int i = 0; i < number_arrays; i++) {
int arraySize;
cin >> arraySize;
int val;
for (int vector_index = 0; vector_index < arraySize; vector_index++) {
cin >> val;
arrays[i].push_back(val);
}
}
for (int i = 0; i < number_queries; i++) {
int array, position;
cin >> array;
cin >> position;
cout << arrays[array][position] << endl;
}
return 0;
}