結果

問題 No.314 ケンケンパ
ユーザー mannshi222mannshi222
提出日時 2022-04-29 15:53:42
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 416 bytes
コンパイル時間 558 ms
コンパイル使用メモリ 67,848 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-11 07:48:57
合計ジャッジ時間 6,269 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 TLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: 関数 ‘int main()’ 内:
main.cpp:32:20: 警告: ‘aS’ may be used uninitialized [-Wmaybe-uninitialized]
   32 |         cout << (aS+bK1+bK2)%MOD << endl;
      |                  ~~^~~~
main.cpp:14:13: 備考: ‘aS’ はここで定義されています
   14 |         int aS, aK1, aK2;
      |             ^~

ソースコード

diff #

#include <iostream>


using namespace std;

#define MOD (1000000000+7)

int main()
{
	int N;
	cin >> N;

	int bS, bK1, bK2;
	int aS, aK1, aK2;
	bS = 1;
	bK1 = 0;
	bK2 = 0;

	for( int i = 1; i <= N; i++ ) {
		aS  = bK1 + bK2;
		aK1 = bS ;
		aK2 = bK1;
		aS  = aS%MOD;
		aK1 = aK1%MOD;
		aK2 = aK2%MOD;
		bS = aS;
		bK1 = aK1;
		bK2 = aK2;
		cout << "hoge" << endl;
	}

	cout << (aS+bK1+bK2)%MOD << endl;

	return 0;
}
0