結果

問題 No.64 XORフィボナッチ数列
コンテスト
ユーザー scache
提出日時 2014-11-17 10:24:52
言語 Java
(openjdk 25.0.2)
コンパイル:
javac -encoding UTF8 _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true _class_
結果
AC  
実行時間 58 ms / 5,000 ms
コード長 501 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,190 ms
コンパイル使用メモリ 81,992 KB
実行使用メモリ 41,712 KB
最終ジャッジ日時 2026-06-06 04:42:36
合計ジャッジ時間 5,547 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code


import java.util.Scanner;

public class Main64 {
	public static void main(String[] args) {
		Main64 p = new Main64();
	}

	public Main64() {
		Scanner sc = new Scanner(System.in);
		
		long f0 = sc.nextLong();
		long f1 = sc.nextLong();
		long n = sc.nextLong();
		solve(f0, f1, n);
	}

	public void solve(long f0, long f1, long n) {
		long res = 0;
		if(n%3==0)
			res = f0;
		else if(n%3==1)
			res = f1;
		else
			res = f0 ^ f1;
		
		System.out.println(res);
	}

}
0