結果
問題 | No.1532 Different Products |
ユーザー |
![]() |
提出日時 | 2021-06-04 20:20:07 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 1,171 ms / 4,000 ms |
コード長 | 606 bytes |
コンパイル時間 | 2,053 ms |
コンパイル使用メモリ | 204,012 KB |
最終ジャッジ日時 | 2025-01-21 21:52:55 |
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 62 |
ソースコード
#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; }