結果

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

ソースコード

diff #

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

E = X + Y - K

desired_parity = 0 if P == 1 else 1
target_b_parity = (Y - desired_parity) % 2

b_min = max(0, E - X)
b_max = min(Y, E)

possible_parity = False

if b_min <= b_max:
    if (b_min % 2 == target_b_parity) or (b_max % 2 == target_b_parity):
        possible_parity = True
    else:
        if (b_max - b_min) >= 1:
            possible_parity = True

if not possible_parity:
    print("Bob")
else:
    if E % 2 == 1:
        print("Alice")
    else:
        if (b_min % 2 == b_max % 2):
            if (b_min % 2 == target_b_parity):
                print("Alice")
            else:
                print("Bob")
        else:
            print("Bob")
0