結果

問題 No.847 Divisors of Power
ユーザー 👑 H20H20
提出日時 2020-11-27 11:52:25
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 672 bytes
コンパイル時間 339 ms
コンパイル使用メモリ 87,164 KB
実行使用メモリ 306,356 KB
最終ジャッジ日時 2023-10-01 04:08:49
合計ジャッジ時間 6,206 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
71,780 KB
testcase_01 AC 116 ms
75,824 KB
testcase_02 AC 95 ms
76,036 KB
testcase_03 AC 89 ms
71,464 KB
testcase_04 AC 101 ms
76,648 KB
testcase_05 AC 100 ms
76,052 KB
testcase_06 AC 92 ms
75,492 KB
testcase_07 AC 90 ms
75,380 KB
testcase_08 AC 92 ms
75,268 KB
testcase_09 AC 96 ms
76,188 KB
testcase_10 AC 92 ms
76,196 KB
testcase_11 AC 99 ms
76,872 KB
testcase_12 AC 91 ms
76,188 KB
testcase_13 AC 93 ms
75,960 KB
testcase_14 AC 97 ms
76,284 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 #

import copy

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)
CD = DD.copy()
temp = len(DD)
i=1
while i < K:
    for j in range(temp):
        for cd in CD:
            if DD[j]*cd<=M:
                DD.append(DD[j]*cd)
    i+=1
    DD = list(set(DD))
    if len(DD)==temp:
        break
    temp = len(DD)
print(len(DD))
0