結果

問題 No.64 XORフィボナッチ数列
ユーザー itezpaceitezpace
提出日時 2016-08-21 13:05:32
言語 Java21
(openjdk 21)
結果
AC  
実行時間 139 ms / 5,000 ms
コード長 384 bytes
コンパイル時間 2,710 ms
コンパイル使用メモリ 76,172 KB
実行使用メモリ 41,712 KB
最終ジャッジ日時 2024-04-25 11:08:25
合計ジャッジ時間 5,718 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 102 ms
41,240 KB
testcase_01 AC 116 ms
41,036 KB
testcase_02 AC 113 ms
41,712 KB
testcase_03 AC 116 ms
41,112 KB
testcase_04 AC 116 ms
41,464 KB
testcase_05 AC 113 ms
41,408 KB
testcase_06 AC 101 ms
41,544 KB
testcase_07 AC 109 ms
41,112 KB
testcase_08 AC 112 ms
41,540 KB
testcase_09 AC 102 ms
41,108 KB
testcase_10 AC 139 ms
41,220 KB
testcase_11 AC 118 ms
41,092 KB
testcase_12 AC 113 ms
40,896 KB
testcase_13 AC 110 ms
41,416 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Yuki64 {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long a = sc.nextLong();
    long b = sc.nextLong();
    long c = a^b;
    long n = sc.nextLong();
    long x = 0;
    if(n%3==0){
      x = a;
    } else if(n%3==1){
      x = b;
    } else if(n%3==2){
      x = c;
    }
    System.out.println(x);
  }
}
0