結果
| 問題 |
No.1532 Different Products
|
| コンテスト | |
| ユーザー |
りあん
|
| 提出日時 | 2021-06-04 20:19:35 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 594 bytes |
| コンパイル時間 | 2,145 ms |
| コンパイル使用メモリ | 203,556 KB |
| 最終ジャッジ日時 | 2025-01-21 21:50:56 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 24 WA * 38 |
ソースコード
#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, int> dp;
dp.reserve(210000);
dp[k] = 1;
for (int i = 1; i <= n; ++i) {
unordered_map<long long, int> 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;
}
りあん