結果

問題 No.64 XORフィボナッチ数列
ユーザー aa
提出日時 2023-10-28 09:23:29
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 289 bytes
コンパイル時間 311 ms
コンパイル使用メモリ 11,896 KB
実行使用メモリ 10,164 KB
最終ジャッジ日時 2023-10-28 09:23:31
合計ジャッジ時間 1,707 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,152 KB
testcase_01 AC 29 ms
10,152 KB
testcase_02 AC 29 ms
10,152 KB
testcase_03 AC 29 ms
10,152 KB
testcase_04 AC 29 ms
10,152 KB
testcase_05 AC 29 ms
10,152 KB
testcase_06 AC 29 ms
10,152 KB
testcase_07 AC 28 ms
10,152 KB
testcase_08 AC 30 ms
10,152 KB
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 AC 29 ms
10,152 KB
testcase_13 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

def fib(a,b,n):

  if n==0:
    data[0]=a
    return data[0]
  if n==1:
    data[1]=b
    return data[1]
  if data[n]!=-1:
    return data[n]

  data[n]=fib(a,b,n-1)^fib(a,b,n-2)
  return fib(a,b,n-1)^fib(a,b,n-2)

a,b,n = map(int,input().split())
data=[-1]*(n+1)
ans=fib(a,b,n)
print(ans)
0