結果

問題 No.64 XORフィボナッチ数列
ユーザー YamaKasa
提出日時 2018-05-11 23:26:18
言語 Java
(openjdk 23)
結果
AC  
実行時間 137 ms / 5,000 ms
コード長 381 bytes
コンパイル時間 2,059 ms
コンパイル使用メモリ 73,632 KB
実行使用メモリ 54,260 KB
最終ジャッジ日時 2024-06-28 09:03:22
合計ジャッジ時間 4,711 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

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