結果

問題 No.1532 Different Products
ユーザー りあんりあん
提出日時 2021-06-04 20:20:07
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 1,377 ms / 4,000 ms
コード長 606 bytes
コンパイル時間 2,134 ms
コンパイル使用メモリ 208,204 KB
実行使用メモリ 12,200 KB
最終ジャッジ日時 2023-08-12 09:14:40
合計ジャッジ時間 48,922 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
6,536 KB
testcase_01 AC 178 ms
7,992 KB
testcase_02 AC 10 ms
6,420 KB
testcase_03 AC 7 ms
6,424 KB
testcase_04 AC 8 ms
6,576 KB
testcase_05 AC 6 ms
6,540 KB
testcase_06 AC 8 ms
6,428 KB
testcase_07 AC 10 ms
6,544 KB
testcase_08 AC 11 ms
6,660 KB
testcase_09 AC 41 ms
7,460 KB
testcase_10 AC 179 ms
8,556 KB
testcase_11 AC 134 ms
8,548 KB
testcase_12 AC 517 ms
9,844 KB
testcase_13 AC 212 ms
9,304 KB
testcase_14 AC 1,109 ms
11,340 KB
testcase_15 AC 12 ms
6,852 KB
testcase_16 AC 275 ms
7,988 KB
testcase_17 AC 137 ms
8,688 KB
testcase_18 AC 82 ms
8,360 KB
testcase_19 AC 459 ms
10,268 KB
testcase_20 AC 1,063 ms
11,152 KB
testcase_21 AC 385 ms
8,244 KB
testcase_22 AC 251 ms
9,444 KB
testcase_23 AC 110 ms
8,512 KB
testcase_24 AC 964 ms
11,004 KB
testcase_25 AC 484 ms
9,740 KB
testcase_26 AC 55 ms
7,336 KB
testcase_27 AC 530 ms
9,068 KB
testcase_28 AC 343 ms
8,780 KB
testcase_29 AC 379 ms
7,980 KB
testcase_30 AC 722 ms
9,368 KB
testcase_31 AC 714 ms
9,760 KB
testcase_32 AC 813 ms
9,900 KB
testcase_33 AC 632 ms
9,500 KB
testcase_34 AC 952 ms
10,620 KB
testcase_35 AC 812 ms
9,976 KB
testcase_36 AC 966 ms
10,492 KB
testcase_37 AC 227 ms
7,384 KB
testcase_38 AC 985 ms
10,628 KB
testcase_39 AC 902 ms
10,360 KB
testcase_40 AC 906 ms
10,472 KB
testcase_41 AC 1,272 ms
11,744 KB
testcase_42 AC 1,128 ms
11,156 KB
testcase_43 AC 1,166 ms
11,460 KB
testcase_44 AC 1,271 ms
11,852 KB
testcase_45 AC 1,275 ms
11,820 KB
testcase_46 AC 1,259 ms
11,676 KB
testcase_47 AC 1,329 ms
11,960 KB
testcase_48 AC 1,300 ms
11,880 KB
testcase_49 AC 1,304 ms
12,008 KB
testcase_50 AC 1,306 ms
11,816 KB
testcase_51 AC 1,333 ms
12,088 KB
testcase_52 AC 1,284 ms
11,860 KB
testcase_53 AC 1,345 ms
12,200 KB
testcase_54 AC 1,328 ms
12,012 KB
testcase_55 AC 1,319 ms
12,088 KB
testcase_56 AC 1,320 ms
11,876 KB
testcase_57 AC 1,265 ms
11,812 KB
testcase_58 AC 1,377 ms
11,688 KB
testcase_59 AC 1,262 ms
11,556 KB
testcase_60 AC 1,330 ms
11,960 KB
testcase_61 AC 5 ms
6,588 KB
testcase_62 AC 6 ms
6,424 KB
testcase_63 AC 1,318 ms
11,792 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;



int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    int n;
    long long k;
    cin >> n >> k;
    unordered_map<long long, long long> dp;
    dp.reserve(210000);
    dp[k] = 1;
    for (int i = 1; i <= n; ++i) {
        unordered_map<long long, long long> nex = dp;
        for (auto& j : dp) {
            if (j.first >= i) {
                nex[j.first / i] += j.second;
            }
        }
        dp = nex;
    }
    long long ans = 0;
    for (auto& i : dp) {
        ans += i.second;
    }
    cout << ans - 1 << '\n';


    return 0;
}
0