結果
| 問題 |
No.2103 ±1s Game
|
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-04-15 22:14:42 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 895 bytes |
| コンパイル時間 | 296 ms |
| コンパイル使用メモリ | 81,892 KB |
| 実行使用メモリ | 53,756 KB |
| 最終ジャッジ日時 | 2025-04-15 22:16:26 |
| 合計ジャッジ時間 | 2,945 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 WA * 13 |
ソースコード
X, Y, K, P = map(int, input().split())
R = 0 if P == 1 else 1
target_parity = (Y - R) % 2
T = X + Y - K
b_min = max(0, T - X)
b_max = min(Y, T)
# Check if there exists a b in [b_min, b_max] with parity target_parity
possible = False
if b_min <= b_max:
# Find the first candidate >= b_min with target_parity
if (b_min % 2) == target_parity:
possible = True
else:
candidate = b_min + 1
if candidate <= b_max:
possible = True
if not possible:
print("Bob")
else:
s = min(X, Y)
if T <= s:
if T % 2 == 1:
print("Alice")
else:
print("Bob")
else:
if Y >= X:
total_parity = (s % 2) + (T - s) % 2
else:
total_parity = s % 2
total_parity %= 2
if total_parity == target_parity:
print("Alice")
else:
print("Bob")
lam6er