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

Trokut

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

의견: 0

설명

Ivan and Lucija are on a journey to a place far... far away. They know that the
journey will last a long time and that they will be bored at some point. While
they were thinking about what to do, Lucija came up with a game.
She drew \(N\) points on paper so that they form the vertices of a regular \(N-go\)n and
labeled them sequentially from 1 to \(N\). The player whose turn it is selects two of
the drawn \(N\) points such that the line segment connecting those two points does
not intersect any of the previously drawn line segments and connects those two
points. Line segments are allowed to touch at vertices. A player wins if after their move there exist three
connected line segments forming a triangle, i.e., if there exist three points such that they are all connected
by the drawn line segments. Of course, players are allowed to connect adjacent vertices, and those line
segments are considered for triangle formation. Players take turns, and Lucija is the first to play.
Both are extremely skilled players, and we know they will play optimally. Your task is to determine, for a
given \(N\), who will be the winner of the game. It can be shown that the game will always end after a finite
number of moves and that there will always be a winner.

제약

Subtask 1 (13 points): \(T \le 18\), \(N \le 20\)

Subtask 2 (36 points): \(T \le 998\), \(N \le 1\,000\)

Subtask 3 (15 points): \(N \le 10^{5}\)

Subtask 4 (46 points): No additional constraints.

입력 형식

In the first row there is an integer \(T\) (\(1 \le T \le 10\,000\)), number of scenarios. In the next \(T\) rows there is
an integer \(N\) (\(3 \le N \le 10^{9}\)), number of points Lucija drew on a piece of paper.

출력 형식

In \(T\) rows, for every scenario in given order, output "Ivan" or "Lucija" (without quotes), winner in a
given scenario.

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

1

13점

\(T \le 18\), \(N \le 20\)

2

36점

\(T \le 998\), \(N \le 1\,000\)

3

15점

\(N \le 10^{5}\)

4

46점

No additional constraints.

예제 1
입력
3
3
4
5
출력
Lucija
Lucija
Ivan
예제 2
입력
3
7
8
9
출력
Lucija
Lucija
Ivan
설명

Clarification of the first example:

When N = 3, then all three possible line segments must be connected, and Lucija wins. When N = 4,
then Lucija can connect the line segment between points 1 and 3. We see that after any move by Ivan,
Lucija can connect a triangle and win.

문제 정보

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

출처 COCI 2023/2024 Contest 5

평가 및 의견

Trokut

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

Log in to rate problems.

개별 의견

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

풀이 제출

Trokut

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