結果

問題 No.1093 区間の和 / Sum of Range
ユーザー syunsukesyunsuke
提出日時 2020-09-01 22:16:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 304 ms / 2,000 ms
コード長 287 bytes
コンパイル時間 302 ms
コンパイル使用メモリ 82,452 KB
実行使用メモリ 99,280 KB
最終ジャッジ日時 2024-04-30 21:11:49
合計ジャッジ時間 9,857 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
53,364 KB
testcase_01 AC 196 ms
83,360 KB
testcase_02 AC 135 ms
77,064 KB
testcase_03 AC 120 ms
96,468 KB
testcase_04 AC 68 ms
88,020 KB
testcase_05 AC 258 ms
81,540 KB
testcase_06 AC 114 ms
80,048 KB
testcase_07 AC 172 ms
81,104 KB
testcase_08 AC 157 ms
95,428 KB
testcase_09 AC 224 ms
78,120 KB
testcase_10 AC 167 ms
89,168 KB
testcase_11 AC 228 ms
83,356 KB
testcase_12 AC 166 ms
90,512 KB
testcase_13 AC 47 ms
63,356 KB
testcase_14 AC 244 ms
80,724 KB
testcase_15 AC 117 ms
81,768 KB
testcase_16 AC 274 ms
87,904 KB
testcase_17 AC 241 ms
77,476 KB
testcase_18 AC 182 ms
80,656 KB
testcase_19 AC 81 ms
77,044 KB
testcase_20 AC 165 ms
77,060 KB
testcase_21 AC 267 ms
80,124 KB
testcase_22 AC 279 ms
88,136 KB
testcase_23 AC 210 ms
77,076 KB
testcase_24 AC 105 ms
89,000 KB
testcase_25 AC 238 ms
81,756 KB
testcase_26 AC 210 ms
91,108 KB
testcase_27 AC 258 ms
80,452 KB
testcase_28 AC 201 ms
89,940 KB
testcase_29 AC 304 ms
99,280 KB
testcase_30 AC 100 ms
77,764 KB
testcase_31 AC 114 ms
83,868 KB
testcase_32 AC 137 ms
83,192 KB
testcase_33 AC 264 ms
89,024 KB
testcase_34 AC 85 ms
77,088 KB
testcase_35 AC 276 ms
77,672 KB
testcase_36 AC 250 ms
94,668 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())
l=list(map(int,input().split()))
L=[sum(l[:K])]

for i in range(N-K):
    A=L[-1]+l[K+i]-l[i]
    L.append(A)
L.sort()
L=[-10**20]+L+[10**20]
#print(L)

import bisect

Q=int(input())
for i in range(Q):
    n=int(input())
    print(bisect.bisect_right(L,n)-1)
0