結果

問題 No.1093 区間の和 / Sum of Range
ユーザー takakintakakin
提出日時 2020-07-25 21:13:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 235 ms / 2,000 ms
コード長 304 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 10,704 KB
実行使用メモリ 19,800 KB
最終ジャッジ日時 2023-09-09 23:36:07
合計ジャッジ時間 9,291 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,996 KB
testcase_01 AC 128 ms
12,820 KB
testcase_02 AC 59 ms
9,432 KB
testcase_03 AC 83 ms
17,976 KB
testcase_04 AC 67 ms
19,800 KB
testcase_05 AC 166 ms
12,596 KB
testcase_06 AC 52 ms
11,992 KB
testcase_07 AC 100 ms
12,640 KB
testcase_08 AC 114 ms
18,996 KB
testcase_09 AC 135 ms
10,628 KB
testcase_10 AC 110 ms
16,120 KB
testcase_11 AC 157 ms
13,000 KB
testcase_12 AC 126 ms
15,360 KB
testcase_13 AC 18 ms
8,516 KB
testcase_14 AC 163 ms
11,536 KB
testcase_15 AC 62 ms
12,608 KB
testcase_16 AC 201 ms
15,308 KB
testcase_17 AC 147 ms
10,360 KB
testcase_18 AC 115 ms
11,512 KB
testcase_19 AC 28 ms
9,868 KB
testcase_20 AC 88 ms
10,016 KB
testcase_21 AC 182 ms
12,084 KB
testcase_22 AC 195 ms
15,768 KB
testcase_23 AC 122 ms
9,812 KB
testcase_24 AC 63 ms
18,424 KB
testcase_25 AC 145 ms
12,716 KB
testcase_26 AC 148 ms
15,568 KB
testcase_27 AC 165 ms
11,968 KB
testcase_28 AC 132 ms
16,136 KB
testcase_29 AC 235 ms
19,740 KB
testcase_30 AC 44 ms
10,260 KB
testcase_31 AC 67 ms
12,784 KB
testcase_32 AC 79 ms
13,796 KB
testcase_33 AC 196 ms
15,788 KB
testcase_34 AC 28 ms
9,104 KB
testcase_35 AC 167 ms
9,520 KB
testcase_36 AC 188 ms
18,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
import bisect
n,k=map(int,input().split())
A=[int(i) for i in input().split()]

cur=sum(A[:k])
S=[cur]
for i in range(k,n):
	cur+=A[i]-A[i-k]
	S.append(cur)
S.sort()

q=int(input())
for _ in range(q):
	x=int(input())
	print(bisect.bisect_right(S,x))
0