結果
| 問題 |
No.2278 Time Bomb Game 2
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-04-21 22:16:05 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 768 bytes |
| コンパイル時間 | 323 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 65,792 KB |
| 最終ジャッジ日時 | 2024-11-06 15:46:01 |
| 合計ジャッジ時間 | 5,410 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 65 WA * 5 |
ソースコード
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")