結果

問題 No.64 XORフィボナッチ数列
ユーザー jimanojimano
提出日時 2018-02-04 16:17:42
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 628 bytes
コンパイル時間 2,855 ms
コンパイル使用メモリ 71,960 KB
実行使用メモリ 49,636 KB
最終ジャッジ日時 2023-09-12 16:02:32
合計ジャッジ時間 4,157 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
49,296 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 42 ms
49,280 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 41 ms
49,276 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 42 ms
49,208 KB
testcase_12 WA -
testcase_13 WA -
権限があれば一括ダウンロードができます

ソースコード

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);
			}
			System.out.println(f1 ^ f0);

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