結果

問題 No.64 XORフィボナッチ数列
ユーザー nbisconbisco
提出日時 2016-03-21 19:52:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 283 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 16,660 KB
最終ジャッジ日時 2024-04-08 21:24:40
合計ジャッジ時間 7,048 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#!/usr/bin/env python3
#fileencoding: utf-8

f0, f1, N = [int(i) for i in input().strip().split(" ")]

if N <= 2:
    print([f0,f1,f0^f1][N])
else:
    fk_1 = f0 + f1
    fk_2 = f1
    f = 0
    for i in range(N-2):
        fk_1, fk_2 = fk_1^fk_2, fk_1
        f = fk_1
    print(f)
0