結果

問題 No.982 Add
ユーザー titia
提出日時 2020-02-11 13:33:00
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 34 ms / 2,000 ms
コード長 257 bytes
コンパイル時間 200 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-10-01 07:19:48
合計ジャッジ時間 1,792 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

A,B=map(int,input().split())

import math

if math.gcd(A,B)!=1:
    print(-1)
else:
    ANS=[0]*(A*B+1)

    for i in range(100):
        for j in range(100):
            if A*i+B*j<=A*B:
                ANS[A*i+B*j]=1

    print(ANS.count(0))
            
0