結果

問題 No.639 An Ordinary Sequence
ユーザー okchan08
提出日時 2018-04-05 18:54:03
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 297 bytes
コンパイル時間 767 ms
コンパイル使用メモリ 70,344 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2025-01-02 02:25:01
合計ジャッジ時間 1,273 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <map>

using namespace std;


map<long long, long long> mp;

long long func(long long N){
    if(mp.find(N) != mp.end()) return mp[N];
    return mp[N] = func(N/3) + func(N/5);
}

int main(){
    mp[0] = 1;
    long long N;
    cin >> N;
    cout << func(N) << endl;
}
0