結果

問題 No.1532 Different Products
ユーザー optopt
提出日時 2021-06-05 11:23:33
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 509 ms / 4,000 ms
コード長 483 bytes
コンパイル時間 2,040 ms
コンパイル使用メモリ 210,664 KB
実行使用メモリ 12,040 KB
最終ジャッジ日時 2024-05-01 06:12:23
合計ジャッジ時間 20,212 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 85 ms
6,820 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 1 ms
6,940 KB
testcase_04 AC 1 ms
6,940 KB
testcase_05 AC 1 ms
6,944 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 3 ms
6,940 KB
testcase_09 AC 25 ms
6,944 KB
testcase_10 AC 106 ms
6,940 KB
testcase_11 AC 78 ms
6,944 KB
testcase_12 AC 265 ms
8,080 KB
testcase_13 AC 134 ms
7,564 KB
testcase_14 AC 403 ms
9,240 KB
testcase_15 AC 5 ms
6,940 KB
testcase_16 AC 100 ms
6,944 KB
testcase_17 AC 80 ms
6,944 KB
testcase_18 AC 55 ms
6,940 KB
testcase_19 AC 252 ms
8,176 KB
testcase_20 AC 428 ms
9,328 KB
testcase_21 AC 138 ms
6,940 KB
testcase_22 AC 164 ms
7,556 KB
testcase_23 AC 79 ms
6,940 KB
testcase_24 AC 386 ms
9,212 KB
testcase_25 AC 214 ms
7,636 KB
testcase_26 AC 28 ms
6,944 KB
testcase_27 AC 184 ms
6,940 KB
testcase_28 AC 148 ms
6,940 KB
testcase_29 AC 136 ms
6,940 KB
testcase_30 AC 243 ms
7,532 KB
testcase_31 AC 246 ms
7,684 KB
testcase_32 AC 282 ms
8,192 KB
testcase_33 AC 220 ms
7,540 KB
testcase_34 AC 350 ms
8,708 KB
testcase_35 AC 280 ms
7,944 KB
testcase_36 AC 346 ms
8,700 KB
testcase_37 AC 85 ms
6,940 KB
testcase_38 AC 355 ms
8,928 KB
testcase_39 AC 318 ms
8,432 KB
testcase_40 AC 327 ms
8,688 KB
testcase_41 AC 480 ms
9,948 KB
testcase_42 AC 422 ms
9,356 KB
testcase_43 AC 465 ms
9,736 KB
testcase_44 AC 505 ms
12,040 KB
testcase_45 AC 509 ms
12,012 KB
testcase_46 AC 479 ms
9,860 KB
testcase_47 AC 502 ms
11,904 KB
testcase_48 AC 482 ms
12,016 KB
testcase_49 AC 488 ms
11,900 KB
testcase_50 AC 488 ms
11,912 KB
testcase_51 AC 489 ms
12,016 KB
testcase_52 AC 482 ms
12,024 KB
testcase_53 AC 488 ms
11,900 KB
testcase_54 AC 496 ms
11,900 KB
testcase_55 AC 497 ms
11,904 KB
testcase_56 AC 474 ms
9,984 KB
testcase_57 AC 475 ms
9,960 KB
testcase_58 AC 481 ms
12,020 KB
testcase_59 AC 443 ms
9,704 KB
testcase_60 AC 508 ms
11,912 KB
testcase_61 AC 2 ms
6,940 KB
testcase_62 AC 2 ms
6,940 KB
testcase_63 AC 497 ms
11,892 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;

int main() {
  ll n, k; cin >> n >> k;
  unordered_map<ll, ll> dp;
  dp[k] = 1;
  for (; n; --n)
    for (auto [x, y] : unordered_map<ll, ll>(dp))
      if (x >= n) dp[x/n] += y;
  ll ans = -1;
  for (auto [x, y] : dp) if (x) ans += y;
  cout << ans << '\n';
}
0