結果

問題 No.882 約数倍数
ユーザー kaisendon_1206kaisendon_1206
提出日時 2020-03-19 09:34:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 14 ms / 500 ms
コード長 410 bytes
コンパイル時間 479 ms
コンパイル使用メモリ 10,732 KB
実行使用メモリ 7,936 KB
最終ジャッジ日時 2023-08-20 20:42:05
合計ジャッジ時間 919 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,752 KB
testcase_01 AC 14 ms
7,836 KB
testcase_02 AC 13 ms
7,932 KB
testcase_03 AC 12 ms
7,936 KB
testcase_04 AC 13 ms
7,836 KB
testcase_05 AC 13 ms
7,776 KB
testcase_06 AC 12 ms
7,840 KB
testcase_07 AC 12 ms
7,820 KB
testcase_08 AC 12 ms
7,760 KB
testcase_09 AC 12 ms
7,820 KB
testcase_10 AC 13 ms
7,836 KB
testcase_11 AC 13 ms
7,904 KB
testcase_12 AC 12 ms
7,824 KB
testcase_13 AC 13 ms
7,844 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1): #9…[1,2,3]
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors

div = make_divisors(A)

for x in div:
    if x % B == 0:
        print('YES')
        break
else:
    print('NO')
0