結果

問題 No.1532 Different Products
ユーザー googol_S0googol_S0
提出日時 2021-06-04 20:55:12
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 1,369 ms / 4,000 ms
コード長 710 bytes
コンパイル時間 1,488 ms
コンパイル使用メモリ 86,752 KB
実行使用メモリ 391,568 KB
最終ジャッジ日時 2023-08-12 10:29:01
合計ジャッジ時間 56,909 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,360 KB
testcase_01 AC 466 ms
164,016 KB
testcase_02 AC 87 ms
75,964 KB
testcase_03 AC 86 ms
75,968 KB
testcase_04 AC 78 ms
75,876 KB
testcase_05 AC 78 ms
75,976 KB
testcase_06 AC 116 ms
86,084 KB
testcase_07 AC 136 ms
90,920 KB
testcase_08 AC 147 ms
92,524 KB
testcase_09 AC 237 ms
109,012 KB
testcase_10 AC 426 ms
159,788 KB
testcase_11 AC 377 ms
147,224 KB
testcase_12 AC 730 ms
237,472 KB
testcase_13 AC 521 ms
185,500 KB
testcase_14 AC 1,148 ms
339,112 KB
testcase_15 AC 193 ms
102,476 KB
testcase_16 AC 603 ms
192,956 KB
testcase_17 AC 395 ms
149,936 KB
testcase_18 AC 330 ms
137,196 KB
testcase_19 AC 700 ms
228,932 KB
testcase_20 AC 1,130 ms
339,160 KB
testcase_21 AC 685 ms
217,772 KB
testcase_22 AC 521 ms
183,272 KB
testcase_23 AC 395 ms
153,084 KB
testcase_24 AC 1,057 ms
319,996 KB
testcase_25 AC 707 ms
226,636 KB
testcase_26 AC 286 ms
121,736 KB
testcase_27 AC 781 ms
235,784 KB
testcase_28 AC 609 ms
200,288 KB
testcase_29 AC 759 ms
237,080 KB
testcase_30 AC 894 ms
270,392 KB
testcase_31 AC 887 ms
269,200 KB
testcase_32 AC 943 ms
284,468 KB
testcase_33 AC 842 ms
257,816 KB
testcase_34 AC 1,031 ms
311,048 KB
testcase_35 AC 934 ms
282,468 KB
testcase_36 AC 1,025 ms
309,416 KB
testcase_37 AC 740 ms
229,036 KB
testcase_38 AC 1,054 ms
318,896 KB
testcase_39 AC 987 ms
299,020 KB
testcase_40 AC 996 ms
301,748 KB
testcase_41 AC 1,369 ms
381,268 KB
testcase_42 AC 1,233 ms
349,488 KB
testcase_43 AC 1,211 ms
360,404 KB
testcase_44 AC 1,293 ms
386,068 KB
testcase_45 AC 1,305 ms
386,900 KB
testcase_46 AC 1,273 ms
377,852 KB
testcase_47 AC 1,310 ms
389,832 KB
testcase_48 AC 1,296 ms
386,832 KB
testcase_49 AC 1,306 ms
388,432 KB
testcase_50 AC 1,295 ms
386,260 KB
testcase_51 AC 1,305 ms
389,264 KB
testcase_52 AC 1,292 ms
383,608 KB
testcase_53 AC 1,306 ms
390,880 KB
testcase_54 AC 1,294 ms
383,792 KB
testcase_55 AC 1,301 ms
387,360 KB
testcase_56 AC 1,271 ms
377,384 KB
testcase_57 AC 1,291 ms
379,528 KB
testcase_58 AC 1,295 ms
385,240 KB
testcase_59 AC 1,239 ms
368,180 KB
testcase_60 AC 1,315 ms
391,568 KB
testcase_61 AC 80 ms
71,332 KB
testcase_62 AC 71 ms
71,252 KB
testcase_63 AC 1,301 ms
387,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())
M=10**5
if M>=K:
  DP=[[0]*K for i in range(N+1)]
  DP[0][0]=1
  for i in range(N):
    for j in range(K):
      DP[i+1][j]+=DP[i][j]
    for j in range(K):
      x=(j+1)*(i+1)
      if x<=K:
        DP[i+1][x-1]+=DP[i][j]
  print(sum(DP[N])-1)
  exit()
DP1=[[0]*M for i in range(N+1)]
Z=K//M
DP2=[[0]*Z for i in range(N+1)]
DP1[0][0]=1
for i in range(N):
  for j in range(M):
    DP1[i+1][j]+=DP1[i][j]
    x=(j+1)*(i+1)
    if x>K:
      continue
    elif x<=M:
      DP1[i+1][x-1]+=DP1[i][j]
    else:
      DP2[i+1][K//x-1]+=DP1[i][j]
  for j in range(Z):
    DP2[i+1][j]+=DP2[i][j]
    x=(j+1)//(i+1)
    if x>0:
      DP2[i+1][x-1]+=DP2[i][j]
print(sum(DP1[N])+sum(DP2[N])-1)
0