225592026-01-15 11:12:43vyrallBányász RPG (40 pont)python3Wrong answer 0/40237ms19400 KiB
n = int(input())
lvls = list(map(int, input().split()))
needed = list(map(int, input().split()))
mats = [[lvls[i], needed[i]] for i in range(n)]
mats.sort(key=lambda x: x[0])
lvl = 0
time = 0

l = 0
r = len(mats) - 1

while l <= r:
    if mats[l][0] <= lvl:
        time += mats[l][1]
        l += 1
    else:
        time += 2*mats[r][1]
        r -= 1
    lvl += 1

print(time)
SubtaskSumTestVerdictTimeMemory
base0/40
1Wrong answer0/016ms3316 KiB
2Wrong answer0/043ms5944 KiB
3Wrong answer0/216ms3116 KiB
4Wrong answer0/217ms3212 KiB
5Wrong answer0/234ms5412 KiB
6Wrong answer0/259ms7504 KiB
7Wrong answer0/220ms3656 KiB
8Wrong answer0/221ms3892 KiB
9Wrong answer0/316ms3120 KiB
10Wrong answer0/316ms3128 KiB
11Wrong answer0/317ms3092 KiB
12Wrong answer0/317ms3216 KiB
13Wrong answer0/417ms3124 KiB
14Wrong answer0/417ms3124 KiB
15Wrong answer0/2128ms12020 KiB
16Wrong answer0/2174ms16024 KiB
17Wrong answer0/2115ms12752 KiB
18Wrong answer0/2237ms19400 KiB