結果

問題 No.1532 Different Products
ユーザー Mister
提出日時 2021-06-04 20:22:11
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 610 bytes
コンパイル時間 877 ms
コンパイル使用メモリ 78,728 KB
最終ジャッジ日時 2025-01-21 21:56:22
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18 WA * 44
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <map>

using namespace std;
using lint = unsigned long long;

void solve() {
    lint n;
    cin >> n;

    map<lint, lint> dp;
    {
        int k;
        cin >> k;
        dp[k] = 1;
    }

    for (lint x = 1; x <= n; ++x) {
        map<lint, lint> ndp = dp;
        for (auto [k, p] : dp) {
            if (k < x) continue;
            ndp[k / x] += p;
        }
        swap(dp, ndp);
    }

    lint ans = -1;
    for (auto [k, p] : dp) ans += p;
    cout << ans << "\n";
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    solve();

    return 0;
}
0