結果

問題 No.882 約数倍数
ユーザー clearbookclearbook
提出日時 2019-12-10 21:58:30
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 17 ms / 500 ms
コード長 412 bytes
コンパイル時間 146 ms
コンパイル使用メモリ 10,696 KB
実行使用メモリ 8,440 KB
最終ジャッジ日時 2023-09-06 07:39:58
合計ジャッジ時間 1,831 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,828 KB
testcase_01 AC 17 ms
7,848 KB
testcase_02 AC 17 ms
8,380 KB
testcase_03 AC 16 ms
7,760 KB
testcase_04 AC 16 ms
8,440 KB
testcase_05 AC 16 ms
7,832 KB
testcase_06 AC 16 ms
8,332 KB
testcase_07 AC 16 ms
8,432 KB
testcase_08 AC 15 ms
7,900 KB
testcase_09 AC 16 ms
8,256 KB
testcase_10 AC 16 ms
8,428 KB
testcase_11 AC 15 ms
7,756 KB
testcase_12 AC 16 ms
8,384 KB
testcase_13 AC 15 ms
8,136 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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, B = map(int, input().split())

A_div = make_divisors(A)

for i in range(len(A_div)):
    if A_div[i] % B == 0:
        print("YES")
        exit()
        
print("NO")
0