結果

問題 No.2363 k-bonacci
ユーザー ntudantuda
提出日時 2023-07-01 10:29:25
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 360 bytes
コンパイル時間 365 ms
コンパイル使用メモリ 87,276 KB
実行使用メモリ 77,236 KB
最終ジャッジ日時 2023-09-22 04:30:04
合計ジャッジ時間 5,771 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
76,936 KB
testcase_01 AC 90 ms
71,764 KB
testcase_02 AC 90 ms
71,732 KB
testcase_03 AC 95 ms
71,612 KB
testcase_04 AC 90 ms
71,696 KB
testcase_05 AC 92 ms
71,468 KB
testcase_06 AC 96 ms
76,924 KB
testcase_07 AC 95 ms
77,068 KB
testcase_08 AC 96 ms
77,148 KB
testcase_09 AC 97 ms
76,964 KB
testcase_10 AC 91 ms
71,712 KB
testcase_11 AC 90 ms
71,436 KB
testcase_12 AC 90 ms
71,432 KB
testcase_13 AC 98 ms
76,868 KB
testcase_14 AC 98 ms
76,960 KB
testcase_15 AC 96 ms
77,236 KB
testcase_16 AC 96 ms
76,872 KB
testcase_17 AC 96 ms
77,160 KB
testcase_18 AC 96 ms
76,712 KB
testcase_19 AC 92 ms
71,436 KB
testcase_20 AC 93 ms
71,644 KB
testcase_21 AC 95 ms
71,588 KB
testcase_22 WA -
testcase_23 AC 94 ms
71,788 KB
testcase_24 AC 93 ms
71,700 KB
testcase_25 AC 94 ms
71,712 KB
testcase_26 AC 93 ms
71,680 KB
testcase_27 AC 93 ms
71,584 KB
testcase_28 AC 93 ms
71,796 KB
testcase_29 AC 95 ms
71,512 KB
testcase_30 AC 94 ms
71,444 KB
testcase_31 AC 92 ms
71,584 KB
testcase_32 AC 93 ms
71,540 KB
testcase_33 AC 93 ms
71,712 KB
testcase_34 AC 92 ms
71,700 KB
testcase_35 AC 91 ms
71,656 KB
testcase_36 AC 92 ms
71,632 KB
testcase_37 AC 92 ms
71,712 KB
testcase_38 AC 94 ms
71,784 KB
testcase_39 AC 93 ms
71,712 KB
testcase_40 AC 92 ms
71,508 KB
testcase_41 AC 100 ms
71,688 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque

N = int(input())
k = 2
while 2 ** (k - 2) <= N:
    tmp = 1
    q = deque([0] * (k - 1) + [1])
    sum0 = 1
    # print(q, sum0)
    while sum0 <= N:
        q.append(sum0)
        sum0 += sum0
        sum0 -= q.popleft()
        # print(q,sum0)
        if sum0 == N:
            print(k)
            exit()
    k += 1
print(-1)
0