結果

問題 No.1532 Different Products
ユーザー optopt
提出日時 2021-06-05 13:47:56
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 3,865 ms / 4,000 ms
コード長 487 bytes
コンパイル時間 3,194 ms
コンパイル使用メモリ 225,980 KB
実行使用メモリ 199,576 KB
最終ジャッジ日時 2024-05-03 19:03:47
合計ジャッジ時間 100,784 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 341 ms
39,716 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 3 ms
5,376 KB
testcase_08 AC 5 ms
5,376 KB
testcase_09 AC 63 ms
13,056 KB
testcase_10 AC 455 ms
46,664 KB
testcase_11 AC 300 ms
35,524 KB
testcase_12 AC 1,427 ms
110,036 KB
testcase_13 AC 577 ms
53,772 KB
testcase_14 AC 2,400 ms
164,492 KB
testcase_15 AC 7 ms
5,376 KB
testcase_16 AC 418 ms
44,800 KB
testcase_17 AC 310 ms
34,816 KB
testcase_18 AC 179 ms
25,188 KB
testcase_19 AC 1,432 ms
106,956 KB
testcase_20 AC 2,380 ms
167,704 KB
testcase_21 AC 677 ms
61,104 KB
testcase_22 AC 713 ms
63,972 KB
testcase_23 AC 246 ms
31,316 KB
testcase_24 AC 2,161 ms
156,444 KB
testcase_25 AC 1,139 ms
94,320 KB
testcase_26 AC 78 ms
14,592 KB
testcase_27 AC 908 ms
79,872 KB
testcase_28 AC 677 ms
63,032 KB
testcase_29 AC 688 ms
61,628 KB
testcase_30 AC 1,388 ms
106,516 KB
testcase_31 AC 1,360 ms
107,252 KB
testcase_32 AC 1,596 ms
122,076 KB
testcase_33 AC 1,229 ms
95,840 KB
testcase_34 AC 2,077 ms
145,536 KB
testcase_35 AC 1,597 ms
121,012 KB
testcase_36 AC 2,018 ms
143,456 KB
testcase_37 AC 377 ms
43,008 KB
testcase_38 AC 2,174 ms
151,840 KB
testcase_39 AC 1,895 ms
136,684 KB
testcase_40 AC 1,930 ms
139,496 KB
testcase_41 AC 2,788 ms
191,012 KB
testcase_42 AC 2,469 ms
171,740 KB
testcase_43 AC 2,582 ms
178,784 KB
testcase_44 AC 3,865 ms
195,604 KB
testcase_45 AC 2,900 ms
196,532 KB
testcase_46 AC 2,721 ms
188,452 KB
testcase_47 AC 2,973 ms
198,812 KB
testcase_48 AC 2,885 ms
196,376 KB
testcase_49 AC 3,036 ms
196,988 KB
testcase_50 AC 2,959 ms
195,408 KB
testcase_51 AC 2,908 ms
198,396 KB
testcase_52 AC 2,828 ms
193,032 KB
testcase_53 AC 2,925 ms
198,736 KB
testcase_54 AC 2,820 ms
192,840 KB
testcase_55 AC 2,876 ms
196,824 KB
testcase_56 AC 2,802 ms
188,252 KB
testcase_57 AC 2,830 ms
189,720 KB
testcase_58 AC 2,862 ms
194,988 KB
testcase_59 AC 2,703 ms
183,004 KB
testcase_60 AC 2,901 ms
199,576 KB
testcase_61 AC 2 ms
5,376 KB
testcase_62 AC 2 ms
5,376 KB
testcase_63 AC 2,997 ms
196,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("popcnt,bmi2,fma,fma4,avx512f,avx512dq,avx512cd,avx512bw,avx512vl")
#include<bits/stdc++.h>
using ll = long long;

std::unordered_map<ll, ll> memo[202];
ll dp(int n, ll k) {
  if (k == 0) return 0;
  if (n == 0) return 1;
  if (memo[n].count(k)) return memo[n][k];
  return memo[n][k] = dp(n-1, k) + dp(n-1, k/n);
}

int main() {
  ll n, k; std::cin >> n >> k;
  std::cout << (dp(n, k) - 1) << '\n';
}
0