結果

問題 No.1093 区間の和 / Sum of Range
ユーザー 👑 rin204rin204
提出日時 2020-08-13 08:15:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 655 ms / 2,000 ms
コード長 322 bytes
コンパイル時間 194 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 20,680 KB
最終ジャッジ日時 2024-04-18 01:19:19
合計ジャッジ時間 13,696 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
10,752 KB
testcase_01 AC 357 ms
15,180 KB
testcase_02 AC 170 ms
11,904 KB
testcase_03 AC 109 ms
19,516 KB
testcase_04 AC 81 ms
20,280 KB
testcase_05 AC 505 ms
14,824 KB
testcase_06 AC 115 ms
13,928 KB
testcase_07 AC 281 ms
14,772 KB
testcase_08 AC 233 ms
20,304 KB
testcase_09 AC 473 ms
13,056 KB
testcase_10 AC 259 ms
17,676 KB
testcase_11 AC 469 ms
15,232 KB
testcase_12 AC 282 ms
17,004 KB
testcase_13 AC 32 ms
11,008 KB
testcase_14 AC 515 ms
13,952 KB
testcase_15 AC 134 ms
14,704 KB
testcase_16 AC 613 ms
16,768 KB
testcase_17 AC 486 ms
12,800 KB
testcase_18 AC 330 ms
13,944 KB
testcase_19 AC 53 ms
12,160 KB
testcase_20 AC 270 ms
12,032 KB
testcase_21 AC 573 ms
14,176 KB
testcase_22 AC 545 ms
17,048 KB
testcase_23 AC 415 ms
12,544 KB
testcase_24 AC 100 ms
19,756 KB
testcase_25 AC 510 ms
15,008 KB
testcase_26 AC 364 ms
17,736 KB
testcase_27 AC 534 ms
13,928 KB
testcase_28 AC 337 ms
17,772 KB
testcase_29 AC 655 ms
20,680 KB
testcase_30 AC 101 ms
12,672 KB
testcase_31 AC 131 ms
14,708 KB
testcase_32 AC 191 ms
15,708 KB
testcase_33 AC 552 ms
17,456 KB
testcase_34 AC 59 ms
11,392 KB
testcase_35 AC 576 ms
11,904 KB
testcase_36 AC 461 ms
19,680 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_right

n, k = map(int, input().split())
alst = list(map(int, input().split()))
total = sum(alst[:k])
lst = [total]
for i in range(n - k):
    total -= alst[i]
    total += alst[i + k]
    lst.append(total)
lst.sort()

q = int(input())
for _ in range(q):
    print(bisect_right(lst, int(input())))
0