結果
| 問題 |
No.847 Divisors of Power
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-05-20 12:35:30 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 93 ms / 2,000 ms |
| コード長 | 505 bytes |
| コンパイル時間 | 177 ms |
| コンパイル使用メモリ | 82,304 KB |
| 実行使用メモリ | 112,248 KB |
| 最終ジャッジ日時 | 2024-09-19 20:19:41 |
| 合計ジャッジ時間 | 2,268 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 26 |
ソースコード
n,k,m = map(int,input().split())
divs = {}
for i in range(2,int(n**0.5)+1):
if n%i:
continue
c = 0
while n%i == 0:
n //= i
c += 1
divs[i] = c*k
if n > 1:
divs[n] = k
dp = set()
dp.add(1)
for key,value in divs.items():
ndp = set()
for d in dp:
ndp.add(d)
nd = d
for p in range(value):
nd *= key
if nd <= m:
ndp.add(nd)
else:
break
dp = ndp
print(len(dp))