結果
問題 |
No.639 An Ordinary Sequence
|
ユーザー |
|
提出日時 | 2020-05-13 11:03:23 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 1,000 ms |
コード長 | 307 bytes |
コンパイル時間 | 2,274 ms |
コンパイル使用メモリ | 197,884 KB |
最終ジャッジ日時 | 2025-01-10 10:46:41 |
ジャッジサーバーID (参考情報) |
judge5 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 17 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<(n);i++) using namespace std; using lint=long long; map<lint,lint> memo; lint dfs(lint n){ if(n==0) return 1; if(memo.count(n)) return memo[n]; return memo[n]=dfs(n/3)+dfs(n/5); } int main(){ lint n; cin>>n; cout<<dfs(n)<<'\n'; return 0; }