結果

問題 No.882 約数倍数
ユーザー kohei2019kohei2019
提出日時 2022-05-04 23:21:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 75 ms / 500 ms
コード長 406 bytes
コンパイル時間 277 ms
コンパイル使用メモリ 87,248 KB
実行使用メモリ 71,588 KB
最終ジャッジ日時 2023-09-17 04:28:45
合計ジャッジ時間 2,241 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,388 KB
testcase_01 AC 72 ms
71,492 KB
testcase_02 AC 72 ms
71,580 KB
testcase_03 AC 75 ms
71,492 KB
testcase_04 AC 72 ms
71,324 KB
testcase_05 AC 72 ms
71,284 KB
testcase_06 AC 72 ms
71,448 KB
testcase_07 AC 73 ms
71,376 KB
testcase_08 AC 73 ms
71,156 KB
testcase_09 AC 71 ms
71,368 KB
testcase_10 AC 71 ms
71,588 KB
testcase_11 AC 73 ms
71,140 KB
testcase_12 AC 73 ms
71,372 KB
testcase_13 AC 73 ms
71,332 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def make_divisors(N):#約数列挙O(√N)
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= N:
        if N % i == 0:
            lower_divisors.append(i)
            if i != N // i:
                upper_divisors.append(N//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

A,B = map(int, input().split())
AP = set(make_divisors(A))
print('YES' if B in AP else 'NO')
0