結果
問題 |
No.534 フィボナッチフィボナッチ数
|
ユーザー |
![]() |
提出日時 | 2017-06-24 00:08:36 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 326 bytes |
コンパイル時間 | 418 ms |
コンパイル使用メモリ | 55,152 KB |
実行使用メモリ | 10,496 KB |
最終ジャッジ日時 | 2024-10-03 03:56:46 |
合計ジャッジ時間 | 5,996 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 4 WA * 19 TLE * 1 -- * 18 |
ソースコード
#include <iostream> using namespace std; long long a=1,b=1,c; long long fib(int n){ if(n>2){ while(n>2){ c=(a+b)%1000000007; a=b%1000000007; b=c; n--; }}else if(n==2){c=1;} else if(n==1){c=1;} return c; } int main(){ long long n; cin>>n; n=fib(n); n=fib(n); cout<<n<<endl; return 0; }