結果
| 問題 |
No.639 An Ordinary Sequence
|
| コンテスト | |
| ユーザー |
夕叢霧香(ゆうむらきりか)
|
| 提出日時 | 2018-01-26 23:04:31 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 310 bytes |
| コンパイル時間 | 678 ms |
| コンパイル使用メモリ | 74,580 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2025-01-02 02:09:37 |
| 合計ジャッジ時間 | 1,438 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 17 |
ソースコード
#include<algorithm>
#include<iostream>
#include<map>
using namespace std;
typedef long long lint;
#define rep(i,n)for(int i=0;i<(int)(n);++i)
map<lint,lint>m;
lint f(lint n){
if(m.count(n))return m[n];
lint a=n==0?1:f(n/3)+f(n/5);
return m[n]=a;
}
int main(){
lint n;
cin>>n;
cout<<f(n)<<endl;
}
夕叢霧香(ゆうむらきりか)