結果

問題 No.415 ぴょん
ユーザー lllllll88938494
提出日時 2023-05-26 03:16:07
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 185 bytes
コンパイル時間 262 ms
コンパイル使用メモリ 82,528 KB
実行使用メモリ 53,788 KB
最終ジャッジ日時 2024-12-24 15:20:08
合計ジャッジ時間 2,350 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

n,d = map(int,input().split())
def cal(x,y):
    if y == 0:
        return x
    return cal(y,x%y)


t=cal(n,d)

if n == d:
    print(0)
elif t == 1:
    print(n-1)
else:
    print(t-1)
0