結果

問題 No.2103 ±1s Game
ユーザー aaaaaaaaaa2230
提出日時 2022-10-22 08:45:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 41 ms / 1,000 ms
コード長 445 bytes
コンパイル時間 150 ms
コンパイル使用メモリ 81,752 KB
実行使用メモリ 52,480 KB
最終ジャッジ日時 2024-07-01 12:56:35
合計ジャッジ時間 2,678 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

x,y,k,p = map(int,input().split())

turn = x+y-k

first = (turn+1)//2
second = turn//2

if turn%2:
    first,second = second,first


def ans(x,turn):
    turn %= 2
    if x == 0:
        print("Bob" if turn else "Alice")
    else:
        print("Bob" if turn == 0 else "Alice")
    exit()

if first >= y and int(p == 1)^(turn%2):
    ans(0,turn)
    
if first >= x and int(pow(-1,(y-(turn-x))%2) == p)^(turn%2):
    ans(0,turn)

ans(1,turn)
    
0