結果

問題 No.1532 Different Products
ユーザー HaaHaa
提出日時 2021-06-04 21:19:46
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,058 bytes
コンパイル時間 1,765 ms
コンパイル使用メモリ 176,968 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-04-30 01:29:12
合計ジャッジ時間 98,813 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 199 ms
5,376 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 3 ms
5,376 KB
testcase_09 AC 26 ms
5,376 KB
testcase_10 AC 183 ms
5,376 KB
testcase_11 AC 119 ms
5,376 KB
testcase_12 AC 991 ms
5,376 KB
testcase_13 AC 228 ms
5,376 KB
testcase_14 AC 3,590 ms
5,376 KB
testcase_15 AC 5 ms
5,376 KB
testcase_16 AC 461 ms
5,376 KB
testcase_17 AC 122 ms
5,376 KB
testcase_18 AC 66 ms
5,376 KB
testcase_19 AC 784 ms
5,376 KB
testcase_20 AC 3,237 ms
5,376 KB
testcase_21 AC 788 ms
5,376 KB
testcase_22 AC 302 ms
5,376 KB
testcase_23 AC 93 ms
5,376 KB
testcase_24 AC 2,801 ms
5,376 KB
testcase_25 AC 990 ms
5,376 KB
testcase_26 AC 31 ms
5,376 KB
testcase_27 AC 1,307 ms
5,376 KB
testcase_28 AC 603 ms
5,376 KB
testcase_29 AC 835 ms
5,376 KB
testcase_30 AC 2,104 ms
5,376 KB
testcase_31 AC 2,039 ms
5,376 KB
testcase_32 AC 2,456 ms
5,376 KB
testcase_33 AC 1,740 ms
5,376 KB
testcase_34 AC 2,894 ms
5,376 KB
testcase_35 AC 2,386 ms
5,376 KB
testcase_36 AC 3,049 ms
5,376 KB
testcase_37 AC 394 ms
5,376 KB
testcase_38 AC 3,124 ms
5,376 KB
testcase_39 AC 2,711 ms
5,376 KB
testcase_40 AC 2,743 ms
5,376 KB
testcase_41 TLE -
testcase_42 AC 3,666 ms
5,376 KB
testcase_43 AC 3,802 ms
5,376 KB
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 -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> P;
typedef vector<ll> VI;
typedef vector<VI> VVI;
#define REP(i,n) for(ll i=0;i<(n);i++)
#define ALL(v) v.begin(),v.end()
constexpr ll MOD=998244353;
constexpr ll INF=2e18;

int main(){
    ll n, k; cin >> n >> k;
    unordered_map<ll,ll> mp; mp[1]=1;
    ll ans=0;
    for(ll i=1;i<=n;i++){
        unordered_map<ll,ll> nxmp;
        for(auto p:mp){
            if(p.first*i*(i+1)*(i+2)<=k){
                nxmp[p.first]+=p.second;
                nxmp[p.first*i]+=p.second;
            }
            else{
                ans+=p.second;
                for(ll j=i;j<=n;j++){
                    if(p.first*j<=k)
                        ans+=p.second;
                }
                for(ll j=i;j<=n;j++)for(ll l=j+1;l<=n;l++){
                    if(p.first*j*l<=k)
                        ans+=p.second;
                }
            }
        }
        mp=nxmp;
    }
    for(auto p:mp){
        ans+=p.second;
    }
    cout << ans-1 << endl;
    return 0;
}
0