結果

問題 No.64 XORフィボナッチ数列
ユーザー shinshin
提出日時 2022-05-17 14:33:55
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 841 bytes
コンパイル時間 4,686 ms
コンパイル使用メモリ 73,592 KB
実行使用メモリ 58,692 KB
最終ジャッジ日時 2023-10-13 12:09:51
合計ジャッジ時間 12,085 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
49,548 KB
testcase_01 AC 42 ms
47,456 KB
testcase_02 AC 43 ms
49,192 KB
testcase_03 AC 43 ms
47,736 KB
testcase_04 AC 43 ms
49,136 KB
testcase_05 AC 44 ms
49,464 KB
testcase_06 AC 43 ms
49,076 KB
testcase_07 AC 43 ms
49,228 KB
testcase_08 AC 44 ms
48,968 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class No64 {

	public static void main(String[] args) throws IOException{
		//XORフィボナッチ数列
		String[] text = readStr()[0].split(" ");
		Long F = Long.parseLong(text[0]) , FF = Long.parseLong(text[1]) , N = Long.parseLong(text[2]) , count = 0l;
		
		while(count < N) {
			Long x = FF;
			FF = F ^ FF;
			F = x;
			count++;
		}
		
		System.out.println(F);

	}
	
	public static String[] readStr() throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		ArrayList<String> list = new ArrayList<>();

		do {
			list.add(br.readLine());
		}while(br.ready());

		br.close();

		String[] text = new String[list.size()];
		list.toArray(text);

		return text;

	}

}
0