結果
問題 | No.314 ケンケンパ |
ユーザー |
![]() |
提出日時 | 2015-12-12 23:02:53 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 40 ms / 1,000 ms |
コード長 | 305 bytes |
コンパイル時間 | 500 ms |
コンパイル使用メモリ | 53,752 KB |
実行使用メモリ | 11,136 KB |
最終ジャッジ日時 | 2024-09-15 08:50:20 |
合計ジャッジ時間 | 1,390 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
#include <iostream>using namespace std;typedef long long int64;int64 fib[1000000 + 1] = {1, 1, 2};int64 md = 1000000007;int main(void){int n;cin >> n;for(int i = 0; i <= n - 2; i++)fib[i + 3] = (fib[i] % md + fib[i + 1] % md) % md;cout << fib[n] << endl;return 0;}