結果

問題 No.954 Result
ユーザー Akijin_007Akijin_007
提出日時 2023-07-28 01:30:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 41 ms / 2,000 ms
コード長 627 bytes
コンパイル時間 319 ms
コンパイル使用メモリ 82,232 KB
実行使用メモリ 53,972 KB
最終ジャッジ日時 2024-04-15 11:31:15
合計ジャッジ時間 3,085 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,208 KB
testcase_01 AC 40 ms
52,552 KB
testcase_02 AC 39 ms
52,292 KB
testcase_03 AC 39 ms
53,704 KB
testcase_04 AC 40 ms
52,884 KB
testcase_05 AC 39 ms
52,188 KB
testcase_06 AC 39 ms
52,224 KB
testcase_07 AC 41 ms
53,752 KB
testcase_08 AC 40 ms
52,128 KB
testcase_09 AC 39 ms
53,632 KB
testcase_10 AC 40 ms
53,456 KB
testcase_11 AC 39 ms
51,880 KB
testcase_12 AC 39 ms
53,212 KB
testcase_13 AC 39 ms
52,700 KB
testcase_14 AC 40 ms
52,456 KB
testcase_15 AC 39 ms
51,936 KB
testcase_16 AC 39 ms
53,972 KB
testcase_17 AC 40 ms
52,728 KB
testcase_18 AC 39 ms
52,072 KB
testcase_19 AC 40 ms
52,788 KB
testcase_20 AC 40 ms
52,488 KB
testcase_21 AC 39 ms
52,520 KB
testcase_22 AC 39 ms
52,900 KB
testcase_23 AC 38 ms
52,404 KB
testcase_24 AC 40 ms
53,080 KB
testcase_25 AC 40 ms
52,276 KB
testcase_26 AC 40 ms
53,620 KB
testcase_27 AC 40 ms
52,592 KB
testcase_28 AC 41 ms
53,152 KB
testcase_29 AC 40 ms
52,068 KB
testcase_30 AC 40 ms
52,912 KB
testcase_31 AC 40 ms
52,236 KB
testcase_32 AC 39 ms
52,444 KB
testcase_33 AC 40 ms
53,220 KB
testcase_34 AC 39 ms
52,304 KB
testcase_35 AC 40 ms
53,072 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#int(input())
#map(int, input().split())
#list(map(int, input().split()))

N = 5
A = [0] * N
for i in range(N):
    A[i] = int(input())

f = [1, 2]
while f[-1] < max(A):
    f.append(f[-1] + f[-2])

ans = 0
c = 0
p = [-2] * N
for i in range(N):
    if A[i] == 1:
        if i == 0 or A[i-1] != 1:
            p[i] = 1
        else:
            p[i] = 0
    else:
        if A[i] in f:
            p[i] = f.index(A[i])+1

ans = 0
if p[-1] == -2:
    ans = 0
else:
    p = p[::-1]
    a = p[0]
    ans += 1
    for i in range(N-1):
        if p[i] + 1 == p[i+1]:
            ans += 1
        else:
            break

print(ans)

0