結果

問題 No.639 An Ordinary Sequence
ユーザー SSRS
提出日時 2020-11-10 16:01:41
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 307 bytes
コンパイル時間 749 ms
コンパイル使用メモリ 75,136 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-22 17:32:31
合計ジャッジ時間 1,384 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2
other WA * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <map>
using namespace std;
map<long long, long long> mp;
long long a(long long N){
	if (mp.count(N)){
		return mp[N];
	}
	if (N == 0){
		return 0;
	}
	long long ans = a(N / 3) + a(N / 5);
	mp[N] = ans;
	return ans;
}
int main(){
	long long N;
	cin >> N;
	cout << a(N) << endl;
}
0