結果

問題 No.1093 区間の和 / Sum of Range
ユーザー kbyskbys
提出日時 2020-07-01 06:22:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 840 ms / 2,000 ms
コード長 254 bytes
コンパイル時間 161 ms
コンパイル使用メモリ 10,728 KB
実行使用メモリ 40,848 KB
最終ジャッジ日時 2023-10-11 21:58:32
合計ジャッジ時間 19,696 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
29,736 KB
testcase_01 AC 493 ms
34,288 KB
testcase_02 AC 299 ms
31,176 KB
testcase_03 AC 184 ms
39,376 KB
testcase_04 AC 177 ms
40,360 KB
testcase_05 AC 682 ms
33,936 KB
testcase_06 AC 231 ms
33,736 KB
testcase_07 AC 425 ms
33,840 KB
testcase_08 AC 347 ms
40,396 KB
testcase_09 AC 604 ms
32,644 KB
testcase_10 AC 378 ms
37,440 KB
testcase_11 AC 648 ms
34,252 KB
testcase_12 AC 399 ms
36,740 KB
testcase_13 AC 138 ms
30,024 KB
testcase_14 AC 701 ms
33,412 KB
testcase_15 AC 247 ms
33,880 KB
testcase_16 AC 780 ms
36,392 KB
testcase_17 AC 678 ms
31,940 KB
testcase_18 AC 482 ms
33,220 KB
testcase_19 AC 163 ms
31,392 KB
testcase_20 AC 418 ms
31,356 KB
testcase_21 AC 753 ms
34,180 KB
testcase_22 AC 730 ms
36,612 KB
testcase_23 AC 581 ms
31,832 KB
testcase_24 AC 208 ms
39,592 KB
testcase_25 AC 659 ms
34,268 KB
testcase_26 AC 511 ms
37,484 KB
testcase_27 AC 724 ms
33,660 KB
testcase_28 AC 479 ms
37,432 KB
testcase_29 AC 840 ms
40,848 KB
testcase_30 AC 214 ms
31,620 KB
testcase_31 AC 239 ms
34,136 KB
testcase_32 AC 311 ms
34,956 KB
testcase_33 AC 726 ms
37,196 KB
testcase_34 AC 168 ms
30,740 KB
testcase_35 AC 780 ms
31,372 KB
testcase_36 AC 628 ms
39,664 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
import bisect

n, k = map(int,input().split())
A = list(map(int,input().split()))
Q = int(input())

c = np.cumsum([0]+A)
wide = c[k:] - c[:-k]
wide.sort()

for i in range(Q):
    x = int(input())
    print(bisect.bisect_right(wide, x))
0