1
2
3
4
5
6
7
8
9
10
11
|
import sys
n,q = map(int,sys.stdin.readline().split())
tmp=[0]
cnt=0
for i in range(n):
cnt+= int(sys.stdin.readline())
tmp.append(cnt)
for i in range(q):
test=int(sys.stdin.readline())
for _ in range(len(tmp)):
if tmp[_]<= test and test <tmp[_+1]: print(_+1)
|
cs |
반응형
댓글