結果

問題 No.1532 Different Products
ユーザー optopt
提出日時 2021-06-04 23:29:56
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 333 bytes
コンパイル時間 2,353 ms
コンパイル使用メモリ 207,656 KB
実行使用メモリ 199,704 KB
最終ジャッジ日時 2024-04-30 12:31:55
合計ジャッジ時間 136,014 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 497 ms
39,716 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 3 ms
6,944 KB
testcase_08 AC 5 ms
6,944 KB
testcase_09 AC 79 ms
13,056 KB
testcase_10 AC 669 ms
46,792 KB
testcase_11 AC 452 ms
35,524 KB
testcase_12 AC 2,072 ms
110,036 KB
testcase_13 AC 908 ms
53,644 KB
testcase_14 AC 3,321 ms
164,628 KB
testcase_15 AC 8 ms
6,944 KB
testcase_16 AC 602 ms
45,024 KB
testcase_17 AC 475 ms
34,944 KB
testcase_18 AC 273 ms
25,060 KB
testcase_19 AC 2,006 ms
106,960 KB
testcase_20 AC 3,359 ms
167,584 KB
testcase_21 AC 988 ms
61,100 KB
testcase_22 AC 1,114 ms
63,976 KB
testcase_23 AC 409 ms
31,444 KB
testcase_24 AC 3,034 ms
156,448 KB
testcase_25 AC 1,651 ms
94,324 KB
testcase_26 AC 94 ms
14,592 KB
testcase_27 AC 1,397 ms
80,000 KB
testcase_28 AC 977 ms
63,028 KB
testcase_29 AC 1,005 ms
61,636 KB
testcase_30 AC 2,019 ms
106,512 KB
testcase_31 AC 2,111 ms
107,384 KB
testcase_32 AC 2,346 ms
121,952 KB
testcase_33 AC 1,750 ms
95,840 KB
testcase_34 AC 2,982 ms
145,668 KB
testcase_35 AC 2,288 ms
121,012 KB
testcase_36 AC 2,802 ms
143,580 KB
testcase_37 AC 535 ms
43,136 KB
testcase_38 AC 2,997 ms
151,708 KB
testcase_39 AC 2,598 ms
136,680 KB
testcase_40 AC 2,717 ms
139,368 KB
testcase_41 AC 3,904 ms
190,756 KB
testcase_42 AC 3,491 ms
171,616 KB
testcase_43 AC 3,569 ms
178,784 KB
testcase_44 AC 3,870 ms
195,600 KB
testcase_45 AC 3,873 ms
196,532 KB
testcase_46 AC 3,763 ms
188,452 KB
testcase_47 AC 3,934 ms
198,680 KB
testcase_48 AC 3,800 ms
196,340 KB
testcase_49 AC 3,875 ms
196,988 KB
testcase_50 AC 3,881 ms
195,484 KB
testcase_51 AC 3,965 ms
198,396 KB
testcase_52 AC 3,940 ms
192,908 KB
testcase_53 AC 3,965 ms
198,736 KB
testcase_54 AC 3,800 ms
193,028 KB
testcase_55 AC 3,959 ms
196,912 KB
testcase_56 AC 3,789 ms
188,252 KB
testcase_57 AC 3,824 ms
189,848 KB
testcase_58 AC 3,897 ms
194,860 KB
testcase_59 AC 3,718 ms
183,132 KB
testcase_60 TLE -
testcase_61 AC 2 ms
6,944 KB
testcase_62 AC 2 ms
6,944 KB
testcase_63 AC 3,879 ms
196,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using ll = long long;

std::unordered_map<ll, ll> memo[202];
ll dp(int n, ll k) {
  if (k == 0) return 0;
  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; std::cin >> n >> k;
  std::cout << (dp(n, k) - 1) << '\n';
}
0