結果

問題 No.64 XORフィボナッチ数列
ユーザー aaaaasatori
提出日時 2018-02-15 09:39:20
言語 Java
(openjdk 23)
結果
AC  
実行時間 136 ms / 5,000 ms
コード長 375 bytes
コンパイル時間 3,742 ms
コンパイル使用メモリ 74,400 KB
実行使用メモリ 41,528 KB
最終ジャッジ日時 2024-12-25 21:08:20
合計ジャッジ時間 6,357 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No64 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long F0 = sc.nextLong();
		long F1 = sc.nextLong();
		long N = sc.nextLong();
		long Fn = F0 ^ F1;
		
		if(N % 3 == 0) {
			System.out.println(F0);
		}else if(N % 3 == 1) {
			System.out.println(F1);
		}else {
			System.out.println(Fn);
		}
	}
}
0