結果

問題 No.64 XORフィボナッチ数列
ユーザー kou6839
提出日時 2014-11-21 22:25:10
言語 Java
(openjdk 23)
結果
TLE  
実行時間 -
コード長 426 bytes
コンパイル時間 2,422 ms
コンパイル使用メモリ 76,564 KB
実行使用メモリ 108,804 KB
最終ジャッジ日時 2025-01-02 20:04:53
合計ジャッジ時間 28,073 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7 TLE * 4
権限があれば一括ダウンロードができます

ソースコード

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