結果

問題 No.1093 区間の和 / Sum of Range
ユーザー trineutrontrineutron
提出日時 2020-06-24 07:26:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 605 ms / 2,000 ms
コード長 296 bytes
コンパイル時間 483 ms
コンパイル使用メモリ 10,468 KB
実行使用メモリ 19,652 KB
最終ジャッジ日時 2023-09-16 20:48:45
合計ジャッジ時間 12,633 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,948 KB
testcase_01 AC 318 ms
12,928 KB
testcase_02 AC 146 ms
9,504 KB
testcase_03 AC 89 ms
17,888 KB
testcase_04 AC 62 ms
19,168 KB
testcase_05 AC 438 ms
12,588 KB
testcase_06 AC 96 ms
11,888 KB
testcase_07 AC 251 ms
12,696 KB
testcase_08 AC 195 ms
19,140 KB
testcase_09 AC 379 ms
10,596 KB
testcase_10 AC 225 ms
16,196 KB
testcase_11 AC 420 ms
12,796 KB
testcase_12 AC 248 ms
15,456 KB
testcase_13 AC 17 ms
8,356 KB
testcase_14 AC 462 ms
11,664 KB
testcase_15 AC 114 ms
12,636 KB
testcase_16 AC 516 ms
15,420 KB
testcase_17 AC 451 ms
10,388 KB
testcase_18 AC 299 ms
11,676 KB
testcase_19 AC 38 ms
9,840 KB
testcase_20 AC 244 ms
9,700 KB
testcase_21 AC 505 ms
12,240 KB
testcase_22 AC 541 ms
15,796 KB
testcase_23 AC 350 ms
9,920 KB
testcase_24 AC 79 ms
18,536 KB
testcase_25 AC 445 ms
12,668 KB
testcase_26 AC 315 ms
15,640 KB
testcase_27 AC 478 ms
11,708 KB
testcase_28 AC 305 ms
16,072 KB
testcase_29 AC 605 ms
19,652 KB
testcase_30 AC 92 ms
10,328 KB
testcase_31 AC 112 ms
12,784 KB
testcase_32 AC 164 ms
13,804 KB
testcase_33 AC 492 ms
15,884 KB
testcase_34 AC 45 ms
8,960 KB
testcase_35 AC 522 ms
9,552 KB
testcase_36 AC 418 ms
18,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
n, k = map(int, input().split())
a = list(map(int, input().split()))
s = [0] * (n - k + 1)
s[0] = sum(a[:k])
for i in range(1, n - k + 1):
    s[i] = s[i - 1] + a[i + k - 1] - a[i - 1]
s.sort()
q = int(input())
for i in range(q):
    x = int(input())
    print(bisect.bisect(s, x))
0