結果

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = unsigned long long;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)

void solve() {
    ll n, k;
    cin >> n >> k;
    auto dfs = [&](auto dfs, ll i, ll p) -> ll {
        ll prod = p * i;
        ll res = 1;
        rep(j, i+1, n+1) {
            if(prod * j > k) break;
            res += dfs(dfs, j, prod);
        }
        return res;
    };
    ll ans = 0;
    rep(i, 1, n+1) ans += dfs(dfs, i, 1);
    cout << ans << endl;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    solve();
    return 0;
}
0