結果

問題 No.64 XORフィボナッチ数列
ユーザー aaaaasatoriaaaaasatori
提出日時 2018-02-15 09:39:20
言語 Java21
(openjdk 21)
結果
AC  
実行時間 119 ms / 5,000 ms
コード長 375 bytes
コンパイル時間 2,888 ms
コンパイル使用メモリ 72,796 KB
実行使用メモリ 56,584 KB
最終ジャッジ日時 2023-08-26 19:35:45
合計ジャッジ時間 5,221 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
55,900 KB
testcase_01 AC 112 ms
56,084 KB
testcase_02 AC 117 ms
56,584 KB
testcase_03 AC 115 ms
55,636 KB
testcase_04 AC 113 ms
56,028 KB
testcase_05 AC 111 ms
55,632 KB
testcase_06 AC 112 ms
55,700 KB
testcase_07 AC 119 ms
55,696 KB
testcase_08 AC 114 ms
55,868 KB
testcase_09 AC 113 ms
55,840 KB
testcase_10 AC 113 ms
55,672 KB
testcase_11 AC 115 ms
56,096 KB
testcase_12 AC 118 ms
56,068 KB
testcase_13 AC 117 ms
55,900 KB
権限があれば一括ダウンロードができます

ソースコード

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