結果

問題 No.954 Result
ユーザー kekurekekure
提出日時 2020-02-13 11:33:51
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 732 bytes
コンパイル時間 261 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-15 13:42:03
合計ジャッジ時間 2,516 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,752 KB
testcase_01 AC 30 ms
10,624 KB
testcase_02 AC 30 ms
10,752 KB
testcase_03 WA -
testcase_04 AC 31 ms
10,880 KB
testcase_05 WA -
testcase_06 AC 31 ms
10,752 KB
testcase_07 AC 29 ms
10,624 KB
testcase_08 AC 32 ms
10,880 KB
testcase_09 AC 31 ms
10,752 KB
testcase_10 AC 31 ms
10,752 KB
testcase_11 AC 31 ms
10,880 KB
testcase_12 AC 31 ms
10,752 KB
testcase_13 AC 31 ms
10,752 KB
testcase_14 AC 31 ms
10,752 KB
testcase_15 AC 31 ms
10,752 KB
testcase_16 AC 31 ms
10,752 KB
testcase_17 AC 31 ms
10,752 KB
testcase_18 AC 31 ms
10,752 KB
testcase_19 AC 31 ms
10,624 KB
testcase_20 AC 31 ms
10,752 KB
testcase_21 AC 31 ms
10,752 KB
testcase_22 AC 30 ms
10,752 KB
testcase_23 AC 31 ms
10,624 KB
testcase_24 AC 31 ms
10,752 KB
testcase_25 AC 31 ms
10,752 KB
testcase_26 AC 30 ms
10,752 KB
testcase_27 AC 30 ms
10,752 KB
testcase_28 AC 30 ms
10,752 KB
testcase_29 WA -
testcase_30 AC 31 ms
10,752 KB
testcase_31 AC 31 ms
10,624 KB
testcase_32 AC 30 ms
10,752 KB
testcase_33 AC 30 ms
10,752 KB
testcase_34 AC 30 ms
10,752 KB
testcase_35 AC 30 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

F = [1, 1]
n = 1
limit = 10 ** 15
i = 2
while True:
    x = F[i - 1] + F[i - 2]
    if x > limit:
        break
    F.append(x)
    i += 1

input = sys.stdin.readlines()
A = [int(s) for s in input]
A.reverse()
k = len(A)
ans = 0
for i in range(k):
    t = 0
    tt = 0
    if A[i] in F:
        if A[i] == 1:
            xx = i
            yy = F.index(A[i]) + 1
            while xx < k and yy < len(F) and A[xx] == F[yy]:
                tt += 1
                xx += 1
                yy += 1

        xx = i
        yy = F.index(A[i])
        t = 0
        while xx < k and yy < len(F) and A[xx] == F[yy]:
            t += 1
            xx += 1
            yy += 1

        ans = max(ans, t, tt)


print(ans)







0