結果

問題 No.1532 Different Products
ユーザー 👑 emthrmemthrm
提出日時 2021-06-08 12:16:18
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 738 ms / 4,000 ms
コード長 1,308 bytes
コンパイル時間 1,993 ms
コンパイル使用メモリ 211,136 KB
実行使用メモリ 10,704 KB
最終ジャッジ日時 2023-08-17 15:04:41
合計ジャッジ時間 26,321 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 67 ms
5,080 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 14 ms
4,380 KB
testcase_10 AC 80 ms
6,048 KB
testcase_11 AC 49 ms
5,376 KB
testcase_12 AC 226 ms
7,536 KB
testcase_13 AC 102 ms
6,992 KB
testcase_14 AC 538 ms
9,116 KB
testcase_15 AC 3 ms
4,380 KB
testcase_16 AC 101 ms
5,184 KB
testcase_17 AC 54 ms
5,336 KB
testcase_18 AC 35 ms
5,352 KB
testcase_19 AC 201 ms
7,484 KB
testcase_20 AC 520 ms
9,192 KB
testcase_21 AC 161 ms
5,416 KB
testcase_22 AC 120 ms
6,856 KB
testcase_23 AC 47 ms
6,172 KB
testcase_24 AC 477 ms
9,160 KB
testcase_25 AC 212 ms
7,264 KB
testcase_26 AC 19 ms
4,376 KB
testcase_27 AC 266 ms
6,112 KB
testcase_28 AC 155 ms
6,144 KB
testcase_29 AC 138 ms
5,296 KB
testcase_30 AC 304 ms
6,972 KB
testcase_31 AC 304 ms
7,184 KB
testcase_32 AC 356 ms
7,256 KB
testcase_33 AC 291 ms
7,032 KB
testcase_34 AC 429 ms
8,912 KB
testcase_35 AC 346 ms
7,420 KB
testcase_36 AC 440 ms
7,800 KB
testcase_37 AC 81 ms
4,384 KB
testcase_38 AC 468 ms
8,956 KB
testcase_39 AC 406 ms
7,684 KB
testcase_40 AC 418 ms
7,744 KB
testcase_41 AC 738 ms
9,756 KB
testcase_42 AC 561 ms
9,424 KB
testcase_43 AC 594 ms
9,692 KB
testcase_44 AC 649 ms
10,656 KB
testcase_45 AC 657 ms
10,584 KB
testcase_46 AC 641 ms
9,808 KB
testcase_47 AC 658 ms
10,496 KB
testcase_48 AC 661 ms
10,624 KB
testcase_49 AC 658 ms
10,516 KB
testcase_50 AC 655 ms
10,704 KB
testcase_51 AC 675 ms
10,612 KB
testcase_52 AC 656 ms
10,652 KB
testcase_53 AC 659 ms
10,496 KB
testcase_54 AC 670 ms
10,540 KB
testcase_55 AC 649 ms
10,656 KB
testcase_56 AC 656 ms
9,828 KB
testcase_57 AC 660 ms
9,928 KB
testcase_58 AC 666 ms
10,540 KB
testcase_59 AC 617 ms
9,624 KB
testcase_60 AC 662 ms
10,496 KB
testcase_61 AC 1 ms
4,380 KB
testcase_62 AC 2 ms
4,380 KB
testcase_63 AC 664 ms
10,532 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
using ll = long long;
constexpr int INF = 0x3f3f3f3f;
constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr double EPS = 1e-8;
constexpr int MOD = 1000000007;
// constexpr int MOD = 998244353;
constexpr int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1};
constexpr int dy8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dx8[] = {0, -1, -1, -1, 0, 1, 1, 1};
template <typename T, typename U> inline bool chmax(T &a, U b) { return a < b ? (a = b, true) : false; }
template <typename T, typename U> inline bool chmin(T &a, U b) { return a > b ? (a = b, true) : false; }
struct IOSetup {
  IOSetup() {
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    std::cout << fixed << setprecision(20);
  }
} iosetup;

// https://my.oschina.net/u/4305576/blog/3668964
int main() {
  int n; ll k; cin >> n >> k;
  unordered_map<ll, ll> dp{{k, 1}};
  for (int i = 1; i <= n; ++i) {
    vector<pair<ll, ll>> v;
    for (auto [m, pat] : dp) {
      if (m >= i) v.emplace_back(m / i, pat);
    }
    for (auto [m, pat] : v) dp[m] += pat;
  }
  ll ans = 0;
  for (auto [_, pat] : dp) ans += pat;
  cout << ans - 1 << '\n';
  return 0;
}
0