結果

問題 No.2278 Time Bomb Game 2
ユーザー square1001square1001
提出日時 2023-04-21 22:07:00
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 55 ms / 2,000 ms
コード長 640 bytes
コンパイル時間 99 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 11,392 KB
最終ジャッジ日時 2024-04-24 09:36:33
合計ジャッジ時間 4,559 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,752 KB
testcase_01 AC 32 ms
10,752 KB
testcase_02 AC 31 ms
10,880 KB
testcase_03 AC 31 ms
10,752 KB
testcase_04 AC 30 ms
10,752 KB
testcase_05 AC 30 ms
10,752 KB
testcase_06 AC 30 ms
11,008 KB
testcase_07 AC 31 ms
11,136 KB
testcase_08 AC 30 ms
11,008 KB
testcase_09 AC 32 ms
11,136 KB
testcase_10 AC 34 ms
11,264 KB
testcase_11 AC 33 ms
11,264 KB
testcase_12 AC 53 ms
11,136 KB
testcase_13 AC 33 ms
11,392 KB
testcase_14 AC 34 ms
11,264 KB
testcase_15 AC 37 ms
11,264 KB
testcase_16 AC 35 ms
11,264 KB
testcase_17 AC 33 ms
11,136 KB
testcase_18 AC 33 ms
11,264 KB
testcase_19 AC 39 ms
11,136 KB
testcase_20 AC 31 ms
11,264 KB
testcase_21 AC 31 ms
11,264 KB
testcase_22 AC 31 ms
11,264 KB
testcase_23 AC 31 ms
11,264 KB
testcase_24 AC 31 ms
11,264 KB
testcase_25 AC 31 ms
11,264 KB
testcase_26 AC 31 ms
11,136 KB
testcase_27 AC 31 ms
11,264 KB
testcase_28 AC 31 ms
11,264 KB
testcase_29 AC 31 ms
11,264 KB
testcase_30 AC 31 ms
11,264 KB
testcase_31 AC 31 ms
11,264 KB
testcase_32 AC 31 ms
11,264 KB
testcase_33 AC 31 ms
11,136 KB
testcase_34 AC 31 ms
11,136 KB
testcase_35 AC 30 ms
11,264 KB
testcase_36 AC 30 ms
11,264 KB
testcase_37 AC 34 ms
11,264 KB
testcase_38 AC 42 ms
11,392 KB
testcase_39 AC 33 ms
11,264 KB
testcase_40 AC 53 ms
11,136 KB
testcase_41 AC 37 ms
11,264 KB
testcase_42 AC 55 ms
11,264 KB
testcase_43 AC 40 ms
11,136 KB
testcase_44 AC 51 ms
11,264 KB
testcase_45 AC 50 ms
11,136 KB
testcase_46 AC 51 ms
11,264 KB
testcase_47 AC 38 ms
11,264 KB
testcase_48 AC 33 ms
11,264 KB
testcase_49 AC 40 ms
11,264 KB
testcase_50 AC 31 ms
11,136 KB
testcase_51 AC 31 ms
11,136 KB
testcase_52 AC 31 ms
11,264 KB
testcase_53 AC 31 ms
11,392 KB
testcase_54 AC 32 ms
11,264 KB
testcase_55 AC 31 ms
11,264 KB
testcase_56 AC 31 ms
11,136 KB
testcase_57 AC 31 ms
11,264 KB
testcase_58 AC 33 ms
11,136 KB
testcase_59 AC 30 ms
11,264 KB
testcase_60 AC 31 ms
11,264 KB
testcase_61 AC 30 ms
11,136 KB
testcase_62 AC 32 ms
11,264 KB
testcase_63 AC 31 ms
11,264 KB
testcase_64 AC 45 ms
11,264 KB
testcase_65 AC 54 ms
11,136 KB
testcase_66 AC 53 ms
11,392 KB
testcase_67 AC 54 ms
11,264 KB
testcase_68 AC 55 ms
11,264 KB
testcase_69 AC 55 ms
11,264 KB
testcase_70 AC 55 ms
11,264 KB
testcase_71 AC 30 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve(n, k, t, s):
	p1, p2 = k, k
	while p1 != -1 and s[p1] == s[k]:
		p1 -= 1
	while p2 != n and s[p2] == s[k]:
		p2 += 1
	q1, q2 = p1, p2
	while q1 != -1 and s[q1] != s[k]:
		q1 -= 1
	while q2 != n and s[q2] != s[k]:
		q2 += 1
	flag = False
	if p1 != -1 and (k - p1) % 2 == t % 2 and k - p1 <= t and (q1 == -1 or (p1 - q1) % 2 == 1 or k - q1 > t):
		flag = True
	if p2 != n and (p2 - k) % 2 == t % 2 and p2 - k <= t and (q2 == n or (q2 - p2) % 2 == 1 or q2 - k > t):
		flag = True
	return int(flag) ^ (1 if s[k] == 'A' else 0)

n, k, t = map(int, input().split())
s = input()
k -= 1
print('Alice' if solve(n, k, t, s) == 0 else 'Bob')
0