結果

問題 No.2278 Time Bomb Game 2
コンテスト
ユーザー detteiuu
提出日時 2026-08-05 21:17:14
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
RE  
実行時間 -
コード長 553 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 495 ms
コンパイル使用メモリ 96,108 KB
実行使用メモリ 93,824 KB
最終ジャッジ日時 2026-08-05 21:17:27
合計ジャッジ時間 12,758 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 31 WA * 1 RE * 38
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

N, K, T = map(int, input().split())
C = input()

K -= 1
S = C[K]

n = 0 if S == "A" else "B"

l, r = 0, 0
fl, fr = False, False
idx = K-1
while 0 <= idx and C[idx] == S:
    l += 1
    idx -= 1
if idx == -1: fl = True
idx = K+1
while idx < N and C[idx] == S:
    r += 1
    idx += 1
if idx == N: fr = True

ans = ["Alice", "Bob"]

if 1 <= l+r:
    if l%2 != T%2 and l < T and not fl or r%2 != T%2 and r < T and not fr:
        print(ans[n])
    else:
        print(ans[n^1])
else:
    if T%2 == 1:
        print(ans[n])
    else:
        print(ans[n^1])
0