結果
問題 |
No.1532 Different Products
|
ユーザー |
![]() |
提出日時 | 2021-06-04 23:46:39 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 323 bytes |
コンパイル時間 | 2,379 ms |
コンパイル使用メモリ | 199,992 KB |
最終ジャッジ日時 | 2025-01-22 03:23:39 |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 31 TLE * 31 |
ソースコード
#include<bits/stdc++.h> using ll = long long; std::map<ll, ll> memo[202]; ll dp(int n, ll k) { if (k == 0) return 0; if (n == 0) return 1; if (memo[n].count(k)) return memo[n][k]; return memo[n][k] = dp(n-1, k) + dp(n-1, k/n); } int main() { ll n, k; std::cin >> n >> k; std::cout << (dp(n, k) - 1) << '\n'; }