結果

問題 No.64 XORフィボナッチ数列
ユーザー kuuso1kuuso1
提出日時 2014-11-11 23:31:38
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 60 ms / 5,000 ms
コード長 1,163 bytes
コンパイル時間 3,080 ms
コンパイル使用メモリ 106,572 KB
実行使用メモリ 22,856 KB
最終ジャッジ日時 2023-08-30 03:12:38
合計ジャッジ時間 4,829 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
20,804 KB
testcase_01 AC 58 ms
20,864 KB
testcase_02 AC 58 ms
20,632 KB
testcase_03 AC 58 ms
20,736 KB
testcase_04 AC 59 ms
20,704 KB
testcase_05 AC 59 ms
22,832 KB
testcase_06 AC 59 ms
18,728 KB
testcase_07 AC 60 ms
22,728 KB
testcase_08 AC 58 ms
20,764 KB
testcase_09 AC 59 ms
22,816 KB
testcase_10 AC 59 ms
20,768 KB
testcase_11 AC 59 ms
20,828 KB
testcase_12 AC 59 ms
22,856 KB
testcase_13 AC 60 ms
20,800 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections;
using System.Collections.Generic;
 
class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		var d=rla();
		long F0=d[0];
		long F1=d[1];
		long N=d[2];
		
		if(N==0){
			Console.WriteLine(F0);
			return;
		}
		if(N==1){
			Console.WriteLine(F1);
			return;
		}
		
		if(N%3==0){
			Console.WriteLine(F0);
			return;
		}
		if(N%3==1){
			Console.WriteLine(F1);
			return;
		}
		Console.WriteLine(F1^F0);
		
		
	}

	public Sol(){
	}




	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(){return Console.ReadLine().Split(' ');}
	static int[] ria(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>int.Parse(e));}
	static long[] rla(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>long.Parse(e));}
	static double[] rda(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>double.Parse(e));}
}
0