結果

問題 No.2363 k-bonacci
ユーザー ああいいああいい
提出日時 2023-07-01 19:34:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 82 ms / 2,000 ms
コード長 483 bytes
コンパイル時間 1,409 ms
コンパイル使用メモリ 86,724 KB
実行使用メモリ 76,552 KB
最終ジャッジ日時 2023-09-22 13:46:50
合計ジャッジ時間 5,397 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
76,216 KB
testcase_01 AC 72 ms
71,092 KB
testcase_02 AC 72 ms
71,212 KB
testcase_03 AC 73 ms
71,080 KB
testcase_04 AC 72 ms
71,396 KB
testcase_05 AC 73 ms
75,772 KB
testcase_06 AC 75 ms
76,264 KB
testcase_07 AC 78 ms
76,412 KB
testcase_08 AC 77 ms
76,552 KB
testcase_09 AC 78 ms
76,192 KB
testcase_10 AC 74 ms
75,532 KB
testcase_11 AC 78 ms
76,132 KB
testcase_12 AC 77 ms
76,080 KB
testcase_13 AC 76 ms
76,268 KB
testcase_14 AC 79 ms
76,208 KB
testcase_15 AC 77 ms
76,548 KB
testcase_16 AC 80 ms
76,220 KB
testcase_17 AC 77 ms
76,416 KB
testcase_18 AC 79 ms
75,972 KB
testcase_19 AC 72 ms
71,080 KB
testcase_20 AC 77 ms
76,188 KB
testcase_21 AC 76 ms
75,424 KB
testcase_22 AC 72 ms
71,128 KB
testcase_23 AC 72 ms
71,080 KB
testcase_24 AC 73 ms
71,360 KB
testcase_25 AC 71 ms
71,176 KB
testcase_26 AC 72 ms
71,348 KB
testcase_27 AC 75 ms
75,900 KB
testcase_28 AC 72 ms
71,296 KB
testcase_29 AC 72 ms
71,392 KB
testcase_30 AC 78 ms
75,932 KB
testcase_31 AC 76 ms
75,972 KB
testcase_32 AC 78 ms
76,132 KB
testcase_33 AC 78 ms
76,256 KB
testcase_34 AC 72 ms
71,212 KB
testcase_35 AC 78 ms
75,736 KB
testcase_36 AC 73 ms
71,432 KB
testcase_37 AC 71 ms
71,176 KB
testcase_38 AC 77 ms
75,908 KB
testcase_39 AC 78 ms
76,080 KB
testcase_40 AC 79 ms
75,976 KB
testcase_41 AC 79 ms
75,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

import sys
if N == 1:
    print(2)
    exit()
    
for k in range(2,70):
    A = [0]
    i = 1
    while True:
        i += 1
        if i < k:
            A.append(0)
        elif i == k:
            A.append(1)
        else:
            t = 0
            for j in range(1,k + 1):
                t += A[i-j - 1]
            if t == N:
                print(k)
                exit()
            elif t > N:
                break
            A.append(t)
print(-1)
0