1892021-02-04 00:11:20mraronZenehallgatáspython3Runtime error 15/50289ms51300 KiB
import bisect

def main():
     n, _ = map(int, input().split())
     arr = list(map(int, input().split()))
     qry = list(map(int, input().split()))
     tot = 0

     for i in range(0, n):
          tot += arr[i]
          arr[i] = tot - 1

     for p in qry:
          p = (p - 1) % tot
          print(bisect.bisect_left(arr, p, 0, n) + 1, end = ' ')
     print()

main()
SubtaskSumTestVerdictTimeMemory
base15/50
1Accepted0/043ms14680 KiB
2Runtime error0/0108ms42068 KiB
3Accepted2/235ms16652 KiB
4Accepted2/241ms16712 KiB
5Accepted2/232ms16708 KiB
6Accepted3/330ms16836 KiB
7Accepted3/332ms16744 KiB
8Accepted3/330ms16804 KiB
9Runtime error0/2137ms44740 KiB
10Runtime error0/2111ms45512 KiB
11Runtime error0/2100ms47544 KiB
12Runtime error0/2109ms48816 KiB
13Runtime error0/2119ms50096 KiB
14Runtime error0/2108ms51300 KiB
15Time limit exceeded0/2277ms30880 KiB
16Time limit exceeded0/2266ms31300 KiB
17Time limit exceeded0/2273ms32728 KiB
18Time limit exceeded0/2268ms32664 KiB
19Time limit exceeded0/2273ms32600 KiB
20Time limit exceeded0/2280ms32660 KiB
21Time limit exceeded0/2289ms32664 KiB
22Time limit exceeded0/3263ms32600 KiB
23Time limit exceeded0/3279ms32724 KiB
24Time limit exceeded0/3282ms32664 KiB