結果

問題 No.64 XORフィボナッチ数列
ユーザー YamaKasaYamaKasa
提出日時 2018-05-11 23:23:51
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 376 bytes
コンパイル時間 1,985 ms
コンパイル使用メモリ 71,588 KB
実行使用メモリ 58,540 KB
最終ジャッジ日時 2023-09-10 17:51:37
合計ジャッジ時間 4,669 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import java.util.Scanner;

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