結果

問題 No.473 和と積の和
ユーザー convexineqconvexineq
提出日時 2021-03-31 05:36:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 453 ms / 3,000 ms
コード長 619 bytes
コンパイル時間 391 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 76,920 KB
最終ジャッジ日時 2023-08-21 00:34:55
合計ジャッジ時間 8,579 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,492 KB
testcase_01 AC 77 ms
71,348 KB
testcase_02 AC 74 ms
71,200 KB
testcase_03 AC 189 ms
76,728 KB
testcase_04 AC 74 ms
71,104 KB
testcase_05 AC 76 ms
71,464 KB
testcase_06 AC 74 ms
71,384 KB
testcase_07 AC 73 ms
71,352 KB
testcase_08 AC 74 ms
71,396 KB
testcase_09 AC 74 ms
71,352 KB
testcase_10 AC 72 ms
71,400 KB
testcase_11 AC 80 ms
76,496 KB
testcase_12 AC 76 ms
75,932 KB
testcase_13 AC 78 ms
76,040 KB
testcase_14 AC 77 ms
76,132 KB
testcase_15 AC 78 ms
76,088 KB
testcase_16 AC 78 ms
75,932 KB
testcase_17 AC 81 ms
76,228 KB
testcase_18 AC 73 ms
71,244 KB
testcase_19 AC 74 ms
71,248 KB
testcase_20 AC 84 ms
76,572 KB
testcase_21 AC 74 ms
71,252 KB
testcase_22 AC 72 ms
71,444 KB
testcase_23 AC 81 ms
76,732 KB
testcase_24 AC 87 ms
76,540 KB
testcase_25 AC 453 ms
76,708 KB
testcase_26 AC 167 ms
76,728 KB
testcase_27 AC 211 ms
76,532 KB
testcase_28 AC 84 ms
76,520 KB
testcase_29 AC 84 ms
76,464 KB
testcase_30 AC 83 ms
76,536 KB
testcase_31 AC 85 ms
76,288 KB
testcase_32 AC 85 ms
76,316 KB
testcase_33 AC 82 ms
76,372 KB
testcase_34 AC 304 ms
76,588 KB
testcase_35 AC 282 ms
76,528 KB
testcase_36 AC 84 ms
76,732 KB
testcase_37 AC 84 ms
76,244 KB
testcase_38 AC 268 ms
76,692 KB
testcase_39 AC 174 ms
76,492 KB
testcase_40 AC 181 ms
76,544 KB
testcase_41 AC 340 ms
76,760 KB
testcase_42 AC 123 ms
76,884 KB
testcase_43 AC 166 ms
76,920 KB
testcase_44 AC 214 ms
76,720 KB
testcase_45 AC 81 ms
76,400 KB
testcase_46 AC 79 ms
75,408 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def divisor_list(N): #約数のリスト
    if N == 1: return [1]
    res = []
    for i in range(1,N):
        if i*i >= N: break
        if N%i == 0:
            res.append(i)
            res.append(N//i)
    if i*i == N: res.append(i)
    return sorted(res)

n,x = map(int,input().split())
x += 1
lst = divisor_list(x)
L = len(lst)
dp = [[0]*L for _ in range(n+1)]
dp[0][0] = 1
z = {d:di for di,d in enumerate(lst)}
for zd in range(1,L):
    d = lst[zd]
    for i in range(n):
        for j in range(L):
            if dp[i][j] and x%(lst[j]*d)==0:
                dp[i+1][z[lst[j]*d]] += dp[i][j]
print(dp[n][-1])
0