結果

問題 No.64 XORフィボナッチ数列
ユーザー jimanojimano
提出日時 2018-02-04 16:18:43
言語 Java21
(openjdk 21)
結果
AC  
実行時間 44 ms / 5,000 ms
コード長 641 bytes
コンパイル時間 3,000 ms
コンパイル使用メモリ 71,868 KB
実行使用メモリ 49,628 KB
最終ジャッジ日時 2023-09-12 16:02:46
合計ジャッジ時間 4,345 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
49,320 KB
testcase_01 AC 42 ms
49,400 KB
testcase_02 AC 43 ms
47,316 KB
testcase_03 AC 43 ms
49,228 KB
testcase_04 AC 44 ms
49,316 KB
testcase_05 AC 43 ms
49,248 KB
testcase_06 AC 43 ms
49,308 KB
testcase_07 AC 42 ms
49,456 KB
testcase_08 AC 43 ms
49,324 KB
testcase_09 AC 42 ms
49,448 KB
testcase_10 AC 43 ms
49,628 KB
testcase_11 AC 42 ms
49,264 KB
testcase_12 AC 43 ms
49,300 KB
testcase_13 AC 42 ms
49,264 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package me.yukicoder.lv1_5;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class No0064 {
	public static void main(String[] args) {
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
			String[] str = br.readLine().split(" ");
			long f0 = Long.parseLong(str[0]);
			long f1 = Long.parseLong(str[1]);
			long n = Long.parseLong(str[2]);

			if (n % 3 == 0) {
				System.out.println(f0);
			} else if (n % 3 == 1) {
				System.out.println(f1);
			} else {
				System.out.println(f1 ^ f0);
			}

		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
0