結果

問題 No.2363 k-bonacci
ユーザー FromBooskaFromBooska
提出日時 2023-06-30 18:48:40
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 658 bytes
コンパイル時間 419 ms
コンパイル使用メモリ 86,952 KB
実行使用メモリ 77,440 KB
最終ジャッジ日時 2023-09-21 12:23:52
合計ジャッジ時間 5,867 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 101 ms
77,264 KB
testcase_01 AC 66 ms
71,068 KB
testcase_02 AC 69 ms
71,600 KB
testcase_03 AC 67 ms
71,464 KB
testcase_04 AC 70 ms
75,016 KB
testcase_05 AC 70 ms
75,064 KB
testcase_06 AC 91 ms
77,264 KB
testcase_07 AC 95 ms
77,204 KB
testcase_08 AC 97 ms
77,248 KB
testcase_09 AC 98 ms
77,316 KB
testcase_10 AC 78 ms
76,436 KB
testcase_11 AC 89 ms
76,560 KB
testcase_12 AC 80 ms
76,400 KB
testcase_13 AC 91 ms
77,204 KB
testcase_14 AC 94 ms
77,188 KB
testcase_15 AC 91 ms
76,992 KB
testcase_16 AC 101 ms
77,308 KB
testcase_17 AC 111 ms
77,316 KB
testcase_18 AC 102 ms
77,212 KB
testcase_19 AC 66 ms
71,312 KB
testcase_20 AC 100 ms
77,100 KB
testcase_21 AC 74 ms
75,404 KB
testcase_22 WA -
testcase_23 AC 67 ms
71,428 KB
testcase_24 AC 65 ms
71,436 KB
testcase_25 AC 66 ms
71,428 KB
testcase_26 AC 67 ms
71,124 KB
testcase_27 AC 102 ms
77,252 KB
testcase_28 AC 67 ms
71,288 KB
testcase_29 AC 66 ms
71,248 KB
testcase_30 AC 102 ms
77,228 KB
testcase_31 AC 102 ms
77,304 KB
testcase_32 AC 103 ms
77,220 KB
testcase_33 AC 101 ms
77,224 KB
testcase_34 AC 67 ms
71,424 KB
testcase_35 AC 108 ms
76,980 KB
testcase_36 AC 68 ms
71,564 KB
testcase_37 AC 67 ms
71,468 KB
testcase_38 AC 101 ms
77,260 KB
testcase_39 AC 105 ms
77,264 KB
testcase_40 AC 104 ms
77,220 KB
testcase_41 AC 102 ms
77,440 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# 通常のフィボナッチ数列は100項で10**18を超える
# つまりN<10**18ならば、すぐに達するだろう
# ということは100-bonacciまで調べれば十分なのでは
# それ以上調べてもN<10**18の存在は変わらない

N = int(input())

if N == 1:
    print(1)
    exit()

ans = -1
found = False
for k in range(2, 101):
    if found == True:
        break
    fibonacci = [1, 1]
    for j in range(100):
        calc = sum(fibonacci[max(0, len(fibonacci)-k):])
        fibonacci.append(calc)
        if calc == N:
            ans = k
            found = True
            break
    #print('k', k, fibonacci)
print(ans)



0