結果

問題 No.64 XORフィボナッチ数列
ユーザー k_kadorak_kadora
提出日時 2015-05-22 02:22:09
言語 Java21
(openjdk 21)
結果
AC  
実行時間 137 ms / 5,000 ms
コード長 351 bytes
コンパイル時間 3,620 ms
コンパイル使用メモリ 72,084 KB
実行使用メモリ 56,156 KB
最終ジャッジ日時 2023-09-20 08:43:59
合計ジャッジ時間 6,456 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
55,680 KB
testcase_01 AC 132 ms
55,508 KB
testcase_02 AC 132 ms
55,816 KB
testcase_03 AC 137 ms
55,636 KB
testcase_04 AC 130 ms
55,440 KB
testcase_05 AC 131 ms
55,572 KB
testcase_06 AC 132 ms
56,156 KB
testcase_07 AC 132 ms
55,708 KB
testcase_08 AC 132 ms
55,756 KB
testcase_09 AC 131 ms
55,748 KB
testcase_10 AC 131 ms
55,716 KB
testcase_11 AC 130 ms
55,576 KB
testcase_12 AC 135 ms
55,592 KB
testcase_13 AC 135 ms
55,952 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Fib{
	public static void main(String[] arg){
		Scanner sc = new Scanner(System.in);
		long f0,f1,f2,n;
		f0 = sc.nextLong();
		f1 = sc.nextLong();
		n = sc.nextLong();
		f2 = f0^f1;
		if(n%3 == 0){
			System.out.println(f0);
		}else if (n%3 ==1){
			System.out.println(f1);
		}else{
			System.out.println(f2);
		}
	}
}
0