203012026-01-06 08:06:16Alma123456789Bányász RPG (40 pont)pypy3Runtime error 0/4075ms32000 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/067ms22752 KiB
2Wrong answer0/063ms22496 KiB
3Wrong answer0/245ms21464 KiB
4Wrong answer0/252ms21572 KiB
5Wrong answer0/254ms22296 KiB
6Wrong answer0/264ms25244 KiB
7Wrong answer0/254ms21656 KiB
8Wrong answer0/257ms21600 KiB
9Wrong answer0/339ms19436 KiB
10Wrong answer0/352ms21420 KiB
11Wrong answer0/352ms21400 KiB
12Wrong answer0/346ms21420 KiB
13Wrong answer0/456ms21572 KiB
14Wrong answer0/446ms21436 KiB
15Runtime error0/264ms32000 KiB
16Runtime error0/275ms32000 KiB
17Runtime error0/272ms32000 KiB
18Runtime error0/267ms32000 KiB