結果

問題 No.3112 Decrement or Mod Game
ユーザー Lim Hansen
提出日時 2025-04-20 01:26:43
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 383 bytes
コンパイル時間 484 ms
コンパイル使用メモリ 12,288 KB
実行使用メモリ 10,496 KB
最終ジャッジ日時 2025-04-20 01:26:47
合計ジャッジ時間 3,531 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 43 WA * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

def winner(a, b):
    # Ensure a >= b
    if a < b:
        a, b = b, a
    turn = 0  # 0 = Alice, 1 = Bob

    while True:
        if a // b >= 2:
            return "Alice" if turn == 0 else "Bob"
        a, b = b, a % b
        if b == 0:
            return "Bob" if turn == 0 else "Alice"
        turn ^= 1

# Input
A, B = map(int, input().split())

# Output
print(winner(A, B))
0