結果

問題 No.1532 Different Products
ユーザー uzzyuzzy
提出日時 2021-06-04 23:12:01
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 3,623 ms / 4,000 ms
コード長 988 bytes
コンパイル時間 2,827 ms
コンパイル使用メモリ 191,696 KB
実行使用メモリ 199,608 KB
最終ジャッジ日時 2024-04-30 11:58:30
合計ジャッジ時間 121,686 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 506 ms
39,832 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,944 KB
testcase_07 AC 3 ms
6,940 KB
testcase_08 AC 5 ms
6,944 KB
testcase_09 AC 95 ms
13,184 KB
testcase_10 AC 660 ms
46,536 KB
testcase_11 AC 462 ms
35,532 KB
testcase_12 AC 1,819 ms
110,068 KB
testcase_13 AC 826 ms
53,636 KB
testcase_14 AC 2,866 ms
164,616 KB
testcase_15 AC 8 ms
6,944 KB
testcase_16 AC 591 ms
44,860 KB
testcase_17 AC 442 ms
34,776 KB
testcase_18 AC 284 ms
25,140 KB
testcase_19 AC 1,763 ms
107,052 KB
testcase_20 AC 2,967 ms
167,676 KB
testcase_21 AC 919 ms
61,008 KB
testcase_22 AC 1,011 ms
63,992 KB
testcase_23 AC 397 ms
31,388 KB
testcase_24 AC 2,732 ms
156,464 KB
testcase_25 AC 1,501 ms
94,552 KB
testcase_26 AC 118 ms
14,592 KB
testcase_27 AC 1,241 ms
79,908 KB
testcase_28 AC 891 ms
63,120 KB
testcase_29 AC 950 ms
61,692 KB
testcase_30 AC 1,799 ms
106,664 KB
testcase_31 AC 1,798 ms
107,160 KB
testcase_32 AC 2,076 ms
121,964 KB
testcase_33 AC 1,562 ms
95,960 KB
testcase_34 AC 2,499 ms
145,748 KB
testcase_35 AC 2,015 ms
120,904 KB
testcase_36 AC 2,469 ms
143,392 KB
testcase_37 AC 544 ms
43,008 KB
testcase_38 AC 2,578 ms
151,612 KB
testcase_39 AC 2,284 ms
136,644 KB
testcase_40 AC 2,374 ms
139,456 KB
testcase_41 AC 3,342 ms
190,700 KB
testcase_42 AC 2,967 ms
171,692 KB
testcase_43 AC 3,132 ms
178,912 KB
testcase_44 AC 3,478 ms
195,360 KB
testcase_45 AC 3,536 ms
197,020 KB
testcase_46 AC 3,340 ms
188,300 KB
testcase_47 AC 3,623 ms
199,140 KB
testcase_48 AC 3,551 ms
196,984 KB
testcase_49 AC 3,549 ms
196,996 KB
testcase_50 AC 3,477 ms
195,432 KB
testcase_51 AC 3,498 ms
198,992 KB
testcase_52 AC 3,448 ms
193,308 KB
testcase_53 AC 3,615 ms
199,164 KB
testcase_54 AC 3,438 ms
193,352 KB
testcase_55 AC 3,573 ms
197,036 KB
testcase_56 AC 3,346 ms
188,056 KB
testcase_57 AC 3,345 ms
189,676 KB
testcase_58 AC 3,361 ms
195,380 KB
testcase_59 AC 3,208 ms
183,064 KB
testcase_60 AC 3,528 ms
199,608 KB
testcase_61 AC 2 ms
6,944 KB
testcase_62 AC 2 ms
6,940 KB
testcase_63 AC 3,509 ms
197,084 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize ("O2")
#pragma GCC target ("avx")
#include<bits/stdc++.h>
//#include<atcoder/all>
//using namespace atcoder;

using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

unordered_map<ll, ll> memo[201];
ll keisan(ll N, ll K) {
	if (N == 0) return 1;
	if (memo[N].find(K) != memo[N].end()) {
		return memo[N][K];
	}
	ll ret = 0;
	if (K >= N) {
		ret += keisan(N - 1, K / N);
	}
	ret += keisan(N - 1, K);

	memo[N][K] = ret;
	return ret;
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);


	ll N, K;
	cin >> N >> K;

	ll kotae = keisan(N, K);

	co(kotae - 1);


	Would you please return 0;
}
0