結果

問題 No.1532 Different Products
ユーザー optopt
提出日時 2021-06-04 23:17:19
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 646 bytes
コンパイル時間 2,200 ms
コンパイル使用メモリ 208,072 KB
実行使用メモリ 347,512 KB
最終ジャッジ日時 2024-04-30 12:07:38
合計ジャッジ時間 24,107 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 161 ms
161,656 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 20 ms
22,844 KB
testcase_07 AC 28 ms
31,644 KB
testcase_08 AC 31 ms
36,676 KB
testcase_09 AC 67 ms
68,152 KB
testcase_10 AC 146 ms
137,844 KB
testcase_11 AC 123 ms
121,184 KB
testcase_12 AC 273 ms
218,092 KB
testcase_13 AC 139 ms
125,212 KB
testcase_14 AC 466 ms
332,500 KB
testcase_15 AC 30 ms
32,400 KB
testcase_16 AC 228 ms
235,980 KB
testcase_17 AC 121 ms
114,228 KB
testcase_18 AC 88 ms
83,388 KB
testcase_19 AC 246 ms
198,556 KB
testcase_20 AC 533 ms
315,440 KB
testcase_21 AC 261 ms
259,104 KB
testcase_22 AC 165 ms
147,264 KB
testcase_23 AC 100 ms
91,492 KB
testcase_24 AC 451 ms
303,880 KB
testcase_25 AC 271 ms
232,552 KB
testcase_26 AC 91 ms
93,332 KB
testcase_27 AC 288 ms
291,820 KB
testcase_28 AC 225 ms
217,464 KB
testcase_29 AC 308 ms
307,888 KB
testcase_30 AC 336 ms
321,324 KB
testcase_31 AC 330 ms
315,300 KB
testcase_32 AC 351 ms
321,024 KB
testcase_33 AC 319 ms
306,080 KB
testcase_34 AC 394 ms
317,344 KB
testcase_35 AC 350 ms
317,260 KB
testcase_36 AC 388 ms
329,388 KB
testcase_37 AC 301 ms
309,364 KB
testcase_38 AC 414 ms
324,348 KB
testcase_39 AC 367 ms
316,692 KB
testcase_40 AC 379 ms
315,304 KB
testcase_41 AC 547 ms
340,184 KB
testcase_42 AC 484 ms
331,932 KB
testcase_43 AC 508 ms
332,468 KB
testcase_44 AC 579 ms
345,704 KB
testcase_45 AC 583 ms
345,508 KB
testcase_46 AC 544 ms
344,200 KB
testcase_47 AC 575 ms
347,512 KB
testcase_48 AC 571 ms
345,516 KB
testcase_49 AC 584 ms
346,532 KB
testcase_50 AC 589 ms
346,280 KB
testcase_51 AC 580 ms
347,400 KB
testcase_52 AC 568 ms
346,108 KB
testcase_53 AC 594 ms
346,556 KB
testcase_54 AC 576 ms
345,268 KB
testcase_55 AC 564 ms
346,244 KB
testcase_56 AC 561 ms
343,832 KB
testcase_57 AC 549 ms
344,748 KB
testcase_58 AC 584 ms
346,732 KB
testcase_59 AC 528 ms
342,484 KB
testcase_60 AC 592 ms
346,732 KB
testcase_61 WA -
testcase_62 WA -
testcase_63 AC 574 ms
346,368 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define rep_(i, a_, b_, a, b, ...) for (int i = (a), lim##i = (b); i < lim##i; ++i)
#define rep(i, ...) rep_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
using ll = long long;


constexpr int m = 4e5;
int pre[202][m+1];
unordered_map<ll, ll> memo[202];

ll dp(int n, ll k) {
  if (k <= m) return pre[n][k];
  if (n == 0) return 1;
  if (memo[n].count(k)) return memo[n][k];
  return memo[n][k] = dp(n-1, k) + dp(n-1, k/n);
}

int main() {
  ll n, k; cin >> n >> k;
  rep(j, 1, m+1) pre[0][j] = 1;
  rep(i, 1, n) rep(j, m+1) pre[i][j] = pre[i-1][j] + pre[i-1][j/i];
  cout << (dp(n, k) - 1) << '\n';
}
0