結果

問題 No.954 Result
ユーザー Theta
提出日時 2022-10-25 18:13:40
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 31 ms / 2,000 ms
コード長 904 bytes
コンパイル時間 115 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-07-03 16:04:14
合計ジャッジ時間 2,427 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 7
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    num_list = [int(input()) for _ in range(5)]
    num_list.reverse()
    if num_list[0] == 0:
        print(0)
        return

    if num_list[0] == 1:
        if num_list[1] == 1:
            if num_list[2] == 2:
                if num_list[3] == 3:
                    if num_list[4] == 5:
                        print(5)
                        return
                    print(4)
                    return
                print(3)
                return
            print(2)
            return

    current = 1
    before = 1
    while current < num_list[0]:
        current, before = current+before, current

    if current != num_list[0]:
        print(0)
        return

    for idx in range(1, 5):
        current, before = current+before, current
        if current != num_list[idx]:
            print(idx)
            return
    print(5)


if __name__ == "__main__":
    main()
0