結果

問題 No.954 Result
ユーザー R ITSUMIR ITSUMI
提出日時 2020-06-21 03:49:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 577 bytes
コンパイル時間 1,439 ms
コンパイル使用メモリ 86,740 KB
実行使用メモリ 75,008 KB
最終ジャッジ日時 2023-09-17 18:20:26
合計ジャッジ時間 5,175 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
74,668 KB
testcase_01 AC 80 ms
74,740 KB
testcase_02 AC 78 ms
74,960 KB
testcase_03 AC 81 ms
74,728 KB
testcase_04 AC 81 ms
74,776 KB
testcase_05 AC 82 ms
74,744 KB
testcase_06 AC 83 ms
74,716 KB
testcase_07 AC 81 ms
74,584 KB
testcase_08 AC 82 ms
74,920 KB
testcase_09 AC 80 ms
74,776 KB
testcase_10 AC 81 ms
74,796 KB
testcase_11 AC 82 ms
74,724 KB
testcase_12 AC 80 ms
74,804 KB
testcase_13 AC 80 ms
74,820 KB
testcase_14 AC 80 ms
75,008 KB
testcase_15 AC 79 ms
74,824 KB
testcase_16 AC 78 ms
74,712 KB
testcase_17 AC 78 ms
74,920 KB
testcase_18 AC 78 ms
74,688 KB
testcase_19 AC 79 ms
74,692 KB
testcase_20 AC 77 ms
74,584 KB
testcase_21 AC 79 ms
75,004 KB
testcase_22 AC 78 ms
74,648 KB
testcase_23 AC 80 ms
74,824 KB
testcase_24 AC 79 ms
74,736 KB
testcase_25 AC 79 ms
74,724 KB
testcase_26 AC 79 ms
74,724 KB
testcase_27 AC 80 ms
74,804 KB
testcase_28 AC 79 ms
74,788 KB
testcase_29 AC 80 ms
74,584 KB
testcase_30 AC 79 ms
74,728 KB
testcase_31 AC 80 ms
74,688 KB
testcase_32 AC 79 ms
74,800 KB
testcase_33 AC 81 ms
74,712 KB
testcase_34 AC 80 ms
75,004 KB
testcase_35 AC 79 ms
74,728 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def Fib(n):
    a, b = 0, 1
    if n == 1:
        return a
    elif n == 2:
        return b
    else:
        for _ in range(n-2):
            a, b = b, a + b
        return b
fib = [Fib(n) for n in range(1, 100)]
del fib[0]
arr = [int(input()) for _ in range(5)][::-1]
ans_1 = 0
check = [1,2,3,5,8]
for i in range(5):
    if arr[i] == check[i]:
        ans_1 += 1
    else:
        break
ans = 0
if arr[0] in fib:
    ans += 1
    for i in range(1,5):
        if arr[i] == fib[fib.index(arr[0])+i]:
            ans += 1
        else:
            break
print(max(ans,ans_1))
0