結果

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

ソースコード

diff #

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

target_p = 0 if P == 1 else 1
Y_mod = Y % 2
T = (Y_mod - target_p) % 2

M = X + Y - K
B_min = max(0, M - X)
B_max = min(Y, M)

if B_min == B_max:
    if (B_min % 2) == T:
        print("Alice")
    else:
        print("Bob")
else:
    if (B_min % 2) == (B_max % 2):
        possible = {B_min % 2}
    else:
        possible = {0, 1}
    
    if T not in possible:
        print("Bob")
    else:
        if M % 2 == 1:
            print("Alice")
        else:
            if T == 0:
                print("Alice")
            else:
                print("Bob")
0