結果

問題 No.64 XORフィボナッチ数列
ユーザー bellangeldindonbellangeldindon
提出日時 2019-05-07 11:56:31
言語 Python2
(2.7.18)
結果
RE  
実行時間 -
コード長 273 bytes
コンパイル時間 60 ms
コンパイル使用メモリ 6,716 KB
実行使用メモリ 6,092 KB
最終ジャッジ日時 2023-09-14 16:24:50
合計ジャッジ時間 990 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,088 KB
testcase_01 AC 11 ms
5,992 KB
testcase_02 AC 12 ms
5,876 KB
testcase_03 AC 12 ms
5,936 KB
testcase_04 AC 11 ms
5,860 KB
testcase_05 AC 11 ms
5,948 KB
testcase_06 AC 11 ms
5,856 KB
testcase_07 AC 11 ms
5,996 KB
testcase_08 AC 11 ms
5,924 KB
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 AC 11 ms
6,092 KB
testcase_13 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

f0, f1, N = map(int, raw_input().split())
xorfib = [f0, f1]
memo = [[f0, f1]]
for i in range(2, N+1):
	tmp = xorfib[i-1] ^ xorfib[i-2]
	if [xorfib[i-1], tmp] in memo:
		xorfib.pop(-1)
		break
	xorfib.append(tmp)
	memo.append([xorfib[i-1], tmp])

print xorfib[N%len(xorfib)]
0