結果
問題 | No.1532 Different Products |
ユーザー | kotatsugame |
提出日時 | 2021-06-04 20:31:17 |
言語 | C++17(clang) (17.0.6 + boost 1.83.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 646 bytes |
コンパイル時間 | 1,659 ms |
コンパイル使用メモリ | 130,488 KB |
実行使用メモリ | 19,916 KB |
最終ジャッジ日時 | 2024-04-29 23:57:12 |
合計ジャッジ時間 | 10,628 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | AC | 1,370 ms
19,788 KB |
testcase_02 | AC | 8 ms
5,376 KB |
testcase_03 | AC | 2 ms
5,376 KB |
testcase_04 | AC | 1 ms
5,376 KB |
testcase_05 | AC | 2 ms
5,376 KB |
testcase_06 | AC | 2 ms
5,376 KB |
testcase_07 | AC | 11 ms
5,376 KB |
testcase_08 | AC | 41 ms
5,376 KB |
testcase_09 | AC | 358 ms
19,788 KB |
testcase_10 | AC | 842 ms
19,916 KB |
testcase_11 | AC | 570 ms
19,664 KB |
testcase_12 | TLE | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
testcase_24 | -- | - |
testcase_25 | -- | - |
testcase_26 | -- | - |
testcase_27 | -- | - |
testcase_28 | -- | - |
testcase_29 | -- | - |
testcase_30 | -- | - |
testcase_31 | -- | - |
testcase_32 | -- | - |
testcase_33 | -- | - |
testcase_34 | -- | - |
testcase_35 | -- | - |
testcase_36 | -- | - |
testcase_37 | -- | - |
testcase_38 | -- | - |
testcase_39 | -- | - |
testcase_40 | -- | - |
testcase_41 | -- | - |
testcase_42 | -- | - |
testcase_43 | -- | - |
testcase_44 | -- | - |
testcase_45 | -- | - |
testcase_46 | -- | - |
testcase_47 | -- | - |
testcase_48 | -- | - |
testcase_49 | -- | - |
testcase_50 | -- | - |
testcase_51 | -- | - |
testcase_52 | -- | - |
testcase_53 | -- | - |
testcase_54 | -- | - |
testcase_55 | -- | - |
testcase_56 | -- | - |
testcase_57 | -- | - |
testcase_58 | -- | - |
testcase_59 | -- | - |
testcase_60 | -- | - |
testcase_61 | -- | - |
testcase_62 | -- | - |
testcase_63 | -- | - |
ソースコード
#include<iostream> #include<vector> #include<algorithm> using namespace std; int N; long K; const int LIM=23; long ans; vector<long>P; void f(long k,int n) { if(k==0)return; ans+=upper_bound(P.begin(),P.end(),k)-P.begin(); for(int m=min((long)n,k);m>LIM;m--) { f(k/m,m-1); } } int main() { cin>>N>>K; if(N<=LIM) { for(int i=1;i<1<<N;i++) { long t=1; for(int j=0;t<=K&&j<N;j++)if(i>>j&1)t*=j+1; if(t<=K)ans++; } cout<<ans<<endl; return 0; } for(int i=0;i<1<<LIM;i++) { long t=1; for(int j=0;t<=K&&j<LIM;j++)if(i>>j&1)t*=j+1; if(t<=K)P.push_back(t); } sort(P.begin(),P.end()); f(K,N); cout<<ans-1<<endl; }