結果

問題 No.64 XORフィボナッチ数列
ユーザー kou6839kou6839
提出日時 2014-11-21 22:25:10
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 426 bytes
コンパイル時間 1,932 ms
コンパイル使用メモリ 71,532 KB
実行使用メモリ 59,952 KB
最終ジャッジ日時 2023-08-30 22:11:33
合計ジャッジ時間 10,025 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
59,952 KB
testcase_01 AC 118 ms
56,184 KB
testcase_02 AC 113 ms
55,672 KB
testcase_03 AC 110 ms
56,088 KB
testcase_04 AC 116 ms
56,080 KB
testcase_05 AC 118 ms
56,268 KB
testcase_06 AC 118 ms
56,176 KB
testcase_07 AC 113 ms
55,772 KB
testcase_08 AC 116 ms
56,348 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
 

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong();
		long m=sc.nextLong();
		long l=sc.nextLong();
		if(l==1){
			System.out.println(m);
			return;
		}
		if(l==0){
			System.out.println(n);
			return;
		}
		for(int i=1;i<=l-1;i++){
			long temp=m;
			m^=n;
			n=temp;
		}
		System.out.println(m);
	}
}
0