結果

問題 No.64 XORフィボナッチ数列
ユーザー リチウムリチウム
提出日時 2014-11-11 23:39:19
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 5,000 ms
コード長 321 bytes
コンパイル時間 4,489 ms
コンパイル使用メモリ 71,828 KB
実行使用メモリ 56,336 KB
最終ジャッジ日時 2023-08-30 03:13:31
合計ジャッジ時間 5,748 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,692 KB
testcase_01 AC 122 ms
55,192 KB
testcase_02 AC 122 ms
55,692 KB
testcase_03 AC 121 ms
55,452 KB
testcase_04 AC 124 ms
54,120 KB
testcase_05 AC 121 ms
55,664 KB
testcase_06 AC 124 ms
56,336 KB
testcase_07 AC 124 ms
55,352 KB
testcase_08 AC 124 ms
55,828 KB
testcase_09 AC 124 ms
55,860 KB
testcase_10 AC 123 ms
55,820 KB
testcase_11 AC 123 ms
55,956 KB
testcase_12 AC 124 ms
55,456 KB
testcase_13 AC 125 ms
55,780 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class ok{
	public static void main(String[] args) {
		Scanner sc=new Scanner (System.in);
		long f=sc.nextLong();
		long g=sc.nextLong();
		long n=sc.nextLong();
		long h=f^g;
		long ans;
		if(n%3==0)ans=f;
		else if(n%3==1)ans=g;
		else ans=h;
		
		System.out.println(ans);
	}}
0