結果

問題 No.2278 Time Bomb Game 2
ユーザー rlangevinrlangevin
提出日時 2023-04-21 22:08:54
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 736 bytes
コンパイル時間 557 ms
コンパイル使用メモリ 81,928 KB
実行使用メモリ 101,504 KB
最終ジャッジ日時 2024-11-06 15:38:34
合計ジャッジ時間 7,325 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 62 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

def f(c):
    if c == "A":
        return 0
    elif c == "B":
        return 1
    else:
        return c

N, K, T = map(int, input().split())
C = [None] + list(input()) + [None]
C = list(map(f, C))
D = ["Alice", "Bob"]
left, right = 0, 0
for i in range(K - 1, -1, -1):
    if C[K] == C[i]:
        left += 1
    else:
        break
for i in range(K + 1, N + 1):
    if C[K] == C[i]:
        right += 1
    else:
        break
if left % 2 and T > left:
    print(D[C[K]])
elif right % 2 and T > right:
    print(D[C[K]])
elif T <= left and T <= right:
    print(D[1 - C[K]])
else:
    print(D[C[K]]) if T % 2 else print(D[1 - C[K]])
    
# if C[K - 1] != C[K] and C[K + 1] != C[K]:
#     print(D[C[K]]) if T % 2 else print(D[1 - C[K]])
0