結果

問題 No.882 約数倍数
ユーザー miya145592miya145592
提出日時 2023-05-21 04:33:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 72 ms / 500 ms
コード長 422 bytes
コンパイル時間 285 ms
コンパイル使用メモリ 87,124 KB
実行使用メモリ 71,492 KB
最終ジャッジ日時 2023-08-23 12:09:44
合計ジャッジ時間 2,233 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,348 KB
testcase_01 AC 72 ms
71,336 KB
testcase_02 AC 72 ms
71,440 KB
testcase_03 AC 72 ms
71,200 KB
testcase_04 AC 72 ms
71,300 KB
testcase_05 AC 72 ms
71,348 KB
testcase_06 AC 72 ms
71,200 KB
testcase_07 AC 70 ms
71,492 KB
testcase_08 AC 70 ms
71,460 KB
testcase_09 AC 71 ms
71,224 KB
testcase_10 AC 71 ms
71,184 KB
testcase_11 AC 71 ms
71,284 KB
testcase_12 AC 72 ms
71,460 KB
testcase_13 AC 71 ms
71,480 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def make_divisors(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())
Y = make_divisors(A)
for y in Y:
    if y%B==0:
        print("YES")
        exit()
print("NO")
0