結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
76,244 KB
testcase_01 AC 72 ms
71,452 KB
testcase_02 AC 72 ms
71,496 KB
testcase_03 AC 72 ms
71,488 KB
testcase_04 AC 72 ms
71,432 KB
testcase_05 AC 74 ms
75,668 KB
testcase_06 AC 77 ms
76,196 KB
testcase_07 AC 79 ms
76,436 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 74 ms
75,720 KB
testcase_11 AC 75 ms
76,340 KB
testcase_12 AC 76 ms
76,088 KB
testcase_13 AC 77 ms
76,284 KB
testcase_14 AC 76 ms
76,548 KB
testcase_15 AC 77 ms
76,432 KB
testcase_16 AC 79 ms
76,604 KB
testcase_17 AC 77 ms
76,236 KB
testcase_18 AC 76 ms
76,500 KB
testcase_19 AC 70 ms
71,536 KB
testcase_20 AC 75 ms
76,528 KB
testcase_21 AC 73 ms
75,776 KB
testcase_22 AC 71 ms
71,292 KB
testcase_23 AC 71 ms
71,472 KB
testcase_24 AC 70 ms
71,420 KB
testcase_25 AC 69 ms
71,540 KB
testcase_26 AC 70 ms
71,560 KB
testcase_27 AC 77 ms
76,124 KB
testcase_28 AC 71 ms
71,608 KB
testcase_29 AC 72 ms
71,588 KB
testcase_30 AC 78 ms
76,012 KB
testcase_31 AC 77 ms
76,200 KB
testcase_32 AC 75 ms
76,112 KB
testcase_33 AC 75 ms
76,180 KB
testcase_34 AC 71 ms
71,324 KB
testcase_35 AC 75 ms
76,248 KB
testcase_36 AC 71 ms
71,504 KB
testcase_37 AC 72 ms
71,320 KB
testcase_38 AC 78 ms
76,216 KB
testcase_39 AC 76 ms
76,020 KB
testcase_40 AC 76 ms
76,356 KB
testcase_41 AC 77 ms
76,100 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

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