結果

問題 No.64 XORフィボナッチ数列
ユーザー kano_townkano_town
提出日時 2014-11-21 14:51:03
言語 Java21
(openjdk 21)
結果
AC  
実行時間 119 ms / 5,000 ms
コード長 366 bytes
コンパイル時間 3,117 ms
コンパイル使用メモリ 71,828 KB
実行使用メモリ 56,384 KB
最終ジャッジ日時 2023-08-30 22:08:58
合計ジャッジ時間 5,645 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,844 KB
testcase_01 AC 114 ms
56,328 KB
testcase_02 AC 112 ms
56,128 KB
testcase_03 AC 111 ms
55,708 KB
testcase_04 AC 112 ms
56,380 KB
testcase_05 AC 119 ms
56,008 KB
testcase_06 AC 113 ms
56,212 KB
testcase_07 AC 109 ms
55,720 KB
testcase_08 AC 110 ms
55,832 KB
testcase_09 AC 109 ms
55,992 KB
testcase_10 AC 116 ms
55,916 KB
testcase_11 AC 117 ms
56,384 KB
testcase_12 AC 115 ms
55,744 KB
testcase_13 AC 114 ms
56,148 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Yukicoder64 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long f0 = sc.nextLong();
		long f1 = sc.nextLong();
		long N = sc.nextLong();
		
		long fn;
		
		if (N % 3 == 0) fn = f0;
		else if (N % 3 == 1) fn = f1;
		else fn = f0 ^ f1;
		
		System.out.println(fn);
	}
}
0