203002026-01-06 08:05:37Alma123456789Bányász RPG (40 pont)python3Runtime error 0/40344ms16936 KiB
n = int(input("Alapanyagok száma: "))
xp = 0
fastxp = list(map(int, input().split()))
req = list(map(int, input().split()))
current = [0]*n
time = 0

for i in range(100):
    if xp >= abs(min(fastxp)):
        farmed = fastxp.index(abs(min(fastxp)))
    else:
        farmed = req.index(abs(max(req)))

    if fastxp[farmed] <= xp:
        current[farmed] += 1
        time += 1
        xp += 1
    else:
        current[farmed] += 1
        time += 2
        xp += 1
    
    if current[farmed] >= req[farmed]:
        fastxp[farmed] = -100001
        req[farmed] = -0.1

print(time)



# Legnagyobb requirementest kezdi farmolni, amíg a legkisebb fastxp-t el nem éri az xp és aztán elkezdi azt farmolni, amíg el nem éri a requirementet és aztán meg a 2. legkisebb fastxp-sre és így tovább.
SubtaskSumTestVerdictTimeMemory
base0/40
1Runtime error0/016ms3324 KiB
2Wrong answer0/082ms5560 KiB
3Wrong answer0/216ms2976 KiB
4Wrong answer0/219ms3116 KiB
5Wrong answer0/265ms5416 KiB
6Wrong answer0/2134ms6612 KiB
7Wrong answer0/228ms3672 KiB
8Wrong answer0/237ms3636 KiB
9Wrong answer0/317ms3124 KiB
10Wrong answer0/316ms3124 KiB
11Wrong answer0/316ms2984 KiB
12Wrong answer0/317ms3008 KiB
13Wrong answer0/418ms3172 KiB
14Wrong answer0/417ms2976 KiB
15Wrong answer0/2245ms9960 KiB
16Wrong answer0/2273ms13488 KiB
17Wrong answer0/2238ms10588 KiB
18Time limit exceeded0/2344ms16936 KiB