結果

問題 No.3112 Decrement or Mod Game
ユーザー issaimaru
提出日時 2025-04-20 17:22:16
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 441 bytes
コンパイル時間 294 ms
コンパイル使用メモリ 11,776 KB
実行使用メモリ 10,240 KB
最終ジャッジ日時 2025-04-20 17:22:20
合計ジャッジ時間 4,696 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 45 WA * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    a, b = map(int, input().split())
    turn = 0 
    while True:
        if a < b:
            a, b = b, a
            turn ^= 1

        if b == 0:
            print("Bob" if turn == 0 else "Alice")
            return

        q = a // b
        r = a % b

        if r == 0 or q > 1:
            print("Alice" if turn == 0 else "Bob")
            return

        a = r
        turn ^= 1

if __name__ == "__main__":
    main()
0