結果
| 問題 |
No.1532 Different Products
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-06-04 20:20:40 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 599 bytes |
| コンパイル時間 | 686 ms |
| コンパイル使用メモリ | 78,592 KB |
| 最終ジャッジ日時 | 2025-01-21 21:54:23 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 WA * 44 |
ソースコード
#include <iostream>
#include <map>
using namespace std;
using lint = long long;
void solve() {
int n;
cin >> n;
map<lint, lint> dp;
{
int k;
cin >> k;
dp[k] = 1;
}
for (int 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;
}