結果

問題 No.2278 Time Bomb Game 2
ユーザー tamatotamato
提出日時 2023-04-21 22:31:04
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 1,676 bytes
コンパイル時間 189 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 91,136 KB
最終ジャッジ日時 2024-04-24 08:38:28
合計ジャッジ時間 6,555 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 AC 37 ms
52,352 KB
testcase_03 AC 36 ms
52,096 KB
testcase_04 AC 37 ms
51,840 KB
testcase_05 RE -
testcase_06 RE -
testcase_07 AC 62 ms
78,976 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 AC 43 ms
53,248 KB
testcase_22 AC 67 ms
77,824 KB
testcase_23 AC 43 ms
53,504 KB
testcase_24 AC 44 ms
53,632 KB
testcase_25 AC 75 ms
87,680 KB
testcase_26 AC 67 ms
87,296 KB
testcase_27 AC 70 ms
87,168 KB
testcase_28 AC 67 ms
86,912 KB
testcase_29 AC 69 ms
87,040 KB
testcase_30 AC 65 ms
82,816 KB
testcase_31 AC 39 ms
53,632 KB
testcase_32 AC 37 ms
53,248 KB
testcase_33 AC 37 ms
53,504 KB
testcase_34 AC 66 ms
87,040 KB
testcase_35 AC 69 ms
87,168 KB
testcase_36 AC 39 ms
53,248 KB
testcase_37 RE -
testcase_38 RE -
testcase_39 RE -
testcase_40 RE -
testcase_41 RE -
testcase_42 RE -
testcase_43 RE -
testcase_44 RE -
testcase_45 RE -
testcase_46 RE -
testcase_47 RE -
testcase_48 RE -
testcase_49 RE -
testcase_50 AC 67 ms
87,040 KB
testcase_51 AC 71 ms
87,296 KB
testcase_52 AC 39 ms
53,888 KB
testcase_53 AC 38 ms
53,632 KB
testcase_54 AC 38 ms
53,504 KB
testcase_55 AC 37 ms
53,760 KB
testcase_56 AC 68 ms
86,656 KB
testcase_57 AC 40 ms
53,632 KB
testcase_58 AC 72 ms
87,040 KB
testcase_59 AC 39 ms
53,120 KB
testcase_60 AC 69 ms
87,552 KB
testcase_61 AC 69 ms
87,424 KB
testcase_62 AC 41 ms
53,376 KB
testcase_63 AC 59 ms
74,368 KB
testcase_64 RE -
testcase_65 RE -
testcase_66 RE -
testcase_67 RE -
testcase_68 AC 77 ms
87,552 KB
testcase_69 AC 43 ms
59,520 KB
testcase_70 AC 43 ms
59,136 KB
testcase_71 AC 37 ms
52,096 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
mod = 998244353

N, K, T = map(int, input().split())
C = input().rstrip('\n')

K -= 1
flg = 0
if C[K] == "B":
    C_new = []
    for c in C:
        if c == "A":
            C_new.append("B")
        else:
            C_new.append("A")
    C = "".join(C_new)
    flg = 1
C = C[max(0, K - T): min(N, K + T + 1)]
K = min(K, T)

exist_adj = 0
if K:
    if C[K - 1] == "A":
        exist_adj = 1
if K + 1 < len(C):
    if C[K + 1] == "A":
        exist_adj = 1

if not exist_adj:
    if K & 1 == (K - T) & 1:
        ans = 0
    else:
        if T == 1:
            ans = 1
        else:
            ans = 1
            # left
            if K - 2 >= 0:
                if C[K - 2] == "B":
                    for i in range(K - 3, -1, -1):
                        if C[i] == "A":
                            if i & 1 == (K - T) & 1:
                                ans = 0
                            break
            # right
            if K + 2 < len(C):
                if C[K + 2] == "B":
                    for i in range(K + 3, len(C)):
                        if C[i] == "A":
                            if i & 1 == (K - T) & 1:
                                ans = 0
                            break
else:
    assert 0
    ok = 0
    for i in range(K - 1, -1, -1):
        if C[i] == "B":
            if i & 1 == (K - T) & 1:
                ok = 1
            break
    for i in range(K + 1, len(C)):
        if C[i] == "B":
            if i & 1 == (K - T) & 1:
                ok = 1
            break
    if ok:
        ans = 1
    else:
        ans = 0

if flg:
    ans ^= 1
if ans:
    print("Alice")
else:
    print("Bob")
0