結果
問題 | No.64 XORフィボナッチ数列 |
ユーザー |
|
提出日時 | 2014-11-17 10:24:52 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 130 ms / 5,000 ms |
コード長 | 501 bytes |
コンパイル時間 | 4,330 ms |
コンパイル使用メモリ | 77,996 KB |
実行使用メモリ | 41,856 KB |
最終ジャッジ日時 | 2025-01-02 16:32:53 |
合計ジャッジ時間 | 6,820 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 11 |
ソースコード
import java.util.Scanner; public class Main64 { public static void main(String[] args) { Main64 p = new Main64(); } public Main64() { Scanner sc = new Scanner(System.in); long f0 = sc.nextLong(); long f1 = sc.nextLong(); long n = sc.nextLong(); solve(f0, f1, n); } public void solve(long f0, long f1, long n) { long res = 0; if(n%3==0) res = f0; else if(n%3==1) res = f1; else res = f0 ^ f1; System.out.println(res); } }