結果

問題 No.415 ぴょん
ユーザー 👑 yumechiyumechi
提出日時 2016-08-26 23:07:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 72 ms / 1,000 ms
コード長 205 bytes
コンパイル時間 444 ms
コンパイル使用メモリ 87,396 KB
実行使用メモリ 71,540 KB
最終ジャッジ日時 2023-08-11 20:20:57
合計ジャッジ時間 3,594 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,040 KB
testcase_01 AC 69 ms
71,420 KB
testcase_02 AC 68 ms
71,524 KB
testcase_03 AC 69 ms
71,400 KB
testcase_04 AC 68 ms
71,308 KB
testcase_05 AC 71 ms
71,396 KB
testcase_06 AC 66 ms
71,040 KB
testcase_07 AC 67 ms
71,340 KB
testcase_08 AC 67 ms
71,344 KB
testcase_09 AC 69 ms
71,336 KB
testcase_10 AC 69 ms
71,464 KB
testcase_11 AC 72 ms
71,264 KB
testcase_12 AC 67 ms
71,436 KB
testcase_13 AC 67 ms
71,320 KB
testcase_14 AC 67 ms
71,340 KB
testcase_15 AC 68 ms
71,344 KB
testcase_16 AC 69 ms
71,440 KB
testcase_17 AC 68 ms
71,040 KB
testcase_18 AC 66 ms
71,380 KB
testcase_19 AC 67 ms
71,264 KB
testcase_20 AC 67 ms
71,172 KB
testcase_21 AC 67 ms
71,396 KB
testcase_22 AC 68 ms
71,460 KB
testcase_23 AC 67 ms
71,440 KB
testcase_24 AC 72 ms
71,400 KB
testcase_25 AC 69 ms
71,472 KB
testcase_26 AC 67 ms
71,540 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def gcd(a, b):
    if a < b:
        a,b = b,a
    while b > 0:
        r = a % b
        a,b = b,r
    return a

if __name__=="__main__":
    n, d = map(int, input().split())
    print(n // gcd(n, d) - 1)
0