結果
| 問題 | No.473 和と積の和 |
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2026-07-16 00:11:58 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 486 bytes |
| 記録 | |
| コンパイル時間 | 248 ms |
| コンパイル使用メモリ | 95,852 KB |
| 実行使用メモリ | 140,064 KB |
| 最終ジャッジ日時 | 2026-07-16 00:12:08 |
| 合計ジャッジ時間 | 9,556 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 21 TLE * 1 -- * 21 |
ソースコード
import sys
input = sys.stdin.readline
from collections import Counter
N,X=list(map(int,input().split()))
X+=1
L=[]
for x in range(1,10**5):
if X%x==0:
L.append(x)
L.append(X//x)
L=sorted(set(L))
DP=Counter()
DP[2,X]=1
for i in range(N):
NDP=Counter()
for a,rest in DP:
for l in L:
if l>=a and rest%l==0:
NDP[l,rest//l]+=DP[a,rest]
DP=NDP
ANS=0
for a,b in DP:
if b==1:
ANS+=DP[a,b]
print(ANS)
titia