結果

問題 No.1093 区間の和 / Sum of Range
ユーザー 37zigen37zigen
提出日時 2020-07-02 06:55:30
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 624 ms / 2,000 ms
コード長 258 bytes
コンパイル時間 130 ms
コンパイル使用メモリ 10,652 KB
実行使用メモリ 19,764 KB
最終ジャッジ日時 2023-10-12 19:09:38
合計ジャッジ時間 14,754 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,968 KB
testcase_01 AC 330 ms
12,720 KB
testcase_02 AC 156 ms
9,352 KB
testcase_03 AC 101 ms
17,864 KB
testcase_04 AC 72 ms
19,764 KB
testcase_05 AC 487 ms
12,936 KB
testcase_06 AC 101 ms
11,728 KB
testcase_07 AC 260 ms
12,568 KB
testcase_08 AC 219 ms
18,900 KB
testcase_09 AC 424 ms
10,564 KB
testcase_10 AC 238 ms
16,080 KB
testcase_11 AC 436 ms
12,956 KB
testcase_12 AC 268 ms
15,304 KB
testcase_13 AC 20 ms
8,460 KB
testcase_14 AC 489 ms
11,732 KB
testcase_15 AC 124 ms
12,624 KB
testcase_16 AC 567 ms
15,288 KB
testcase_17 AC 477 ms
10,292 KB
testcase_18 AC 315 ms
11,572 KB
testcase_19 AC 41 ms
9,820 KB
testcase_20 AC 250 ms
9,808 KB
testcase_21 AC 543 ms
12,200 KB
testcase_22 AC 522 ms
15,804 KB
testcase_23 AC 393 ms
9,868 KB
testcase_24 AC 88 ms
18,352 KB
testcase_25 AC 463 ms
12,680 KB
testcase_26 AC 340 ms
15,572 KB
testcase_27 AC 492 ms
11,800 KB
testcase_28 AC 322 ms
16,052 KB
testcase_29 AC 624 ms
19,656 KB
testcase_30 AC 90 ms
10,244 KB
testcase_31 AC 118 ms
12,736 KB
testcase_32 AC 170 ms
13,636 KB
testcase_33 AC 519 ms
15,784 KB
testcase_34 AC 47 ms
9,072 KB
testcase_35 AC 540 ms
9,432 KB
testcase_36 AC 443 ms
18,492 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
N,K=map(int,input().split())
a=[int(x) for x in input().split()]
S=[0]*(N-K+1)
S[0]=sum(a[:K])
for i in range(1,len(S)):
    S[i]=S[i-1]-a[i-1]+a[K+i-1]
S.sort()
Q=int(input())
for i in range(Q):
    x=int(input())
    print(bisect.bisect(S,x))
0