結果
問題 | No.639 An Ordinary Sequence |
ユーザー |
![]() |
提出日時 | 2020-07-10 23:09:38 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 4 ms / 1,000 ms |
コード長 | 292 bytes |
コンパイル時間 | 1,287 ms |
コンパイル使用メモリ | 76,316 KB |
最終ジャッジ日時 | 2025-01-11 19:11:33 |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 17 |
ソースコード
#include <iostream> #include <map> using namespace std; using ll = long long; map<ll, ll> dp; ll dfs(ll i) { if (i == 0) return 1; if (dp.count(i) > 0) return dp[i]; return dp[i] = dfs(i/3) + dfs(i/5); } int main() { ll N; cin >> N; cout << dfs(N) << endl; return 0; }