結果

問題 No.2278 Time Bomb Game 2
ユーザー minimumminimum
提出日時 2023-04-21 22:16:05
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 768 bytes
コンパイル時間 194 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 65,920 KB
最終ジャッジ日時 2024-04-24 08:22:25
合計ジャッジ時間 5,600 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
52,096 KB
testcase_01 AC 42 ms
51,712 KB
testcase_02 AC 43 ms
51,584 KB
testcase_03 AC 41 ms
51,968 KB
testcase_04 AC 41 ms
51,968 KB
testcase_05 AC 45 ms
51,712 KB
testcase_06 WA -
testcase_07 AC 44 ms
52,992 KB
testcase_08 AC 44 ms
52,992 KB
testcase_09 AC 45 ms
52,992 KB
testcase_10 AC 50 ms
59,776 KB
testcase_11 AC 51 ms
59,264 KB
testcase_12 WA -
testcase_13 AC 50 ms
59,392 KB
testcase_14 AC 49 ms
59,776 KB
testcase_15 AC 51 ms
60,672 KB
testcase_16 AC 50 ms
59,392 KB
testcase_17 AC 50 ms
59,520 KB
testcase_18 AC 49 ms
58,880 KB
testcase_19 AC 51 ms
61,184 KB
testcase_20 AC 45 ms
52,992 KB
testcase_21 AC 44 ms
53,120 KB
testcase_22 AC 45 ms
52,864 KB
testcase_23 AC 43 ms
52,992 KB
testcase_24 AC 45 ms
53,632 KB
testcase_25 AC 48 ms
53,248 KB
testcase_26 AC 43 ms
52,992 KB
testcase_27 AC 46 ms
53,376 KB
testcase_28 AC 45 ms
52,864 KB
testcase_29 AC 44 ms
53,376 KB
testcase_30 AC 44 ms
53,248 KB
testcase_31 AC 44 ms
52,992 KB
testcase_32 AC 43 ms
53,248 KB
testcase_33 AC 45 ms
53,504 KB
testcase_34 AC 44 ms
53,504 KB
testcase_35 AC 43 ms
53,248 KB
testcase_36 AC 45 ms
53,376 KB
testcase_37 AC 49 ms
59,392 KB
testcase_38 AC 52 ms
61,568 KB
testcase_39 AC 48 ms
59,136 KB
testcase_40 AC 53 ms
64,512 KB
testcase_41 AC 49 ms
60,544 KB
testcase_42 WA -
testcase_43 AC 50 ms
61,056 KB
testcase_44 AC 53 ms
63,872 KB
testcase_45 AC 54 ms
63,360 KB
testcase_46 AC 52 ms
64,000 KB
testcase_47 AC 49 ms
60,416 KB
testcase_48 AC 49 ms
58,624 KB
testcase_49 AC 50 ms
60,544 KB
testcase_50 AC 44 ms
53,504 KB
testcase_51 AC 45 ms
53,632 KB
testcase_52 AC 43 ms
52,992 KB
testcase_53 AC 46 ms
53,120 KB
testcase_54 AC 44 ms
52,864 KB
testcase_55 AC 45 ms
53,376 KB
testcase_56 AC 46 ms
53,376 KB
testcase_57 AC 44 ms
53,376 KB
testcase_58 AC 45 ms
53,376 KB
testcase_59 AC 44 ms
53,248 KB
testcase_60 AC 44 ms
52,992 KB
testcase_61 AC 45 ms
52,992 KB
testcase_62 AC 44 ms
53,632 KB
testcase_63 AC 45 ms
53,376 KB
testcase_64 WA -
testcase_65 AC 54 ms
65,152 KB
testcase_66 AC 55 ms
65,664 KB
testcase_67 AC 55 ms
65,408 KB
testcase_68 AC 43 ms
52,992 KB
testcase_69 AC 44 ms
52,992 KB
testcase_70 AC 43 ms
53,376 KB
testcase_71 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

INF = float('inf')
N, K, T = map(int, input().split())
S = input()
if 'A' not in S:
    print("Bob")
if 'B' not in S:
    print("Alice")


def f(S, i):
    res = []
    lres = INF
    for l in range(i - 1, -1, -1):
        if S[l] != S[i]:
            lres = abs(l - i)
            break
    rres = INF
    for r in range(i + 1, N):
        if S[r] != S[i]:
            rres = abs(r - i)
            break
    return min(lres, rres)


K -= 1

if S[K] == 'A':
    d = f(S, K)
    if T < d:
        print("Bob")
    else:
        if (T - d) % 2:
            print("Bob")
        else:
            print("Alice")
else:
    d = f(S, K)
    if T < d:
        print("Alice")
    else:
        if (T - d) % 2:
            print("Alice")
        else:
            print("Bob")
0