結果

問題 No.1093 区間の和 / Sum of Range
ユーザー Konton7Konton7
提出日時 2020-06-26 22:02:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 363 ms / 2,000 ms
コード長 306 bytes
コンパイル時間 300 ms
コンパイル使用メモリ 86,800 KB
実行使用メモリ 91,132 KB
最終ジャッジ日時 2023-09-18 04:38:37
合計ジャッジ時間 10,757 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,308 KB
testcase_01 AC 247 ms
80,988 KB
testcase_02 AC 174 ms
78,020 KB
testcase_03 AC 150 ms
88,572 KB
testcase_04 AC 101 ms
86,716 KB
testcase_05 AC 313 ms
80,236 KB
testcase_06 AC 152 ms
79,660 KB
testcase_07 AC 224 ms
80,012 KB
testcase_08 AC 197 ms
88,136 KB
testcase_09 AC 287 ms
78,796 KB
testcase_10 AC 204 ms
84,464 KB
testcase_11 AC 275 ms
81,244 KB
testcase_12 AC 211 ms
84,972 KB
testcase_13 AC 84 ms
76,212 KB
testcase_14 AC 301 ms
79,376 KB
testcase_15 AC 155 ms
80,732 KB
testcase_16 AC 340 ms
83,164 KB
testcase_17 AC 291 ms
78,216 KB
testcase_18 AC 232 ms
79,456 KB
testcase_19 AC 124 ms
77,816 KB
testcase_20 AC 212 ms
77,964 KB
testcase_21 AC 337 ms
79,604 KB
testcase_22 AC 330 ms
83,680 KB
testcase_23 AC 265 ms
77,872 KB
testcase_24 AC 141 ms
84,688 KB
testcase_25 AC 287 ms
80,724 KB
testcase_26 AC 244 ms
85,368 KB
testcase_27 AC 301 ms
79,804 KB
testcase_28 AC 235 ms
84,676 KB
testcase_29 AC 363 ms
91,132 KB
testcase_30 AC 142 ms
78,024 KB
testcase_31 AC 151 ms
81,128 KB
testcase_32 AC 176 ms
81,288 KB
testcase_33 AC 319 ms
84,572 KB
testcase_34 AC 124 ms
78,508 KB
testcase_35 AC 322 ms
78,184 KB
testcase_36 AC 286 ms
87,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect

n, k = [int(v) for v in input().split()]
a = [int(v) for v in input().split()]
s = sum(a[:k])
s_list = [s]
for i in range(n - k):
    s += (a[k + i] - a[i])
    s_list.append(s)
s_list.sort()

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