結果

問題 No.64 XORフィボナッチ数列
ユーザー master3821master3821
提出日時 2019-06-28 11:37:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 279 bytes
コンパイル時間 187 ms
コンパイル使用メモリ 10,644 KB
実行使用メモリ 8,528 KB
最終ジャッジ日時 2023-09-14 21:18:47
合計ジャッジ時間 1,172 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,772 KB
testcase_01 AC 16 ms
7,792 KB
testcase_02 AC 15 ms
7,880 KB
testcase_03 AC 15 ms
7,840 KB
testcase_04 AC 15 ms
7,848 KB
testcase_05 AC 16 ms
7,940 KB
testcase_06 AC 15 ms
7,792 KB
testcase_07 AC 15 ms
7,932 KB
testcase_08 AC 16 ms
7,988 KB
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 AC 15 ms
7,784 KB
testcase_13 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

def fib_xor1(x,y,n,rec):
	if n==0:
		rec[0] = x
		return x
	elif n == 1:
		rec[1] = y
		return y
	elif n in rec:
		return rec[n]
	else:
		rec[n] = fib_xor1(x,y,n-1,rec)^fib_xor1(x,y,n-2,rec)
		return rec[n]

x,y,n = map(int,input().split(" "))
rec = {}
print(fib_xor1(x,y,n,rec))
0