RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
COCI00644

Vrsta

Unrated 레이팅 미적용
난이도
1s
시간 제한
512MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 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.

예제 1
입력
3
2 1
3 1
1 1
출력
2
2
2
예제 2
입력
4
17 2
23 5
11 4
9 5
출력
17
23
17
11
예제 3
입력
3
10 20
100 5
1000 5
출력
10
10
10
문제 정보

생성자가 기록되지 않았습니다.

출처 COCI 2022/2023 Contest 4

평가 및 의견

Vrsta

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

Vrsta

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8