結果

問題 No.2103 ±1s Game
ユーザー gew1fw
提出日時 2025-06-12 12:51:57
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 642 bytes
コンパイル時間 384 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 52,352 KB
最終ジャッジ日時 2025-06-12 12:52:27
合計ジャッジ時間 3,023 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

X, Y, K, P = map(int, input().split())

min_neg = max(0, K - X)
max_neg = min(Y, K)
desired_parity = 0 if P == 1 else 1

# Check if there exists a number with desired parity in [min_neg, max_neg]
exists = False
if min_neg <= max_neg:
    first_candidate = min_neg if (min_neg % 2 == desired_parity) else (min_neg + 1)
    if first_candidate <= max_neg:
        exists = True

if not exists:
    print("Bob")
else:
    # Check the condition for Alice's win
    condition = (min_neg % 2 == desired_parity) or (max_neg % 2 == desired_parity) or (min_neg % 2 != max_neg % 2)
    if condition:
        print("Alice")
    else:
        print("Bob")
0