結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
76,492 KB
testcase_01 AC 71 ms
71,372 KB
testcase_02 AC 72 ms
71,572 KB
testcase_03 AC 76 ms
71,556 KB
testcase_04 AC 72 ms
71,416 KB
testcase_05 AC 76 ms
75,588 KB
testcase_06 AC 78 ms
76,296 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 74 ms
75,636 KB
testcase_11 AC 75 ms
76,500 KB
testcase_12 AC 76 ms
76,088 KB
testcase_13 AC 75 ms
76,216 KB
testcase_14 WA -
testcase_15 AC 78 ms
76,560 KB
testcase_16 AC 78 ms
76,676 KB
testcase_17 AC 78 ms
76,452 KB
testcase_18 AC 79 ms
76,232 KB
testcase_19 AC 71 ms
71,344 KB
testcase_20 AC 76 ms
76,528 KB
testcase_21 AC 76 ms
75,768 KB
testcase_22 AC 71 ms
71,340 KB
testcase_23 AC 71 ms
71,480 KB
testcase_24 AC 70 ms
71,460 KB
testcase_25 AC 71 ms
71,340 KB
testcase_26 AC 71 ms
71,372 KB
testcase_27 AC 73 ms
75,488 KB
testcase_28 AC 71 ms
71,304 KB
testcase_29 AC 72 ms
71,276 KB
testcase_30 AC 74 ms
75,752 KB
testcase_31 AC 76 ms
75,732 KB
testcase_32 AC 75 ms
75,796 KB
testcase_33 AC 73 ms
75,712 KB
testcase_34 AC 71 ms
71,268 KB
testcase_35 AC 74 ms
75,748 KB
testcase_36 AC 70 ms
71,280 KB
testcase_37 AC 70 ms
71,340 KB
testcase_38 AC 73 ms
75,816 KB
testcase_39 AC 73 ms
75,596 KB
testcase_40 AC 74 ms
75,796 KB
testcase_41 AC 73 ms
75,820 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

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