結果

問題 No.2363 k-bonacci
ユーザー ああいいああいい
提出日時 2023-07-01 19:33:37
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 483 bytes
コンパイル時間 425 ms
コンパイル使用メモリ 87,048 KB
実行使用メモリ 76,532 KB
最終ジャッジ日時 2023-09-22 13:45:11
合計ジャッジ時間 6,100 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
76,248 KB
testcase_01 AC 72 ms
71,300 KB
testcase_02 AC 76 ms
71,340 KB
testcase_03 AC 72 ms
71,296 KB
testcase_04 AC 71 ms
71,296 KB
testcase_05 AC 73 ms
75,912 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 75 ms
75,532 KB
testcase_11 AC 75 ms
76,464 KB
testcase_12 AC 76 ms
76,388 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 78 ms
76,248 KB
testcase_17 AC 77 ms
76,096 KB
testcase_18 AC 80 ms
76,364 KB
testcase_19 AC 71 ms
71,104 KB
testcase_20 AC 77 ms
76,100 KB
testcase_21 AC 75 ms
75,952 KB
testcase_22 AC 72 ms
71,508 KB
testcase_23 AC 71 ms
71,292 KB
testcase_24 AC 71 ms
71,292 KB
testcase_25 AC 73 ms
71,524 KB
testcase_26 AC 71 ms
71,348 KB
testcase_27 AC 76 ms
75,804 KB
testcase_28 AC 71 ms
71,532 KB
testcase_29 AC 72 ms
71,372 KB
testcase_30 AC 74 ms
75,900 KB
testcase_31 AC 74 ms
75,768 KB
testcase_32 AC 74 ms
75,612 KB
testcase_33 AC 75 ms
75,732 KB
testcase_34 AC 71 ms
71,308 KB
testcase_35 AC 73 ms
75,748 KB
testcase_36 AC 70 ms
71,108 KB
testcase_37 AC 72 ms
71,276 KB
testcase_38 AC 74 ms
75,700 KB
testcase_39 AC 75 ms
75,704 KB
testcase_40 AC 75 ms
75,952 KB
testcase_41 AC 74 ms
75,740 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

import sys
if N == 1:
    print(2)
    exit()
    
for k in range(2,31):
    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