結果

問題 No.3112 Decrement or Mod Game
ユーザー hato336
提出日時 2025-04-18 21:13:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 2,000 ms
コード長 545 bytes
コンパイル時間 317 ms
コンパイル使用メモリ 82,836 KB
実行使用メモリ 53,896 KB
最終ジャッジ日時 2025-04-18 21:13:10
合計ジャッジ時間 4,811 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 65
権限があれば一括ダウンロードができます

ソースコード

diff #

def calc(a,b,t):
    if a == 0:return 1
    if b == 0:return 0
    if t == 0:
        if calc(a-1,b,t^1) == 1:
            return 1
        if a >= b and calc(a % b,b,t^1) == 1:
            return 1
        return 0
    if t == 1:
        if calc(a,b-1,t^1) == 0:
            return 0
        if b >= a and calc(a,b % a,t^1) == 0:
            return 0
        return 1

a,b = map(int,input().split())
print('Bob' if a != 1 and (a-1==b or a < b) else 'Alice')
exit()

for i in range(1,20):
    for j in range(1,20):
        print(i,j,calc(i,j,0))
0