結果

問題 No.64 XORフィボナッチ数列
ユーザー soujikisoujiki
提出日時 2015-04-29 19:38:56
言語 Java21
(openjdk 21)
結果
AC  
実行時間 130 ms / 5,000 ms
コード長 427 bytes
コンパイル時間 3,172 ms
コンパイル使用メモリ 72,692 KB
実行使用メモリ 55,912 KB
最終ジャッジ日時 2023-09-19 04:10:33
合計ジャッジ時間 5,881 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,700 KB
testcase_01 AC 126 ms
55,912 KB
testcase_02 AC 127 ms
55,808 KB
testcase_03 AC 127 ms
55,784 KB
testcase_04 AC 126 ms
55,696 KB
testcase_05 AC 128 ms
55,724 KB
testcase_06 AC 128 ms
55,792 KB
testcase_07 AC 130 ms
55,692 KB
testcase_08 AC 130 ms
55,676 KB
testcase_09 AC 128 ms
55,684 KB
testcase_10 AC 128 ms
55,676 KB
testcase_11 AC 126 ms
55,640 KB
testcase_12 AC 127 ms
55,776 KB
testcase_13 AC 123 ms
55,648 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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