結果

問題 No.64 XORフィボナッチ数列
ユーザー highdhighd
提出日時 2016-08-29 14:39:19
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 271 bytes
コンパイル時間 935 ms
コンパイル使用メモリ 69,132 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-26 17:16:30
合計ジャッジ時間 1,529 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 AC 2 ms
5,376 KB
testcase_13 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
int main() {
	long long f0,f1,n;
	std::cin>>f0>>f1>>n;
	std::vector<int> fib;
	fib.resize(n+1);
	fib[0]=f0;
	if(n>0){
		fib[1]=f1;
	}
	for(int i=2;i<n+1;i++){
		fib[i]=fib[i-1]^fib[i-2];
	}
	std::cout<<fib[n]<<std::endl;
	return 0;
}
0