結果
問題 |
No.847 Divisors of Power
|
ユーザー |
![]() |
提出日時 | 2021-01-05 11:52:16 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 726 bytes |
コンパイル時間 | 241 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 65,664 KB |
最終ジャッジ日時 | 2024-10-15 18:45:00 |
合計ジャッジ時間 | 2,782 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 RE * 1 |
other | AC * 8 WA * 16 RE * 2 |
ソースコード
N,K,M=map(int, input().split()) if N==1: print(1) exit() def factorization(n): arr = [] temp = n for i in range(2, int(-(-n**0.5//1))+1): if temp%i==0: cnt=0 while temp%i==0: cnt+=1 temp //= i arr.append([i, cnt]) if temp!=1: arr.append([temp, 1]) if arr==[]: arr.append([n, 1]) return arr A=factorization(N) a=len(A) D=[] for a,b in A: D.append((a,b*K)) from collections import deque d=deque() d.append(1) nd=deque() ans=0 for i in range(2): while len(d): p=d.popleft() s,t=D[i] n=0 while p*pow(s,n)<=M and n<=t: nd.append(p*pow(s,n)) n+=1 d=nd nd=deque() print(len(d))