結果

問題 No.1093 区間の和 / Sum of Range
ユーザー tanon710tanon710
提出日時 2020-07-08 00:22:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 151 ms / 2,000 ms
コード長 385 bytes
コンパイル時間 184 ms
コンパイル使用メモリ 82,372 KB
実行使用メモリ 96,508 KB
最終ジャッジ日時 2024-04-09 21:59:45
合計ジャッジ時間 5,644 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
52,964 KB
testcase_01 AC 116 ms
81,744 KB
testcase_02 AC 89 ms
76,488 KB
testcase_03 AC 102 ms
93,116 KB
testcase_04 AC 69 ms
85,276 KB
testcase_05 AC 124 ms
81,024 KB
testcase_06 AC 83 ms
80,084 KB
testcase_07 AC 103 ms
80,616 KB
testcase_08 AC 114 ms
93,056 KB
testcase_09 AC 113 ms
78,032 KB
testcase_10 AC 108 ms
87,524 KB
testcase_11 AC 104 ms
82,180 KB
testcase_12 AC 105 ms
87,464 KB
testcase_13 AC 45 ms
61,468 KB
testcase_14 AC 108 ms
79,392 KB
testcase_15 AC 81 ms
80,508 KB
testcase_16 AC 126 ms
85,948 KB
testcase_17 AC 96 ms
77,224 KB
testcase_18 AC 94 ms
79,372 KB
testcase_19 AC 63 ms
73,680 KB
testcase_20 AC 87 ms
76,620 KB
testcase_21 AC 120 ms
79,720 KB
testcase_22 AC 134 ms
85,964 KB
testcase_23 AC 99 ms
76,800 KB
testcase_24 AC 84 ms
88,336 KB
testcase_25 AC 98 ms
81,448 KB
testcase_26 AC 113 ms
88,692 KB
testcase_27 AC 105 ms
79,708 KB
testcase_28 AC 109 ms
88,008 KB
testcase_29 AC 151 ms
96,508 KB
testcase_30 AC 73 ms
77,232 KB
testcase_31 AC 85 ms
81,688 KB
testcase_32 AC 87 ms
81,940 KB
testcase_33 AC 128 ms
87,536 KB
testcase_34 AC 61 ms
74,060 KB
testcase_35 AC 103 ms
76,580 KB
testcase_36 AC 127 ms
91,876 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3

import bisect
import sys
input=sys.stdin.readline

n,k=map(int,input().split())
arr=list(map(int,input().split()))
vals=[]
tmp=sum(arr[:k])
vals.append(tmp)
for i in range(k,n):
    tmp+=arr[i]
    tmp-=arr[i-k]
    vals.append(tmp)
vals=sorted(vals)
q=int(input())
for _ in range(q):
    x=int(input())
    print(bisect.bisect_right(vals,x))
0