結果

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

ソースコード

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 != T % 2) or (right % 2 != T % 2)) and T > left:
    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