結果

問題 No.1532 Different Products
ユーザー だれだれ
提出日時 2021-06-04 21:34:24
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 290 bytes
コンパイル時間 2,300 ms
コンパイル使用メモリ 209,156 KB
実行使用メモリ 171,776 KB
最終ジャッジ日時 2024-04-30 01:53:24
合計ジャッジ時間 13,536 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 536 ms
39,728 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 92 ms
13,184 KB
testcase_10 AC 745 ms
46,800 KB
testcase_11 AC 528 ms
35,524 KB
testcase_12 AC 2,261 ms
110,048 KB
testcase_13 AC 991 ms
53,648 KB
testcase_14 AC 3,828 ms
164,780 KB
testcase_15 AC 7 ms
5,376 KB
testcase_16 AC 685 ms
45,164 KB
testcase_17 AC 544 ms
34,816 KB
testcase_18 AC 322 ms
25,060 KB
testcase_19 AC 2,250 ms
107,100 KB
testcase_20 AC 3,816 ms
167,728 KB
testcase_21 AC 1,032 ms
61,124 KB
testcase_22 AC 1,229 ms
64,112 KB
testcase_23 AC 454 ms
31,580 KB
testcase_24 AC 3,512 ms
156,468 KB
testcase_25 AC 1,776 ms
94,332 KB
testcase_26 AC 112 ms
14,592 KB
testcase_27 AC 1,500 ms
80,020 KB
testcase_28 AC 1,068 ms
63,180 KB
testcase_29 AC 1,011 ms
61,648 KB
testcase_30 AC 2,170 ms
106,788 KB
testcase_31 AC 2,198 ms
107,264 KB
testcase_32 AC 2,635 ms
122,092 KB
testcase_33 AC 1,935 ms
95,984 KB
testcase_34 AC 3,356 ms
145,824 KB
testcase_35 AC 2,448 ms
121,280 KB
testcase_36 AC 3,233 ms
143,472 KB
testcase_37 AC 614 ms
43,136 KB
testcase_38 AC 3,520 ms
151,712 KB
testcase_39 TLE -
testcase_40 AC 2,976 ms
139,644 KB
testcase_41 TLE -
testcase_42 AC 3,894 ms
171,776 KB
testcase_43 TLE -
testcase_44 TLE -
testcase_45 TLE -
testcase_46 TLE -
testcase_47 TLE -
testcase_48 TLE -
testcase_49 TLE -
testcase_50 TLE -
testcase_51 TLE -
testcase_52 TLE -
testcase_53 TLE -
testcase_54 TLE -
testcase_55 TLE -
testcase_56 TLE -
testcase_57 TLE -
testcase_58 TLE -
testcase_59 TLE -
testcase_60 TLE -
testcase_61 AC 2 ms
5,376 KB
testcase_62 AC 2 ms
5,376 KB
testcase_63 TLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:11:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   11 | main(){l n,k;cin>>n>>k;m.resize(n + 1);cout<<f(n, k)-1<<"\n";}
      | ^~~~

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using l=long long;
vector<unordered_map<l,l>> m;
l f(l n,l k){
  if (m[n][k])return m[n][k];
  if (k==0)return 0;
  if (n==1)return m[n][k]=2;
  return m[n][k]=f(n-1,k)+f(n-1,k/n);
}
main(){l n,k;cin>>n>>k;m.resize(n + 1);cout<<f(n, k)-1<<"\n";}
0