結果

問題 No.64 XORフィボナッチ数列
ユーザー yagi2yagi2
提出日時 2017-04-25 17:08:06
言語 Java21
(openjdk 21)
結果
AC  
実行時間 113 ms / 5,000 ms
コード長 503 bytes
コンパイル時間 1,835 ms
コンパイル使用メモリ 73,120 KB
実行使用メモリ 56,468 KB
最終ジャッジ日時 2023-10-11 09:43:34
合計ジャッジ時間 4,127 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 105 ms
55,672 KB
testcase_01 AC 105 ms
56,468 KB
testcase_02 AC 105 ms
54,120 KB
testcase_03 AC 111 ms
55,972 KB
testcase_04 AC 113 ms
55,732 KB
testcase_05 AC 105 ms
55,772 KB
testcase_06 AC 106 ms
55,796 KB
testcase_07 AC 106 ms
55,740 KB
testcase_08 AC 106 ms
55,728 KB
testcase_09 AC 106 ms
53,780 KB
testcase_10 AC 110 ms
55,940 KB
testcase_11 AC 105 ms
55,696 KB
testcase_12 AC 103 ms
55,720 KB
testcase_13 AC 106 ms
56,004 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        long F0 = Long.parseLong(sc.next());
        long F1 = Long.parseLong(sc.next());
        long N = Long.parseLong(sc.next()) % 3;

        List<Long> X = new ArrayList<>();
        X.add(F0);
        X.add(F1);
        X.add(X.get(0) ^ X.get(1));

        System.out.println(X.get((int) (N%3)));


    }
}
0