結果

問題 No.1093 区間の和 / Sum of Range
ユーザー pluto77pluto77
提出日時 2020-06-25 11:50:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 632 ms / 2,000 ms
コード長 262 bytes
コンパイル時間 77 ms
コンパイル使用メモリ 10,616 KB
実行使用メモリ 19,660 KB
最終ジャッジ日時 2023-09-16 21:52:54
合計ジャッジ時間 13,414 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
7,852 KB
testcase_01 AC 338 ms
12,744 KB
testcase_02 AC 154 ms
9,424 KB
testcase_03 AC 97 ms
18,020 KB
testcase_04 AC 67 ms
19,096 KB
testcase_05 AC 474 ms
12,584 KB
testcase_06 AC 105 ms
11,708 KB
testcase_07 AC 267 ms
12,596 KB
testcase_08 AC 213 ms
19,084 KB
testcase_09 AC 411 ms
10,688 KB
testcase_10 AC 235 ms
16,084 KB
testcase_11 AC 436 ms
12,824 KB
testcase_12 AC 267 ms
15,456 KB
testcase_13 AC 20 ms
8,324 KB
testcase_14 AC 482 ms
11,664 KB
testcase_15 AC 119 ms
12,560 KB
testcase_16 AC 553 ms
15,336 KB
testcase_17 AC 470 ms
10,316 KB
testcase_18 AC 309 ms
11,528 KB
testcase_19 AC 40 ms
9,796 KB
testcase_20 AC 251 ms
9,748 KB
testcase_21 AC 539 ms
12,216 KB
testcase_22 AC 505 ms
15,768 KB
testcase_23 AC 379 ms
9,860 KB
testcase_24 AC 84 ms
18,536 KB
testcase_25 AC 466 ms
12,700 KB
testcase_26 AC 337 ms
15,548 KB
testcase_27 AC 490 ms
11,700 KB
testcase_28 AC 309 ms
16,160 KB
testcase_29 AC 632 ms
19,660 KB
testcase_30 AC 90 ms
10,348 KB
testcase_31 AC 116 ms
12,680 KB
testcase_32 AC 168 ms
13,692 KB
testcase_33 AC 527 ms
15,728 KB
testcase_34 AC 47 ms
8,920 KB
testcase_35 AC 536 ms
9,544 KB
testcase_36 AC 442 ms
18,492 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki1093
from bisect import *
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_right(s,x))
0