結果

問題 No.718 行列のできるフィボナッチ数列道場 (1)
コンテスト
ユーザー aguroshou
提出日時 2018-07-27 23:00:13
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
TLE  
実行時間 -
コード長 876 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 497 ms
コンパイル使用メモリ 89,440 KB
実行使用メモリ 16,128 KB
最終ジャッジ日時 2026-03-26 10:30:51
合計ジャッジ時間 6,801 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 3
other TLE * 1 -- * 19
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<iostream>
#include <algorithm>
#include<string>
#include <bitset>
#include <vector>
#include <functional>
#include <climits>
#include <iomanip>
#include <utility>
using namespace std;
typedef pair <int, int> pii;
int main()
{

	//int a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, ans = 0;
	long long a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, i = 0, j = 0, k = 0, l = 0, ans = 0;
	//cout << LONG_MAX << endl;
	string s, t;
	//long long n, A[1000000000];
	long long n, m;
	//int   y[100001], z[100001], x[10001] = {};
	//pii y[100001];
	//pair<int, float> pii[100001];
	int x[1003];
	cin >> n;
	b = 1;
	c = 0;
	d = 0;
	for ( a = 0; a < n; a++)
	{
		d = b;
		b = b + c;
		c = d;
		b %= 1000000007;
		c %= 1000000007;
	}

	////std::cout << std::fixed;
	//cout << std::setprecision(20) << << endl;
	cout << (b*c) % 1000000007 << endl;

	return 0;
}
0