Vrsta
의견: 0
Domagoj’s favorite school subject is P.E. Every P.E. class starts with wa\(rm-up\)
exercises. The teacher has an interesting way of choosing the student who will lead
the wa\(rm-up\). The students stand in a line sorted by their height. The teacher will
choose the student that is standing in the middle of the line. If two students are
in the middle, he will choose the shorter one. For example: if the students have
heights 1 3 5 7 11, the student with height 5 will lead the wa\(rm-up\) exercises.
Domagoj does not remember how tall his classmates are. Luckily, next to him
stands Lovro who is very good at estimating people’s heights. He gives Domagoj \(n\) statements: “There are
\(a@@RISE_MATH_BLOCK_0@@i\)”. After every statement said by Lovro, Domagoj is interested
in the height of the student who will lead the wa\(rm-up\), if only the students who entered the gym come to
P.E. class. Help him answer his questions!
Subtask 1 (19 points): n, \(v_{i} \le 1\,000\)
Subtask 2 (26 points): \(a@@RISE_MATH_BLOCK_0@@n = 1\)
Subtask 3 (29 points): \(v\)\(1 < v\)2 < . . . < v\(n\)
Subtask 4 (36 points): No additional constraints.
The first line contains the integer \(n\) (\(1 \le n \le 200\), 000), the number of Lovro’s statements.
The following \(n\) lines contain two integers \(v@@RISE_MATH_BLOCK_0@@i\) (\(1 \le v\)\(i\), a\(i \le 10^{9}\)), the height and the number of students
in Lovro’s statement.
In the \(i-th\) of \(n\) lines output the answer to Domagoj’s question after \(i\) of Lovro’s statements.
| 서브태스크 | 점수 | 설명 |
|---|---|---|
1 | 19점 | n, \(v_{i} \le 1\,000\) |
2 | 26점 | \(a@@RISE_MATH_BLOCK_0@@n = 1\) |
3 | 29점 | \(v\)\(1 < v\)2 < . . . < v\(n\) |
4 | 36점 | No additional constraints. |
3
2 1
3 1
1 12
2
24
17 2
23 5
11 4
9 517
23
17
113
10 20
100 5
1000 510
10
10평가 및 의견
Vrsta
Log in to rate problems.
아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.
풀이 제출
Vrsta