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

Iksevi

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

의견: 0

설명

After ten years of programming, Vinko has decided to change his profession and
become a ceramist. Already on the first day of his new job he got an extremely
difficult task.
He has to pave the concert hall’s floor with square ceramic tiles. However, he
won’t pave the floor so that the tiles are parallel with the hall’s walls. Instead, he
will rotate them so that the diagonals of the tiles are parallel to the walls.
Vinko has not decided which size of tiles he will use, but he knows they all have to
be the same size, and that the length of their diagonals in millimeters has to be a positive even integer.
He will put the first tile so that it touches the bottom and left walls, and then he will pave the others so
that they share a side with some of the previously set tiles. He will repeat the procedure until he paves
the whole floor, whose dimensions are \(10^{7} \times 10^{7}\) square millimeters.
Besides being a good programmer and ceramist, Vinko is also an excellent musician. Because of that,
he knows that there are \(n\) points on the floor that are crucial for good acoustics in the hall. The hall’s
acoustics would improve significantly if a tile’s corner is at one of the \(n\) points.
The left image shows the paving whose tiles have \(a\) diagonal \(of\) length 4. The point (2, 4) \(at\) \(on\) the corner
\(of\) \(a\) tile, and for \(it\) the acoustics are good, but for the points (4, 3) and (5, 1) are not.
The right image shows the paving whose tiles have \(a\) diagonal \(of\) length 2. The point (4, 3) \(is\) \(at\) the corner
\(of\) \(a\) tile, while points (2, 4) and (5, 1) are not.
Help Vinko determine for each of the \(n\) points in how many ways can he pave the floor (that is, how many
different dimensions of the tiles can he choose) so that the \(i-th\) point is at a tile corner.

제약

Subtask 1 (15 points): \(1 \le n \le 10\,000\), \(0 \le x\)\(i\), y\(i \le 100\)

Subtask 2 (55 points): \(1 \le n \le 10\,000\)

Subtask 3 (40 points): No additional constraints.

입력 형식

The first line contains the integer \(n\) (\(1 \le n \le 10^{6}\)), the number of acoustic points.
The following \(n\) lines contain two integers \(x@@RISE_MATH_BLOCK_0@@i\), y\(i \le 10^{7}\)), which indicates that the \(i-th\) point is
\(x_{i}\) millimeters away from the left wall, and \(y_{i}\) millimeters away from the lower wall of the hall.

출력 형식

In the \(i-th\) of \(n\) lines print the number from the task statement for the \(i-th\) point.

서브태스크
서브태스크점수설명

1

15점

\(1 \le n \le 10\,000\), \(0 \le x\)\(i\), y\(i \le 100\)

2

55점

\(1 \le n \le 10\,000\)

3

40점

No additional constraints.

예제 1
입력
3
1 4
0 0
0 9
출력
1
0
3
예제 2
입력
3
5 1
4 3
2 4
출력
0
1
1
설명

Clarification of the second example:
Images from the task statement correspond to the second example.

문제 정보

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

출처 COCI 2022/2023 Contest 1

평가 및 의견

Iksevi

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

Log in to rate problems.

개별 의견

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

풀이 제출

Iksevi

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