結果

問題 No.1093 区間の和 / Sum of Range
ユーザー rlangevinrlangevin
提出日時 2023-01-12 20:01:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 181 ms / 2,000 ms
コード長 333 bytes
コンパイル時間 562 ms
コンパイル使用メモリ 86,912 KB
実行使用メモリ 96,596 KB
最終ジャッジ日時 2023-08-25 01:28:08
合計ジャッジ時間 10,371 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,388 KB
testcase_01 AC 143 ms
83,220 KB
testcase_02 AC 118 ms
78,280 KB
testcase_03 AC 127 ms
93,068 KB
testcase_04 AC 103 ms
91,624 KB
testcase_05 AC 154 ms
82,384 KB
testcase_06 AC 113 ms
80,548 KB
testcase_07 AC 135 ms
82,176 KB
testcase_08 AC 145 ms
93,432 KB
testcase_09 AC 145 ms
79,128 KB
testcase_10 AC 141 ms
88,144 KB
testcase_11 AC 131 ms
83,000 KB
testcase_12 AC 136 ms
88,036 KB
testcase_13 AC 83 ms
76,212 KB
testcase_14 AC 141 ms
81,240 KB
testcase_15 AC 113 ms
82,200 KB
testcase_16 AC 159 ms
86,352 KB
testcase_17 AC 128 ms
78,572 KB
testcase_18 AC 128 ms
80,856 KB
testcase_19 AC 100 ms
77,544 KB
testcase_20 AC 121 ms
77,764 KB
testcase_21 AC 151 ms
81,612 KB
testcase_22 AC 166 ms
86,744 KB
testcase_23 AC 133 ms
77,948 KB
testcase_24 AC 119 ms
89,252 KB
testcase_25 AC 132 ms
82,060 KB
testcase_26 AC 147 ms
89,416 KB
testcase_27 AC 138 ms
80,568 KB
testcase_28 AC 142 ms
88,428 KB
testcase_29 AC 181 ms
96,596 KB
testcase_30 AC 104 ms
77,876 KB
testcase_31 AC 115 ms
83,028 KB
testcase_32 AC 125 ms
83,624 KB
testcase_33 AC 160 ms
87,804 KB
testcase_34 AC 96 ms
77,504 KB
testcase_35 AC 135 ms
77,668 KB
testcase_36 AC 158 ms
92,156 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline = sys.stdin.readline
from bisect import *

N, K = map(int, readline().split())
A = list(map(int, readline().split()))
v = sum(A[:K])
L = [v]
for i in range(K, N):
    v -= A[i - K]
    v += A[i]
    L.append(v)
L.sort()

Q = int(readline())
for _ in range(Q):
    x = int(readline())
    print(bisect_right(L, x))
0