結果

問題 No.64 XORフィボナッチ数列
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-03-06 13:52:39
言語 Java21
(openjdk 21)
結果
AC  
実行時間 139 ms / 5,000 ms
コード長 362 bytes
コンパイル時間 2,763 ms
コンパイル使用メモリ 74,328 KB
実行使用メモリ 57,732 KB
最終ジャッジ日時 2023-10-18 22:25:44
合計ジャッジ時間 5,092 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 137 ms
57,072 KB
testcase_01 AC 137 ms
55,572 KB
testcase_02 AC 134 ms
57,304 KB
testcase_03 AC 136 ms
57,052 KB
testcase_04 AC 134 ms
57,448 KB
testcase_05 AC 133 ms
57,476 KB
testcase_06 AC 139 ms
57,520 KB
testcase_07 AC 134 ms
57,732 KB
testcase_08 AC 133 ms
56,984 KB
testcase_09 AC 133 ms
57,516 KB
testcase_10 AC 133 ms
57,256 KB
testcase_11 AC 138 ms
57,060 KB
testcase_12 AC 136 ms
57,604 KB
testcase_13 AC 134 ms
57,572 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import static java.lang.System.*;

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