Logo
(追記) (追記ここまで)

24656번 - Destructive Game 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 1024 MB155827556.391%

문제

There are $N$ stone piles, numbered by sequential integers from 1ドル$ to $N$. The $i$-th pile contains $a_i$ stones. Additionally, each pile $i$ has an integer $b_i$ associated with it.

Alice and Bob play the following game using those stone piles.

They are alternately performing the following operation: choose pile $i$ and a nonnegative integer $k$ such that $b_i^k$ is not greater than the current number of stones in pile $i,ドル and remove $b_i^k$ stones from pile $i$. If a player cannot do that on their turn, the opposite player wins.

Alice moves first. Determine who will win if both players are playing optimally.

입력

The first line of input contains one integer $N$ (1ドル \le N \le 10^5$), the number of piles. The $i$-th of the following $N$ lines contains two integers $a_i$ and $b_i$ (1ドル \le a_i, b_i \le 10^9$): the initial number of stones in the $i$-th pile and the integer associated with it, respectively.

출력

If Alice wins the game when both sides are playing optimally, print "Alice". Otherwise, print "Bob".

제한

예제 입력 1

2
10 3
7 4

예제 출력 1

Bob

예제 입력 2

16
903 5
246 38
884 12
752 10
200 17
483 6
828 27
473 21
983 35
953 36
363 35
101 3
34 23
199 8
134 2
932 28

예제 출력 2

Alice

예제 입력 3

16
35 37
852 17
789 37
848 40
351 27
59 32
271 11
395 20
610 3
631 33
543 14
256 28
48 8
277 24
748 38
109 40

예제 출력 3

Bob

힌트

출처

Camp > Petrozavodsk Programming Camp > Winter 2022 > Day 1: Kyoto U Contest 2 D번

Contest > Open Cup > 2021/2022 Season > Stage 10: Grand Prix of Kyoto D번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /