結果

問題 No.1093 区間の和 / Sum of Range
ユーザー 37zigen37zigen
提出日時 2020-07-02 06:44:55
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,137 ms / 2,000 ms
コード長 353 bytes
コンパイル時間 184 ms
コンパイル使用メモリ 10,792 KB
実行使用メモリ 19,812 KB
最終ジャッジ日時 2023-10-12 18:56:36
合計ジャッジ時間 21,524 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,840 KB
testcase_01 AC 557 ms
12,956 KB
testcase_02 AC 241 ms
9,424 KB
testcase_03 AC 106 ms
17,584 KB
testcase_04 AC 70 ms
19,160 KB
testcase_05 AC 834 ms
12,944 KB
testcase_06 AC 156 ms
11,952 KB
testcase_07 AC 437 ms
12,820 KB
testcase_08 AC 343 ms
19,124 KB
testcase_09 AC 687 ms
10,764 KB
testcase_10 AC 384 ms
16,312 KB
testcase_11 AC 756 ms
12,856 KB
testcase_12 AC 449 ms
15,392 KB
testcase_13 AC 20 ms
8,620 KB
testcase_14 AC 868 ms
11,536 KB
testcase_15 AC 189 ms
12,820 KB
testcase_16 AC 1,049 ms
15,332 KB
testcase_17 AC 792 ms
10,528 KB
testcase_18 AC 539 ms
11,680 KB
testcase_19 AC 51 ms
9,856 KB
testcase_20 AC 422 ms
10,004 KB
testcase_21 AC 940 ms
12,152 KB
testcase_22 AC 973 ms
15,716 KB
testcase_23 AC 615 ms
9,916 KB
testcase_24 AC 112 ms
18,900 KB
testcase_25 AC 684 ms
13,216 KB
testcase_26 AC 588 ms
15,560 KB
testcase_27 AC 903 ms
11,860 KB
testcase_28 AC 537 ms
16,104 KB
testcase_29 AC 1,137 ms
19,812 KB
testcase_30 AC 134 ms
10,220 KB
testcase_31 AC 176 ms
12,680 KB
testcase_32 AC 278 ms
13,740 KB
testcase_33 AC 958 ms
15,828 KB
testcase_34 AC 64 ms
8,968 KB
testcase_35 AC 978 ms
9,584 KB
testcase_36 AC 794 ms
18,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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())
    u=len(S)
    v=-1
    while u-v>1:
        m=(u+v)//2
        if S[m]<=x:
            v=m
        else:
            u=m
    print(v+1)
0