結果

問題 No.982 Add
ユーザー aaaaaaaaaa2230
提出日時 2022-06-18 10:25:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 51 ms / 2,000 ms
コード長 248 bytes
コンパイル時間 168 ms
コンパイル使用メモリ 81,992 KB
実行使用メモリ 66,944 KB
最終ジャッジ日時 2024-10-09 21:40:24
合計ジャッジ時間 2,289 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

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