結果

問題 No.2103 ±1s Game
ユーザー maspy
提出日時 2022-10-21 23:04:55
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 964 bytes
コンパイル時間 78 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-07-01 07:25:02
合計ジャッジ時間 2,263 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

def F(P, X, Y, K):
    if P == 1 and X % 2 == 0 and X < Y:
        if K <= Y - X:
            return (Y + K + 1) % 2
        return (Y + K) % 2
    if P == 1 and X % 2 == 0 and X >= Y:
        if K <= X - Y:
            return (Y + 1) % 2
        return (Y + K) % 2
    if P == 1 and X % 2 == 1 and X <= Y:
        return (K + Y + 1) % 2
    if P == 1 and X % 2 == 1 and X > Y:
        if K <= X - Y:
            return (Y + 1) % 2
        return (K + Y + 1) % 2
    assert P == -1
    if X % 2 == 0 and X <= Y:
        return (Y + K) % 2
    if X % 2 == 0 and X > Y:
        if K <= X - Y:
            return Y % 2
        return (Y + K) % 2
    if X % 2 == 1 and X < Y:
        if K <= Y - X:
            return (Y + K) % 2
        return (Y + K + 1) % 2
    if X % 2 == 1 and X >= Y:
        if K <= X - Y:
            return Y % 2
        return (Y + K + 1) % 2
    return -1


X, Y, K, P = map(int, input().split())
print("Alice" if F(P, X, Y, K) else "Bob")
0