結果

問題 No.1532 Different Products
ユーザー asaringoasaringo
提出日時 2021-06-05 15:20:07
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,192 ms / 4,000 ms
コード長 564 bytes
コンパイル時間 1,733 ms
コンパイル使用メモリ 176,232 KB
実行使用メモリ 14,464 KB
最終ジャッジ日時 2024-05-01 09:44:11
合計ジャッジ時間 37,744 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 128 ms
6,940 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 3 ms
6,944 KB
testcase_08 AC 5 ms
6,944 KB
testcase_09 AC 39 ms
6,944 KB
testcase_10 AC 162 ms
7,552 KB
testcase_11 AC 120 ms
7,040 KB
testcase_12 AC 429 ms
10,368 KB
testcase_13 AC 194 ms
9,472 KB
testcase_14 AC 748 ms
12,800 KB
testcase_15 AC 7 ms
6,944 KB
testcase_16 AC 147 ms
6,944 KB
testcase_17 AC 120 ms
7,552 KB
testcase_18 AC 82 ms
7,168 KB
testcase_19 AC 498 ms
10,496 KB
testcase_20 AC 955 ms
13,056 KB
testcase_21 AC 214 ms
7,424 KB
testcase_22 AC 270 ms
9,088 KB
testcase_23 AC 112 ms
7,808 KB
testcase_24 AC 888 ms
12,544 KB
testcase_25 AC 415 ms
9,600 KB
testcase_26 AC 42 ms
6,940 KB
testcase_27 AC 301 ms
8,448 KB
testcase_28 AC 231 ms
7,808 KB
testcase_29 AC 202 ms
6,940 KB
testcase_30 AC 452 ms
9,472 KB
testcase_31 AC 406 ms
9,600 KB
testcase_32 AC 558 ms
10,368 KB
testcase_33 AC 385 ms
8,960 KB
testcase_34 AC 585 ms
11,648 KB
testcase_35 AC 586 ms
10,240 KB
testcase_36 AC 708 ms
11,648 KB
testcase_37 AC 122 ms
6,940 KB
testcase_38 AC 719 ms
12,032 KB
testcase_39 AC 693 ms
11,264 KB
testcase_40 AC 560 ms
11,392 KB
testcase_41 AC 1,059 ms
14,208 KB
testcase_42 AC 976 ms
12,928 KB
testcase_43 AC 993 ms
13,440 KB
testcase_44 AC 1,147 ms
14,080 KB
testcase_45 AC 1,192 ms
14,208 KB
testcase_46 AC 1,149 ms
13,952 KB
testcase_47 AC 1,182 ms
14,464 KB
testcase_48 AC 1,151 ms
14,208 KB
testcase_49 AC 1,136 ms
14,336 KB
testcase_50 AC 1,022 ms
14,336 KB
testcase_51 AC 991 ms
14,336 KB
testcase_52 AC 1,041 ms
14,208 KB
testcase_53 AC 989 ms
14,336 KB
testcase_54 AC 1,052 ms
14,080 KB
testcase_55 AC 1,059 ms
14,336 KB
testcase_56 AC 996 ms
13,952 KB
testcase_57 AC 1,000 ms
14,080 KB
testcase_58 AC 1,069 ms
14,080 KB
testcase_59 AC 1,030 ms
13,696 KB
testcase_60 AC 1,049 ms
14,464 KB
testcase_61 AC 2 ms
6,940 KB
testcase_62 AC 2 ms
6,940 KB
testcase_63 AC 1,011 ms
14,336 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std ;
typedef long long ll ;
#define rep(i,n) for(int i = 0 ; i < n ; i++)
#define rrep(i,a,b) for(int i = a ; i < b ; i++)

int main() {
    ll n, k ;
    cin >> n >> k ;
    map<ll, ll> dp ;
    dp[k] = 1 ;
    for(int i = n ; i > 0 ; i--)
        for (auto it : map<ll, ll>(dp)){
            ll x = it.first , y = it.second ;
            if (x >= i) dp[x/i] += y ;
        }
    ll ans = -1 ;
    for (auto it : dp){
        ll x = it.first , y = it.second ; 
        if (x) ans += y ;
    }
    cout << ans << endl ;
}
0