結果

問題 No.1093 区間の和 / Sum of Range
ユーザー ch1channnch1channn
提出日時 2022-12-14 12:01:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 320 ms / 2,000 ms
コード長 484 bytes
コンパイル時間 179 ms
コンパイル使用メモリ 82,464 KB
実行使用メモリ 96,344 KB
最終ジャッジ日時 2024-04-25 16:18:13
合計ジャッジ時間 9,675 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,156 KB
testcase_01 AC 209 ms
81,924 KB
testcase_02 AC 140 ms
76,984 KB
testcase_03 AC 116 ms
93,036 KB
testcase_04 AC 68 ms
85,444 KB
testcase_05 AC 264 ms
81,256 KB
testcase_06 AC 115 ms
80,104 KB
testcase_07 AC 181 ms
80,744 KB
testcase_08 AC 162 ms
92,632 KB
testcase_09 AC 244 ms
78,580 KB
testcase_10 AC 172 ms
87,188 KB
testcase_11 AC 233 ms
81,904 KB
testcase_12 AC 169 ms
87,232 KB
testcase_13 AC 48 ms
62,824 KB
testcase_14 AC 261 ms
80,040 KB
testcase_15 AC 116 ms
80,984 KB
testcase_16 AC 294 ms
85,692 KB
testcase_17 AC 243 ms
77,240 KB
testcase_18 AC 190 ms
79,648 KB
testcase_19 AC 87 ms
76,848 KB
testcase_20 AC 169 ms
76,864 KB
testcase_21 AC 289 ms
80,456 KB
testcase_22 AC 288 ms
86,268 KB
testcase_23 AC 225 ms
77,100 KB
testcase_24 AC 108 ms
88,296 KB
testcase_25 AC 252 ms
81,408 KB
testcase_26 AC 204 ms
88,716 KB
testcase_27 AC 263 ms
80,244 KB
testcase_28 AC 197 ms
87,916 KB
testcase_29 AC 320 ms
96,344 KB
testcase_30 AC 105 ms
77,384 KB
testcase_31 AC 118 ms
81,788 KB
testcase_32 AC 141 ms
82,404 KB
testcase_33 AC 282 ms
87,120 KB
testcase_34 AC 88 ms
77,156 KB
testcase_35 AC 280 ms
77,376 KB
testcase_36 AC 247 ms
91,608 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
if sys.platform =='ios':
	import clipboard
	a=clipboard.get()
	a = a.split('\n')
	text = '\n'.join(a)
	with open('input_file.txt','w') as f:
		f.write(text)
	sys.stdin = open('input_file.txt')
	
from bisect import bisect_right
n,k = map(int,input().split())
a = list(map(int,input().split()))
A = sum(a[:k])
s = []
s.append(A)

for i in range(n-k):
	A = A-a[i]+a[k+i]
	s.append(A)	
s.sort()
q = int(input())
for i in range(q):
	m = int(input())
	print(bisect_right(s,m))
	
0