結果

問題 No.1532 Different Products
ユーザー mkawa2mkawa2
提出日時 2023-10-05 09:47:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 656 ms / 4,000 ms
コード長 1,029 bytes
コンパイル時間 351 ms
コンパイル使用メモリ 87,100 KB
実行使用メモリ 123,768 KB
最終ジャッジ日時 2023-10-05 09:48:15
合計ジャッジ時間 27,670 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
71,600 KB
testcase_01 AC 166 ms
86,072 KB
testcase_02 AC 89 ms
71,760 KB
testcase_03 AC 94 ms
71,760 KB
testcase_04 AC 88 ms
71,864 KB
testcase_05 AC 86 ms
71,700 KB
testcase_06 AC 93 ms
77,640 KB
testcase_07 AC 95 ms
77,396 KB
testcase_08 AC 97 ms
77,760 KB
testcase_09 AC 118 ms
81,692 KB
testcase_10 AC 186 ms
90,488 KB
testcase_11 AC 168 ms
91,304 KB
testcase_12 AC 342 ms
108,724 KB
testcase_13 AC 238 ms
97,448 KB
testcase_14 AC 549 ms
120,296 KB
testcase_15 AC 105 ms
77,508 KB
testcase_16 AC 187 ms
90,896 KB
testcase_17 AC 184 ms
92,628 KB
testcase_18 AC 147 ms
88,240 KB
testcase_19 AC 341 ms
113,244 KB
testcase_20 AC 511 ms
121,132 KB
testcase_21 AC 216 ms
91,400 KB
testcase_22 AC 242 ms
98,284 KB
testcase_23 AC 153 ms
91,448 KB
testcase_24 AC 492 ms
116,364 KB
testcase_25 AC 307 ms
103,200 KB
testcase_26 AC 120 ms
81,236 KB
testcase_27 AC 270 ms
93,216 KB
testcase_28 AC 228 ms
92,684 KB
testcase_29 AC 202 ms
89,980 KB
testcase_30 AC 325 ms
106,728 KB
testcase_31 AC 335 ms
109,400 KB
testcase_32 AC 380 ms
109,616 KB
testcase_33 AC 283 ms
98,536 KB
testcase_34 AC 461 ms
115,784 KB
testcase_35 AC 375 ms
111,852 KB
testcase_36 AC 430 ms
116,276 KB
testcase_37 AC 166 ms
88,152 KB
testcase_38 AC 470 ms
115,488 KB
testcase_39 AC 401 ms
115,836 KB
testcase_40 AC 409 ms
114,768 KB
testcase_41 AC 602 ms
119,652 KB
testcase_42 AC 517 ms
120,280 KB
testcase_43 AC 568 ms
119,264 KB
testcase_44 AC 589 ms
121,724 KB
testcase_45 AC 625 ms
122,332 KB
testcase_46 AC 585 ms
119,472 KB
testcase_47 AC 614 ms
123,416 KB
testcase_48 AC 656 ms
122,404 KB
testcase_49 AC 639 ms
123,492 KB
testcase_50 AC 650 ms
122,396 KB
testcase_51 AC 643 ms
123,452 KB
testcase_52 AC 653 ms
121,036 KB
testcase_53 AC 634 ms
123,544 KB
testcase_54 AC 632 ms
121,436 KB
testcase_55 AC 636 ms
123,768 KB
testcase_56 AC 601 ms
119,304 KB
testcase_57 AC 607 ms
120,096 KB
testcase_58 AC 583 ms
121,844 KB
testcase_59 AC 561 ms
118,648 KB
testcase_60 AC 619 ms
123,104 KB
testcase_61 AC 90 ms
71,668 KB
testcase_62 AC 90 ms
71,916 KB
testcase_63 AC 638 ms
121,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

# sys.setrecursionlimit(200005)
# sys.set_int_max_str_digits(200005)
int1 = lambda x: int(x)-1
pDB = lambda *x: print(*x, end="\n", file=sys.stderr)
p2D = lambda x: print(*x, sep="\n", end="\n\n", file=sys.stderr)
def II(): return int(sys.stdin.readline())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def SI(): return sys.stdin.readline().rstrip()

dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
# inf = -1-(-1 << 31)
inf = -1-(-1 << 63)
md = 10**9+7
# md = 998244353

from collections import Counter

N, K = LI()

if N == 1 or K == 1:
    print(1)
    exit()

dp=Counter()
dp[K]=1

for n in range(N,0,-1):
    pre=dp.copy()
    for k,c in pre.items():
        dp[k//n]+=c

ans=-1
for k,c in dp.items():
    if k:ans+=c

print(ans)
0