結果

問題 No.64 XORフィボナッチ数列
ユーザー takeya_okinotakeya_okino
提出日時 2017-07-08 22:25:23
言語 Java21
(openjdk 21)
結果
AC  
実行時間 141 ms / 5,000 ms
コード長 345 bytes
コンパイル時間 2,155 ms
コンパイル使用メモリ 73,912 KB
実行使用メモリ 41,704 KB
最終ジャッジ日時 2024-04-16 06:39:09
合計ジャッジ時間 4,918 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 141 ms
41,236 KB
testcase_01 AC 140 ms
41,600 KB
testcase_02 AC 138 ms
41,664 KB
testcase_03 AC 141 ms
41,704 KB
testcase_04 AC 139 ms
41,280 KB
testcase_05 AC 141 ms
41,236 KB
testcase_06 AC 137 ms
41,468 KB
testcase_07 AC 138 ms
41,468 KB
testcase_08 AC 139 ms
41,300 KB
testcase_09 AC 140 ms
41,268 KB
testcase_10 AC 141 ms
41,564 KB
testcase_11 AC 140 ms
41,536 KB
testcase_12 AC 138 ms
41,472 KB
testcase_13 AC 135 ms
41,308 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long f0 = sc.nextLong();
    long f1 = sc.nextLong();
    long f2 = f0 ^ f1;
    long ans = f0;
    long N = sc.nextLong();
    if(N % 3 == 1) ans = f1;
    if(N % 3 == 2) ans = f2;
    System.out.println(ans);
  }
}
0