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

21906번 - Reverse Game 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 256 MB31917215156.343%

문제

Alice and Bob are playing a turn-based game. The rules of the game are as follows:

  1. At the beginning of the game some binary string $s$ is chosen.
  2. On his turn player has to choose some substring $t$ of $s,ドル equal to one of 10, 110, 100, 1010. Then the player has to reverse $t$. For example, if $s = $010101, the player can select substring $t = $1010 and reverse it, obtaining $s = $001011
  3. he player who can’t make a move (who can’t choose an appropriate substring $t$) loses.
  4. The players cannot skip a turn.

Which player has the winning strategy, if Alice moves first?

A string $a$ is a substring of a string $b$ if $a$ can be obtained from $b$ by deletion of several (possibly, zero or all) characters from the beginning and several (possibly, zero or all) characters from the end.

입력

The only line of the input contains a binary string $s$ (1ドル \le |s| \le 10^6$) — the string with which Alice and Bob play.

출력

If Alice wins, output Alice. Otherwise, output Bob.

제한

예제 입력 1

010

예제 출력 1

Alice

예제 입력 2

1111

예제 출력 2

Bob

예제 입력 3

1010

예제 출력 3

Bob

예제 입력 4

1010001011001

예제 출력 4

Alice

힌트

In the first sample, Alice can choose substring 10 of 010 and reverse it, obtaining string 001. Bob can’t make any move with this string, and loses.

In the second sample, Alice can’t make a single move and loses.

출처

ICPC > Regionals > Europe > Southeastern European Regional Contest > SEERC 2020 B번

Contest > Open Cup > 2020/2021 Season > Stage 17: Grand Prix of Southern Europe B번

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

출처

대학교 대회

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

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