問題一覧 > 通常問題

No.2278 Time Bomb Game 2

レベル : / AI推定難易度 : 1800 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 56
作問者 : miscalc / テスター : magsta
お気に入りにしたユーザー ProblemId : 8294 / 自分の提出
問題文最終更新日: 2023-04-22 00:13:32
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 385 (順位表) の他の問題:

Problem Statement

There are $N$ cells arranged in a row from left to right. The $i$-th cell from the left is called cell $i$. Each cell has a character A or B written on it, and the character written on cell $i$ is $c_i$. There is also $1$ coin, placed on cell $K$.

Alice and Bob play a game using these cells and the coin. When the character written on the cell where the coin is placed is A, it is Alice's turn; when it is B, it is Bob's turn. The player whose turn it is takes one of the following actions.

  • Move the coin to the cell immediately to the left. This action can be taken only if a cell exists immediately to the left.
  • Move the coin to the cell immediately to the right. This action can be taken only if a cell exists immediately to the right.
At the moment when Alice and Bob have taken a total of $T$ actions, if the character written on the cell where the coin is placed is A, Alice loses, and if it is B, Bob loses. The player who did not lose wins. When the $2$ players act optimally, who wins?

Input

$N$ $K$ $T$
$c_1 c_2 \ldots c_N$

  • $N, K, T$ are integers.
  • $2 \leq N \leq 2 \times 10^5$
  • $1 \leq K \leq N$
  • $1 \leq T \leq 10^9$
  • $c_i$ is A or B.

Output

Print Alice if Alice wins, and Bob if Bob wins. Print a newline at the end.

Sample

Sample 1
Input
5 1 5
AAABA
Output
Alice

Initially, the coin is placed on cell $1$, and it is Alice's turn. The game may proceed, for example, as follows.

  • Alice moves the coin to cell $2$.
  • Alice moves the coin to cell $3$.
  • Alice moves the coin to cell $4$.
  • Bob moves the coin to cell $3$.
  • Alice moves the coin to cell $4$.

Sample 2
Input
6 4 1
BAAAAB
Output
Bob

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。