結果

問題 No.64 XORフィボナッチ数列
ユーザー papipenpapipen
提出日時 2017-04-08 22:43:26
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 416 bytes
コンパイル時間 2,413 ms
コンパイル使用メモリ 71,220 KB
実行使用メモリ 60,908 KB
最終ジャッジ日時 2023-09-24 23:37:32
合計ジャッジ時間 10,235 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
56,504 KB
testcase_01 AC 119 ms
55,544 KB
testcase_02 AC 120 ms
55,856 KB
testcase_03 AC 119 ms
55,676 KB
testcase_04 AC 123 ms
56,008 KB
testcase_05 AC 123 ms
55,884 KB
testcase_06 AC 122 ms
56,224 KB
testcase_07 AC 121 ms
55,684 KB
testcase_08 AC 123 ms
56,176 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
class N064{
	public static void main(String args[]){
		Scanner s = new Scanner(System.in);
		long f0 = s.nextLong();
		long f1 = s.nextLong();
		long n = s.nextLong();
		long f = 0;
		for(long i = 0; i < n -1; i++){
			f = f0 ^ f1;
			f0 = f1;
			f1 = f;
		}
		if(n == 0){
			System.out.println(f0);
		}else if(n == 1){
			System.out.println(f1);
		}else{
			System.out.println(f);
		}
	}
}
0