結果
問題 |
No.639 An Ordinary Sequence
|
ユーザー |
![]() |
提出日時 | 2019-04-28 08:37:21 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 324 bytes |
コンパイル時間 | 1,454 ms |
コンパイル使用メモリ | 167,600 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-14 14:58:56 |
合計ジャッジ時間 | 2,367 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 16 WA * 1 |
ソースコード
#include<bits/stdc++.h> using namespace std; long long N; map<long long,long long> ma; long long dp(long long n){ if(n/3==0){ma[n/3]=1;} else if(ma[n/3]==0){ma[n/3]=dp(n/3);} if(n/5==0){ma[n/5]=1;} else if(ma[n/5]==0){ma[n/5]=dp(n/5);} return ma[n/3]+ma[n/5]; } int main(){ cin >> N; cout << dp(N) << endl; }