結果

問題 No.1532 Different Products
ユーザー shakayamishakayami
提出日時 2021-06-04 20:45:26
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 481 bytes
コンパイル時間 2,089 ms
コンパイル使用メモリ 198,280 KB
最終ジャッジ日時 2025-01-21 22:27:47
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2
other WA * 62
権限があれば一括ダウンロードができます

ソースコード

diff #

#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==1){
        if (K==0){
            return 0ull;
        }
        else{
            return 2ull;
        }
    }
    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)<<endl;
}
0