結果

問題 No.718 行列のできるフィボナッチ数列道場 (1)
ユーザー aguroshouaguroshou
提出日時 2018-07-27 23:00:13
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 876 bytes
コンパイル時間 477 ms
コンパイル使用メモリ 69,464 KB
実行使用メモリ 12,224 KB
最終ジャッジ日時 2023-09-18 12:42:40
合計ジャッジ時間 6,920 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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