結果

問題 No.954 Result
ユーザー 👑 Kazun
提出日時 2020-07-02 19:20:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 393 bytes
コンパイル時間 230 ms
コンパイル使用メモリ 82,296 KB
実行使用メモリ 52,480 KB
最終ジャッジ日時 2024-07-04 12:54:01
合計ジャッジ時間 2,526 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 7
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

J=5
a,b=1,1
F=[a,b]
while a+b<=10**15:
    F.append(a+b)
    a,b=b,a+b

A=[]
for _ in range(J):
    A=[int(input())]+A

if A[0] not in F:
    print(0)
else:
    if A[0]==1:
        if A[1]==1:
            p=0
        else:
            p=1
    else:
        p=F.index(A[0])

    for i in range(1,J):
        if A[i]!=F[p+i]:
            print(i)
            sys.exit()
    print(J)
0