結果

問題 No.882 約数倍数
ユーザー momotaros300momotaros300
提出日時 2019-09-13 21:57:19
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 16 ms / 500 ms
コード長 393 bytes
コンパイル時間 331 ms
コンパイル使用メモリ 10,636 KB
実行使用メモリ 7,908 KB
最終ジャッジ日時 2023-09-17 07:14:17
合計ジャッジ時間 1,265 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,808 KB
testcase_01 AC 16 ms
7,848 KB
testcase_02 AC 16 ms
7,908 KB
testcase_03 AC 16 ms
7,808 KB
testcase_04 AC 16 ms
7,844 KB
testcase_05 AC 15 ms
7,808 KB
testcase_06 AC 15 ms
7,808 KB
testcase_07 AC 16 ms
7,788 KB
testcase_08 AC 15 ms
7,808 KB
testcase_09 AC 15 ms
7,848 KB
testcase_10 AC 15 ms
7,848 KB
testcase_11 AC 16 ms
7,800 KB
testcase_12 AC 16 ms
7,812 KB
testcase_13 AC 16 ms
7,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a, b = map(int, input().split())


def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

divisors=make_divisors(a)
for i in divisors:
    if i%b==0:
        print('YES')
        break
else:
    print('NO')
0