125752024-12-23 19:24:07lengyelaZenehallgatáspython3Wrong answer 0/50300ms18300 KiB
dalok_szama, idok_szama = [int(i) for i in input().split()]

dalok = [int(i) for i in input().split()]
idopontok = [int(i) for i in input().split()]

dalok_sum = sum(dalok)

sorszamok = []

for idopont in idopontok:
    while idopont > dalok_sum:
        idopont -= dalok_sum

    szum = 0
    for i in range(dalok_szama):
        szum += dalok[i]
        if szum >= idopont:
            sorszamok.append(i+1)
            break
    
print(sorszamok)
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/016ms3144 KiB
2Time limit exceeded0/0287ms18300 KiB
3Wrong answer0/2128ms3300 KiB
4Wrong answer0/2136ms3128 KiB
5Time limit exceeded0/2243ms3128 KiB
6Time limit exceeded0/3280ms3128 KiB
7Time limit exceeded0/3300ms3128 KiB
8Time limit exceeded0/3286ms3128 KiB
9Time limit exceeded0/2300ms18072 KiB
10Time limit exceeded0/2282ms17892 KiB
11Time limit exceeded0/2300ms17984 KiB
12Time limit exceeded0/2280ms17600 KiB
13Time limit exceeded0/2300ms17368 KiB
14Time limit exceeded0/2284ms17208 KiB
15Time limit exceeded0/2300ms16040 KiB
16Time limit exceeded0/2282ms15672 KiB
17Time limit exceeded0/2300ms15792 KiB
18Time limit exceeded0/2291ms14936 KiB
19Time limit exceeded0/2300ms15060 KiB
20Time limit exceeded0/2284ms15040 KiB
21Time limit exceeded0/2300ms14912 KiB
22Time limit exceeded0/3282ms15032 KiB
23Time limit exceeded0/3300ms15004 KiB
24Time limit exceeded0/3280ms14996 KiB