117162024-11-07 16:15:41balintZenehallgatáspython3Time limit exceeded 15/50300ms15832 KiB
def main():
    N, K = map(int, input().split())
    lengths = list(map(int, input().split()))
    sumed = sum(lengths)
    returning = []
    for i in map(int, input().split()):
        num = i % sumed
        len_idx = 0
        while num > 0:
            num -= lengths[len_idx]
            len_idx += 1
        returning.append(len_idx)
    print(*returning)


main()
SubtaskSumTestVerdictTimeMemory
base15/50
1Accepted0/016ms3056 KiB
2Time limit exceeded0/0291ms15832 KiB
3Accepted2/254ms3132 KiB
4Accepted2/254ms3136 KiB
5Accepted2/252ms3260 KiB
6Accepted3/352ms3128 KiB
7Accepted3/357ms3128 KiB
8Accepted3/352ms3096 KiB
9Time limit exceeded0/2277ms15316 KiB
10Time limit exceeded0/2298ms15328 KiB
11Time limit exceeded0/2298ms15332 KiB
12Time limit exceeded0/2282ms15088 KiB
13Time limit exceeded0/2273ms14708 KiB
14Time limit exceeded0/2298ms14928 KiB
15Time limit exceeded0/2300ms13448 KiB
16Time limit exceeded0/2284ms13568 KiB
17Time limit exceeded0/2279ms13276 KiB
18Time limit exceeded0/2298ms12324 KiB
19Time limit exceeded0/2300ms12372 KiB
20Time limit exceeded0/2284ms12444 KiB
21Time limit exceeded0/2277ms12224 KiB
22Time limit exceeded0/3298ms12500 KiB
23Time limit exceeded0/3298ms12444 KiB
24Time limit exceeded0/3275ms12444 KiB