結果

問題 No.473 和と積の和
ユーザー H3PO4H3PO4
提出日時 2021-09-05 14:15:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 2,101 ms / 3,000 ms
コード長 494 bytes
コンパイル時間 212 ms
コンパイル使用メモリ 10,784 KB
実行使用メモリ 10,232 KB
最終ジャッジ日時 2023-08-23 14:12:50
合計ジャッジ時間 10,692 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,800 KB
testcase_01 AC 16 ms
7,772 KB
testcase_02 AC 16 ms
7,796 KB
testcase_03 AC 322 ms
8,700 KB
testcase_04 AC 16 ms
7,844 KB
testcase_05 AC 16 ms
7,828 KB
testcase_06 AC 16 ms
7,804 KB
testcase_07 AC 16 ms
7,720 KB
testcase_08 AC 16 ms
7,840 KB
testcase_09 AC 16 ms
7,908 KB
testcase_10 AC 16 ms
7,904 KB
testcase_11 AC 18 ms
7,768 KB
testcase_12 AC 16 ms
7,720 KB
testcase_13 AC 16 ms
7,856 KB
testcase_14 AC 17 ms
7,936 KB
testcase_15 AC 16 ms
7,792 KB
testcase_16 AC 17 ms
7,772 KB
testcase_17 AC 17 ms
7,788 KB
testcase_18 AC 16 ms
7,776 KB
testcase_19 AC 16 ms
7,776 KB
testcase_20 AC 23 ms
7,800 KB
testcase_21 AC 16 ms
7,720 KB
testcase_22 AC 16 ms
7,796 KB
testcase_23 AC 24 ms
7,864 KB
testcase_24 AC 29 ms
7,840 KB
testcase_25 AC 868 ms
8,932 KB
testcase_26 AC 247 ms
8,852 KB
testcase_27 AC 324 ms
8,720 KB
testcase_28 AC 26 ms
8,504 KB
testcase_29 AC 19 ms
7,812 KB
testcase_30 AC 19 ms
7,844 KB
testcase_31 AC 19 ms
7,804 KB
testcase_32 AC 19 ms
7,800 KB
testcase_33 AC 18 ms
7,944 KB
testcase_34 AC 604 ms
8,968 KB
testcase_35 AC 539 ms
8,876 KB
testcase_36 AC 24 ms
7,804 KB
testcase_37 AC 19 ms
7,788 KB
testcase_38 AC 493 ms
8,828 KB
testcase_39 AC 291 ms
8,672 KB
testcase_40 AC 310 ms
8,688 KB
testcase_41 AC 2,101 ms
10,232 KB
testcase_42 AC 347 ms
8,552 KB
testcase_43 AC 400 ms
8,720 KB
testcase_44 AC 456 ms
8,788 KB
testcase_45 AC 18 ms
7,912 KB
testcase_46 AC 18 ms
7,772 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def make_divisors(n):
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            yield i
            if i != n // i:
                yield n // i


N, X = map(int, input().split())
div = sorted(make_divisors(X + 1))
st = set(div)
dp = [{d: 0 for d in div} for _ in range(N + 1)]
dp[0][1] = 1
for d in div:
    if d == 1:
        continue
    for v in div:
        if d * v in st:
            for i in range(N):
                dp[i + 1][d * v] += dp[i][v]
print(dp[N][X + 1])
0