結果

問題 No.882 約数倍数
ユーザー Ohnuma
提出日時 2020-04-10 15:22:14
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 33 ms / 500 ms
コード長 364 bytes
コンパイル時間 238 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-09-15 02:55:44
合計ジャッジ時間 1,126 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

def prime_decomposition(x):
    ret = []
    for i in range(1, int(x**0.5)+1):
        if x%i==0:
            ret.append(i)
            if i!=x//i:
                ret.append(x//i)
    return sorted(ret)

a,b = map(int,input().split())
l = prime_decomposition(a)
flg = False
for x in l:
    if x%b==0:
        flg = True
        break
print('YES' if flg else 'NO')
0