結果
| 問題 | No.639 An Ordinary Sequence | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2019-10-12 14:08:55 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 1,000 ms | 
| コード長 | 222 bytes | 
| コンパイル時間 | 678 ms | 
| コンパイル使用メモリ | 72,792 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2025-01-02 02:47:10 | 
| 合計ジャッジ時間 | 1,478 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 17 | 
コンパイルメッセージ
main.cpp:11:1: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
   11 | main()
      | ^~~~
            
            ソースコード
#include<iostream>
#include<map>
using namespace std;
map<long,long>M;
long f(long N)
{
	if(N==0)return 1;
	if(M.find(N)!=M.end())return M[N];
	else return M[N]=f(N/3)+f(N/5);
}
main()
{
	long N;cin>>N;cout<<f(N)<<endl;
}
            
            
            
        