結果
問題 |
No.847 Divisors of Power
|
ユーザー |
![]() |
提出日時 | 2020-11-27 11:52:25 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 672 bytes |
コンパイル時間 | 630 ms |
コンパイル使用メモリ | 82,376 KB |
実行使用メモリ | 290,540 KB |
最終ジャッジ日時 | 2024-07-23 21:33:43 |
合計ジャッジ時間 | 5,044 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 4 |
other | AC * 15 TLE * 1 -- * 10 |
ソースコード
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))