結果
| 問題 | No.1093 区間の和 / Sum of Range |
| ユーザー |
|
| 提出日時 | 2024-12-09 08:58:56 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 234 ms / 2,000 ms |
| コード長 | 308 bytes |
| 記録 | |
| コンパイル時間 | 189 ms |
| コンパイル使用メモリ | 85,432 KB |
| 実行使用メモリ | 101,760 KB |
| 最終ジャッジ日時 | 2026-05-24 18:10:54 |
| 合計ジャッジ時間 | 8,820 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 36 |
ソースコード
from bisect import bisect_right
N,K = map(int,input().split())
A = list(map(int,input().split()))
S = []
cnt = sum(A[:K])
S.append(cnt)
for i in range(1,N-K+1):
cnt = cnt-A[i-1]+A[i+K-1]
S.append(cnt)
S = sorted(S)
Q = int(input())
for _ in range(Q):
x = int(input())
print(bisect_right(S,x))