結果

問題 No.1093 区間の和 / Sum of Range
ユーザー 双六双六
提出日時 2020-08-08 02:45:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 339 ms / 2,000 ms
コード長 584 bytes
コンパイル時間 215 ms
コンパイル使用メモリ 81,936 KB
実行使用メモリ 101,732 KB
最終ジャッジ日時 2023-10-25 10:24:27
合計ジャッジ時間 11,919 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
55,544 KB
testcase_01 AC 223 ms
83,812 KB
testcase_02 AC 155 ms
77,008 KB
testcase_03 AC 133 ms
97,572 KB
testcase_04 AC 81 ms
93,684 KB
testcase_05 AC 285 ms
82,212 KB
testcase_06 AC 128 ms
80,900 KB
testcase_07 AC 194 ms
82,028 KB
testcase_08 AC 181 ms
98,336 KB
testcase_09 AC 257 ms
78,264 KB
testcase_10 AC 188 ms
90,464 KB
testcase_11 AC 248 ms
84,144 KB
testcase_12 AC 187 ms
90,052 KB
testcase_13 AC 56 ms
64,060 KB
testcase_14 AC 273 ms
80,532 KB
testcase_15 AC 133 ms
82,356 KB
testcase_16 AC 305 ms
88,440 KB
testcase_17 AC 256 ms
77,428 KB
testcase_18 AC 203 ms
80,500 KB
testcase_19 AC 97 ms
76,732 KB
testcase_20 AC 181 ms
76,796 KB
testcase_21 AC 303 ms
80,988 KB
testcase_22 AC 311 ms
88,740 KB
testcase_23 AC 251 ms
76,800 KB
testcase_24 AC 128 ms
92,928 KB
testcase_25 AC 266 ms
82,580 KB
testcase_26 AC 223 ms
91,720 KB
testcase_27 AC 274 ms
80,700 KB
testcase_28 AC 218 ms
90,984 KB
testcase_29 AC 339 ms
101,732 KB
testcase_30 AC 118 ms
77,256 KB
testcase_31 AC 130 ms
83,044 KB
testcase_32 AC 156 ms
84,448 KB
testcase_33 AC 291 ms
90,440 KB
testcase_34 AC 101 ms
76,892 KB
testcase_35 AC 291 ms
77,024 KB
testcase_36 AC 264 ms
96,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# import sys; input = sys.stdin.buffer.readline
# sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")
import bisect

def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	N, K = getlist()
	A = getlist()
	Asum = [0]
	for i in range(N):
		Asum.append(Asum[-1] + A[i])

	S = []
	for i in range(N - K + 1):
		S.append(Asum[i + K] - Asum[i])

	S.sort()
	# print(S)

	Q = int(input())
	for i in range(Q):
		x = int(input())
		ans = bisect.bisect_left(S, x + 1)
		print(ans)


if __name__ == '__main__':
	main()
0