45 人解决,48 人已尝试。
51 份提交通过,共有 98 份提交。
3.1 EMB 奖励。
单点时限: 1.0 sec
内存限制: 256 MB
Mirko got a summer internship in a big IT company. This company builds a large database consisting of
On his first day, Mirko received a total of
For example, if the query is in the form of
Since he just started with his internship, Mirko needs your help. Help him and answer the queries!
The first line of input contains
Each of the following
The following line contains
Each of the following
The output must contain
4 3 1 5 2 2 3 4 4 3 2 5 4 6 3 -1 -1 2 -1 3 2 -1 -1 -1
2 1 4
3 8 6 5 97 99 82 50 95 1 85 62 11 64 94 84 88 19 43 99 11 64 94 84 31 19 3 -1 -1 11 64 94 84 -1 19 -1 -1 -1 99 -1 -1 -1 1 95 -1 -1 -1 -1 80 -1 -1
2 1 0
First Example:
The first query asks how many rows have the number 2 in the third column. These are rows number 1 (1 5 2) and number 3 (4 3 2).
The second query asks how many rows have the numbers 3 and 2 in the second and third column. This is only row number 3 (4 3 2).
The third query asks how many rows are there in total, and the answer is obviously 4.
45 人解决,48 人已尝试。
51 份提交通过,共有 98 份提交。
3.1 EMB 奖励。