結果

問題 No.882 約数倍数
ユーザー naoe123naoe123
提出日時 2020-02-01 04:17:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 32 ms / 500 ms
コード長 419 bytes
コンパイル時間 86 ms
コンパイル使用メモリ 12,036 KB
実行使用メモリ 10,268 KB
最終ジャッジ日時 2023-10-18 23:29:33
合計ジャッジ時間 1,529 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,268 KB
testcase_01 AC 31 ms
10,204 KB
testcase_02 AC 29 ms
10,204 KB
testcase_03 AC 30 ms
10,204 KB
testcase_04 AC 31 ms
10,204 KB
testcase_05 AC 31 ms
10,172 KB
testcase_06 AC 30 ms
10,204 KB
testcase_07 AC 30 ms
10,204 KB
testcase_08 AC 31 ms
10,204 KB
testcase_09 AC 31 ms
10,204 KB
testcase_10 AC 32 ms
10,204 KB
testcase_11 AC 30 ms
10,268 KB
testcase_12 AC 31 ms
10,204 KB
testcase_13 AC 31 ms
10,172 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

A_list=make_divisors(A)
flag=False
for i in A_list:
    if i%B==0:
        flag=True
        break

if flag:
    print('YES')
else:
    print('NO')
0