結果

問題 No.1532 Different Products
ユーザー kwm_tkwm_t
提出日時 2021-06-06 01:50:45
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,605 ms / 4,000 ms
コード長 1,251 bytes
コンパイル時間 1,609 ms
コンパイル使用メモリ 177,736 KB
実行使用メモリ 14,464 KB
最終ジャッジ日時 2024-05-01 20:11:16
合計ジャッジ時間 53,532 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 181 ms
6,944 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,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 3 ms
6,944 KB
testcase_08 AC 4 ms
6,940 KB
testcase_09 AC 34 ms
6,944 KB
testcase_10 AC 184 ms
7,552 KB
testcase_11 AC 134 ms
7,040 KB
testcase_12 AC 579 ms
10,368 KB
testcase_13 AC 226 ms
9,472 KB
testcase_14 AC 1,340 ms
12,672 KB
testcase_15 AC 5 ms
6,944 KB
testcase_16 AC 284 ms
6,940 KB
testcase_17 AC 136 ms
7,296 KB
testcase_18 AC 77 ms
6,944 KB
testcase_19 AC 499 ms
10,496 KB
testcase_20 AC 1,275 ms
13,056 KB
testcase_21 AC 426 ms
7,296 KB
testcase_22 AC 268 ms
8,832 KB
testcase_23 AC 104 ms
7,680 KB
testcase_24 AC 1,119 ms
12,544 KB
testcase_25 AC 552 ms
9,600 KB
testcase_26 AC 46 ms
6,940 KB
testcase_27 AC 585 ms
8,192 KB
testcase_28 AC 378 ms
7,936 KB
testcase_29 AC 403 ms
6,940 KB
testcase_30 AC 819 ms
9,472 KB
testcase_31 AC 822 ms
9,472 KB
testcase_32 AC 935 ms
10,240 KB
testcase_33 AC 740 ms
9,088 KB
testcase_34 AC 1,107 ms
11,776 KB
testcase_35 AC 958 ms
10,240 KB
testcase_36 AC 1,123 ms
11,520 KB
testcase_37 AC 218 ms
6,940 KB
testcase_38 AC 1,197 ms
12,032 KB
testcase_39 AC 1,021 ms
11,136 KB
testcase_40 AC 1,047 ms
11,264 KB
testcase_41 AC 1,541 ms
13,952 KB
testcase_42 AC 1,328 ms
13,056 KB
testcase_43 AC 1,352 ms
13,440 KB
testcase_44 AC 1,521 ms
14,336 KB
testcase_45 AC 1,547 ms
14,336 KB
testcase_46 AC 1,460 ms
13,824 KB
testcase_47 AC 1,523 ms
14,208 KB
testcase_48 AC 1,509 ms
14,208 KB
testcase_49 AC 1,605 ms
14,208 KB
testcase_50 AC 1,508 ms
14,208 KB
testcase_51 AC 1,493 ms
14,336 KB
testcase_52 AC 1,534 ms
14,080 KB
testcase_53 AC 1,532 ms
14,336 KB
testcase_54 AC 1,495 ms
13,952 KB
testcase_55 AC 1,555 ms
14,208 KB
testcase_56 AC 1,476 ms
13,952 KB
testcase_57 AC 1,531 ms
14,080 KB
testcase_58 AC 1,460 ms
14,208 KB
testcase_59 AC 1,404 ms
13,568 KB
testcase_60 AC 1,506 ms
14,464 KB
testcase_61 AC 2 ms
6,940 KB
testcase_62 AC 2 ms
6,944 KB
testcase_63 AC 1,520 ms
14,336 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
//#include "atcoder/all"
using namespace std;
//using namespace atcoder;
//using mint = modint1000000007;
//const int mod = 1000000007;
//using mint = modint998244353;
//const int mod = 998244353;
//const int INF = 1e9;
//const long long LINF = 1e18;
//const bool debug = false;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep2(i,l,r)for(int i=(l);i<(r);++i)
#define rrep(i, n) for (int i = (n-1); i >= 0; --i)
#define rrep2(i,l,r)for(int i=(r-1);i>=(l);--i)
#define all(x) (x).begin(),(x).end()
#define allR(x) (x).rbegin(),(x).rend()
#define endl "\n"
#define P pair<int,int>
template<typename A, typename B> inline bool chmax(A & a, const B & b) { if (a < b) { a = b; return true; } return false; }
template<typename A, typename B> inline bool chmin(A & a, const B & b) { if (a > b) { a = b; return true; } return false; }

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	long long n, k; cin >> n >> k;
	map<long long, long long>mp;
	mp[k] = 1;
	rep2(i, 1, n + 1) {
		map<long long, long long>cmp = mp;
		for (auto p : mp) {
			if (p.first >= i)cmp[p.first / i] += p.second;
		}
		swap(mp, cmp);
	}
	long long ans = 0;
	for (auto p : mp)ans += p.second;
	ans--;
	cout << ans << endl;
	return 0;
}
0