11590 | 2024-10-27 19:54:09 | balint | Jobstown-i milliomos | python3 | Wrong answer 16/100 | 17ms | 3496 KiB |
def main():
got_money = 0
N, time_left = map(int, input().split())
times = list(map(int, input().split()))
moneys = list(map(int, input().split()))
ratios = [(money / time, time, money) for time, money in zip(times, moneys)]
ratios.sort(key=lambda x: x[0], reverse=True) # sorts based on each element's ratio
for ratio, time, money in ratios:
if time_left >= time:
job_usage = time_left // time
time_left -= job_usage * time
got_money += job_usage * money
print(got_money)
main()
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 17ms | 3128 KiB | ||||
2 | Accepted | 16ms | 2960 KiB | ||||
subtask2 | 0/25 | ||||||
3 | Accepted | 17ms | 3128 KiB | ||||
4 | Accepted | 16ms | 3128 KiB | ||||
5 | Wrong answer | 17ms | 3260 KiB | ||||
6 | Wrong answer | 16ms | 3212 KiB | ||||
7 | Wrong answer | 17ms | 3276 KiB | ||||
8 | Wrong answer | 17ms | 3272 KiB | ||||
9 | Accepted | 16ms | 3136 KiB | ||||
10 | Accepted | 16ms | 3184 KiB | ||||
11 | Accepted | 17ms | 3236 KiB | ||||
12 | Accepted | 17ms | 3184 KiB | ||||
13 | Accepted | 17ms | 3272 KiB | ||||
14 | Accepted | 16ms | 3128 KiB | ||||
subtask3 | 16/16 | ||||||
15 | Accepted | 17ms | 3128 KiB | ||||
16 | Accepted | 16ms | 3236 KiB | ||||
17 | Accepted | 17ms | 3140 KiB | ||||
18 | Accepted | 17ms | 3128 KiB | ||||
19 | Accepted | 17ms | 3128 KiB | ||||
20 | Accepted | 16ms | 3144 KiB | ||||
21 | Accepted | 16ms | 3320 KiB | ||||
subtask4 | 0/59 | ||||||
22 | Accepted | 16ms | 3136 KiB | ||||
23 | Accepted | 17ms | 3128 KiB | ||||
24 | Wrong answer | 16ms | 3496 KiB | ||||
25 | Wrong answer | 16ms | 3128 KiB | ||||
26 | Wrong answer | 17ms | 3128 KiB | ||||
27 | Accepted | 17ms | 3192 KiB | ||||
28 | Accepted | 16ms | 3320 KiB | ||||
29 | Accepted | 17ms | 3240 KiB | ||||
30 | Accepted | 17ms | 3092 KiB | ||||
31 | Accepted | 16ms | 3064 KiB | ||||
32 | Wrong answer | 17ms | 3064 KiB | ||||
33 | Wrong answer | 16ms | 3216 KiB |