結果

問題 No.847 Divisors of Power
ユーザー 👑 H20H20
提出日時 2020-11-27 11:41:55
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 658 bytes
コンパイル時間 413 ms
コンパイル使用メモリ 87,068 KB
実行使用メモリ 320,388 KB
最終ジャッジ日時 2023-10-01 04:07:47
合計ジャッジ時間 6,809 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
75,508 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 76 ms
75,712 KB
testcase_04 AC 86 ms
76,704 KB
testcase_05 AC 79 ms
76,332 KB
testcase_06 AC 76 ms
75,384 KB
testcase_07 AC 75 ms
75,288 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 85 ms
76,356 KB
testcase_15 TLE -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
権限があれば一括ダウンロードができます

ソースコード

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]
N,K,M= map(int,input().split())
D = make_divisors(N)
DD =[]
for d in D:
    if d<=M:
        DD.append(d)
temp = len(DD)
i=1
while i < K:
    for j in range(temp):
        for k in range(temp):
            if DD[j]*DD[k]<=M:
                DD.append(DD[j]*DD[k])
    i+=1
    DD = list(set(DD))
    if len(DD)==temp:
        break
    temp = len(DD)
print(len(DD))
0