結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,000 KB
testcase_01 AC 576 ms
12,852 KB
testcase_02 AC 247 ms
9,616 KB
testcase_03 AC 110 ms
17,700 KB
testcase_04 AC 73 ms
19,168 KB
testcase_05 AC 881 ms
12,620 KB
testcase_06 AC 161 ms
11,876 KB
testcase_07 AC 446 ms
12,960 KB
testcase_08 AC 340 ms
19,220 KB
testcase_09 AC 693 ms
10,680 KB
testcase_10 AC 393 ms
16,368 KB
testcase_11 AC 777 ms
12,996 KB
testcase_12 AC 443 ms
15,512 KB
testcase_13 AC 20 ms
8,524 KB
testcase_14 AC 864 ms
11,760 KB
testcase_15 AC 187 ms
12,852 KB
testcase_16 AC 1,045 ms
15,412 KB
testcase_17 AC 797 ms
10,372 KB
testcase_18 AC 583 ms
11,576 KB
testcase_19 AC 52 ms
10,000 KB
testcase_20 AC 425 ms
9,880 KB
testcase_21 AC 966 ms
12,156 KB
testcase_22 AC 956 ms
15,872 KB
testcase_23 AC 653 ms
10,056 KB
testcase_24 AC 115 ms
19,068 KB
testcase_25 AC 692 ms
13,268 KB
testcase_26 AC 596 ms
15,588 KB
testcase_27 AC 919 ms
11,864 KB
testcase_28 AC 550 ms
16,152 KB
testcase_29 AC 1,139 ms
19,872 KB
testcase_30 AC 140 ms
10,180 KB
testcase_31 AC 182 ms
12,812 KB
testcase_32 AC 296 ms
13,724 KB
testcase_33 AC 958 ms
15,780 KB
testcase_34 AC 63 ms
9,128 KB
testcase_35 AC 983 ms
9,464 KB
testcase_36 AC 776 ms
18,512 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[0: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