結果
| 問題 | No.639 An Ordinary Sequence |
| コンテスト | |
| ユーザー |
ngtkana
|
| 提出日時 | 2020-04-04 12:53:54 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 447 bytes |
| 記録 | |
| コンパイル時間 | 1,218 ms |
| コンパイル使用メモリ | 220,108 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-09 08:17:18 |
| 合計ジャッジ時間 | 2,425 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 17 |
ソースコード
#include<bits/stdc++.h>
using lint=long long;
using real=long double;
std::map<lint,lint>map;
lint cal(lint x){
if(x==0)return 1;
if(auto it=map.find(x);it!=map.end()){
return it->second;
}
return map[x]=cal(x/3)+cal(x/5);
}
int main(){
std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
std::cout.setf(std::ios_base::fixed);std::cout.precision(15);
lint n;std::cin>>n;
std::cout<<cal(n)<<'\n';
}
ngtkana