結果

問題 No.64 XORフィボナッチ数列
ユーザー YamaKasaYamaKasa
提出日時 2018-05-11 23:26:18
言語 Java21
(openjdk 21)
結果
AC  
実行時間 129 ms / 5,000 ms
コード長 381 bytes
コンパイル時間 2,140 ms
コンパイル使用メモリ 71,448 KB
実行使用メモリ 56,420 KB
最終ジャッジ日時 2023-09-10 17:52:20
合計ジャッジ時間 4,462 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
56,200 KB
testcase_01 AC 119 ms
55,580 KB
testcase_02 AC 120 ms
55,792 KB
testcase_03 AC 121 ms
55,572 KB
testcase_04 AC 126 ms
55,708 KB
testcase_05 AC 119 ms
55,616 KB
testcase_06 AC 119 ms
56,420 KB
testcase_07 AC 120 ms
55,612 KB
testcase_08 AC 120 ms
55,988 KB
testcase_09 AC 121 ms
55,860 KB
testcase_10 AC 120 ms
53,720 KB
testcase_11 AC 129 ms
55,708 KB
testcase_12 AC 126 ms
55,648 KB
testcase_13 AC 120 ms
55,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		long F0 = scan.nextLong();
		long F1 = scan.nextLong();
		long N = scan.nextLong();
		scan.close();
		long ans = 0;
		if(N % 3 == 0) {
			ans = F0;
		}else if(N % 3 == 1) {
			ans = F1;
		}else {
			ans = F0 ^ F1;
		}
		System.out.println(ans);
	}
}
0