結果
問題 | No.847 Divisors of Power |
ユーザー | kohei2019 |
提出日時 | 2022-04-27 00:31:55 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 792 bytes |
コンパイル時間 | 301 ms |
コンパイル使用メモリ | 87,072 KB |
実行使用メモリ | 91,772 KB |
最終ジャッジ日時 | 2023-09-10 16:29:20 |
合計ジャッジ時間 | 5,916 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 73 ms
75,880 KB |
testcase_01 | AC | 72 ms
71,596 KB |
testcase_02 | AC | 73 ms
71,428 KB |
testcase_03 | AC | 76 ms
71,752 KB |
testcase_04 | AC | 93 ms
77,436 KB |
testcase_05 | AC | 76 ms
71,616 KB |
testcase_06 | AC | 75 ms
75,984 KB |
testcase_07 | AC | 76 ms
75,644 KB |
testcase_08 | AC | 77 ms
75,712 KB |
testcase_09 | AC | 78 ms
75,640 KB |
testcase_10 | AC | 81 ms
76,292 KB |
testcase_11 | AC | 91 ms
76,828 KB |
testcase_12 | AC | 78 ms
75,584 KB |
testcase_13 | AC | 95 ms
78,064 KB |
testcase_14 | AC | 86 ms
76,436 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 | -- | - |
ソースコード
def factorization(N):#素因数分解√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 #[素因数、個数] N,K,M = map(int,input().split()) if N == 1: print(1) exit() pp = factorization(N) bb = [] for i in range(len(pp)): a,b = pp[i] b = min(b*K,30) bb.append((a,b)) ans = [] def func(ind,val): if val > M: return if ind == len(bb): ans.append(val) return a,b = bb[ind] for i in range(b+1): func(ind+1, val*(a**i)) func(0,1) print(len(ans))