結果
| 問題 | No.473 和と積の和 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2022-05-19 14:31:44 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                TLE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 499 bytes | 
| コンパイル時間 | 176 ms | 
| コンパイル使用メモリ | 82,048 KB | 
| 実行使用メモリ | 82,176 KB | 
| 最終ジャッジ日時 | 2024-09-17 20:42:43 | 
| 合計ジャッジ時間 | 6,693 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 4 | 
| other | AC * 21 TLE * 1 -- * 21 | 
ソースコード
N,X = map(int,input().split())
ue = 10 ** 5
from functools import lru_cache
#@lru_cache(maxsize = 100000)
div = []
for i in range(2,ue):
    if (X + 1) % i == 0:
        div.append(i)
#@lru_cache(maxsize = 100000)
t = len(div)
def calc(n = N,inf = 0,x = X + 1):
    if div[inf] > x:return 0
    if n == 1:
        return 1
    ans = 0
    for i in range(inf,t):
        u = div[i]
        if u > x:break
        if x % u == 0:
            ans += calc(n - 1,i,x // u)
    return ans
print(calc())
            
            
            
        