結果

問題 No.1532 Different Products
ユーザー optopt
提出日時 2021-06-05 11:14:18
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,249 ms / 4,000 ms
コード長 496 bytes
コンパイル時間 2,254 ms
コンパイル使用メモリ 210,424 KB
実行使用メモリ 12,028 KB
最終ジャッジ日時 2024-05-01 06:04:51
合計ジャッジ時間 43,979 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 149 ms
6,940 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 3 ms
6,940 KB
testcase_08 AC 3 ms
6,944 KB
testcase_09 AC 28 ms
6,944 KB
testcase_10 AC 156 ms
6,940 KB
testcase_11 AC 110 ms
6,940 KB
testcase_12 AC 463 ms
8,176 KB
testcase_13 AC 196 ms
7,552 KB
testcase_14 AC 1,019 ms
9,288 KB
testcase_15 AC 3 ms
6,940 KB
testcase_16 AC 234 ms
6,940 KB
testcase_17 AC 118 ms
6,940 KB
testcase_18 AC 65 ms
6,944 KB
testcase_19 AC 404 ms
8,180 KB
testcase_20 AC 982 ms
9,300 KB
testcase_21 AC 347 ms
6,940 KB
testcase_22 AC 238 ms
7,708 KB
testcase_23 AC 90 ms
6,940 KB
testcase_24 AC 901 ms
9,216 KB
testcase_25 AC 439 ms
7,668 KB
testcase_26 AC 37 ms
6,944 KB
testcase_27 AC 495 ms
6,940 KB
testcase_28 AC 303 ms
6,940 KB
testcase_29 AC 320 ms
6,944 KB
testcase_30 AC 644 ms
7,656 KB
testcase_31 AC 645 ms
7,804 KB
testcase_32 AC 728 ms
8,176 KB
testcase_33 AC 600 ms
7,560 KB
testcase_34 AC 875 ms
8,700 KB
testcase_35 AC 737 ms
8,076 KB
testcase_36 AC 891 ms
8,784 KB
testcase_37 AC 174 ms
6,940 KB
testcase_38 AC 911 ms
8,872 KB
testcase_39 AC 829 ms
8,436 KB
testcase_40 AC 849 ms
8,560 KB
testcase_41 AC 1,198 ms
9,952 KB
testcase_42 AC 1,061 ms
9,336 KB
testcase_43 AC 1,094 ms
9,616 KB
testcase_44 AC 1,233 ms
12,004 KB
testcase_45 AC 1,241 ms
11,888 KB
testcase_46 AC 1,209 ms
9,968 KB
testcase_47 AC 1,241 ms
12,000 KB
testcase_48 AC 1,244 ms
11,888 KB
testcase_49 AC 1,233 ms
11,908 KB
testcase_50 AC 1,201 ms
12,004 KB
testcase_51 AC 1,249 ms
11,924 KB
testcase_52 AC 1,222 ms
11,880 KB
testcase_53 AC 1,225 ms
11,876 KB
testcase_54 AC 1,235 ms
12,016 KB
testcase_55 AC 1,200 ms
11,904 KB
testcase_56 AC 1,186 ms
9,840 KB
testcase_57 AC 1,196 ms
9,904 KB
testcase_58 AC 1,216 ms
11,900 KB
testcase_59 AC 1,130 ms
9,740 KB
testcase_60 AC 1,231 ms
12,028 KB
testcase_61 AC 2 ms
6,944 KB
testcase_62 AC 2 ms
6,944 KB
testcase_63 AC 1,219 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;
  rep(i, 1, n+1) {
    unordered_map<ll, ll> tmp(dp);
    for (auto [x, y] : tmp) if (x >= i) dp[x/i] += y;
  }
  ll ans = -1;
  for (auto [x, y] : dp) if (x) ans += y;
  cout << ans << '\n';
}
0