結果

問題 No.954 Result
ユーザー R ITSUMIR ITSUMI
提出日時 2020-06-21 03:42:02
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 565 bytes
コンパイル時間 255 ms
コンパイル使用メモリ 86,980 KB
実行使用メモリ 75,188 KB
最終ジャッジ日時 2023-09-16 18:03:08
合計ジャッジ時間 4,162 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
75,052 KB
testcase_01 AC 72 ms
74,968 KB
testcase_02 AC 74 ms
74,948 KB
testcase_03 WA -
testcase_04 AC 71 ms
74,940 KB
testcase_05 WA -
testcase_06 AC 72 ms
74,908 KB
testcase_07 AC 73 ms
74,948 KB
testcase_08 AC 70 ms
75,188 KB
testcase_09 AC 71 ms
74,692 KB
testcase_10 AC 73 ms
74,952 KB
testcase_11 AC 70 ms
74,884 KB
testcase_12 AC 70 ms
74,904 KB
testcase_13 AC 71 ms
74,800 KB
testcase_14 AC 69 ms
74,712 KB
testcase_15 AC 70 ms
74,704 KB
testcase_16 AC 71 ms
74,884 KB
testcase_17 AC 70 ms
74,888 KB
testcase_18 AC 70 ms
74,924 KB
testcase_19 AC 69 ms
75,048 KB
testcase_20 AC 71 ms
74,700 KB
testcase_21 AC 72 ms
75,000 KB
testcase_22 AC 70 ms
74,876 KB
testcase_23 AC 72 ms
74,896 KB
testcase_24 AC 71 ms
74,888 KB
testcase_25 AC 69 ms
74,856 KB
testcase_26 AC 71 ms
75,052 KB
testcase_27 AC 70 ms
74,816 KB
testcase_28 AC 71 ms
74,692 KB
testcase_29 AC 69 ms
74,884 KB
testcase_30 AC 70 ms
74,892 KB
testcase_31 AC 71 ms
74,684 KB
testcase_32 AC 69 ms
74,864 KB
testcase_33 AC 70 ms
74,860 KB
testcase_34 AC 71 ms
74,700 KB
testcase_35 AC 70 ms
74,972 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)]
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