結果

問題 No.982 Add
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2022-06-18 10:25:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 47 ms / 2,000 ms
コード長 248 bytes
コンパイル時間 358 ms
コンパイル使用メモリ 82,428 KB
実行使用メモリ 68,712 KB
最終ジャッジ日時 2024-04-18 04:12:59
合計ジャッジ時間 2,963 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
68,712 KB
testcase_01 AC 36 ms
52,792 KB
testcase_02 AC 46 ms
67,832 KB
testcase_03 AC 45 ms
68,468 KB
testcase_04 AC 36 ms
53,384 KB
testcase_05 AC 45 ms
66,920 KB
testcase_06 AC 45 ms
67,760 KB
testcase_07 AC 46 ms
68,028 KB
testcase_08 AC 45 ms
67,444 KB
testcase_09 AC 45 ms
68,660 KB
testcase_10 AC 47 ms
67,208 KB
testcase_11 AC 47 ms
67,520 KB
testcase_12 AC 46 ms
66,852 KB
testcase_13 AC 45 ms
67,680 KB
testcase_14 AC 44 ms
67,780 KB
testcase_15 AC 44 ms
67,988 KB
testcase_16 AC 45 ms
67,284 KB
testcase_17 AC 45 ms
67,536 KB
testcase_18 AC 37 ms
53,696 KB
testcase_19 AC 36 ms
52,364 KB
testcase_20 AC 36 ms
53,672 KB
testcase_21 AC 36 ms
53,780 KB
testcase_22 AC 35 ms
52,192 KB
testcase_23 AC 36 ms
52,560 KB
testcase_24 AC 46 ms
68,360 KB
testcase_25 AC 46 ms
68,288 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd
a,b = map(int,input().split())
if gcd(a,b) > 1:
    print(-1)
else:
    count = [1]*(10**6)
    for i in range(500):
        for j in range(500):
            count[i*a+b*j] = 0
            
    print(sum(count[:a*b//gcd(a,b)]))
0