結果
| 問題 |
No.1532 Different Products
|
| コンテスト | |
| ユーザー |
shakayami
|
| 提出日時 | 2021-06-04 21:15:11 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 487 bytes |
| コンパイル時間 | 2,023 ms |
| コンパイル使用メモリ | 200,268 KB |
| 最終ジャッジ日時 | 2025-01-21 23:29:14 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 WA * 44 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
map<int,ull> memo[210];
ull solve(int N,int K){
if (memo[N].find(K)!=memo[N].end()){
return memo[N][K];
}
if (N==0){
if (K==0){
return 0ull;
}
else{
return 1ull;
}
}
ull res=solve(N-1,K)+solve(N-1,K/N);
memo[N][K]=res;
return res;
}
int main(void){
int N,K;
cin>>N>>K;
cout<<(solve(N,K)-1ull)<<endl;
}
shakayami