| Task: | Entrepreneur |
| Sender: | aalto26aw_006 |
| Submission time: | 2026-09-02 16:44:04 +0300 |
| Language: | Python3 (PyPy3) |
| Status: | READY |
| Result: | WRONG ANSWER |
| test | verdict | time | |
|---|---|---|---|
| #1 | ACCEPTED | 0.04 s | details |
| #2 | ACCEPTED | 0.04 s | details |
| #3 | ACCEPTED | 0.04 s | details |
| #4 | WRONG ANSWER | 0.04 s | details |
| #5 | WRONG ANSWER | 0.04 s | details |
| #6 | WRONG ANSWER | 0.04 s | details |
| #7 | WRONG ANSWER | 0.04 s | details |
| #8 | WRONG ANSWER | 0.09 s | details |
| #9 | ACCEPTED | 0.15 s | details |
| #10 | WRONG ANSWER | 0.15 s | details |
| #11 | WRONG ANSWER | 0.04 s | details |
| #12 | WRONG ANSWER | 0.04 s | details |
| #13 | ACCEPTED | 0.04 s | details |
| #14 | ACCEPTED | 0.04 s | details |
Code
import math
n, t = input().split()
n = int(n)
t = int(t)
ks = input().split()
ks = [int(k) for k in ks]
# print(n,t,ks)
estimated = sum([(1/k) for k in ks])
lowest_time = math.ceil(t / estimated)
cars_done = 0
cost_one_more = []
for k in ks:
machine_done = lowest_time // k
time_one_more = (machine_done + 1) * k
cost = time_one_more - lowest_time
cars_done += machine_done
cost_one_more.append(cost)
cost_one_more.sort()
needed = t - cars_done
total_time = lowest_time + cost_one_more[needed- 1]
# print(needed, cost_one_more)
print(total_time)
Test details
Test 1
Verdict: ACCEPTED
| input |
|---|
| 10 10 6 5 1 2 1 5 10 4 6 6 |
| correct output |
|---|
| 4 |
| user output |
|---|
| 4 |
Test 2
Verdict: ACCEPTED
| input |
|---|
| 10 10 6 6 4 3 4 9 3 2 6 10 |
| correct output |
|---|
| 6 |
| user output |
|---|
| 6 |
Test 3
Verdict: ACCEPTED
| input |
|---|
| 10 10 5 4 10 7 8 4 1 8 9 2 |
| correct output |
|---|
| 5 |
| user output |
|---|
| 5 |
Test 4
Verdict: WRONG ANSWER
| input |
|---|
| 1 1000000000 1 |
| correct output |
|---|
| 1000000000 |
| user output |
|---|
| 1000000001 |
Feedback: Incorrect character on line 1 col 10: expected "1000000000", got "1000000001"
Test 5
Verdict: WRONG ANSWER
| input |
|---|
| 1 1000000000 1000000000 |
| correct output |
|---|
| 1000000000000000000 |
| user output |
|---|
| 1000000001000000000 |
Feedback: Incorrect character on line 1 col 10: expected "100000000000...", got "100000000100..."
Test 6
Verdict: WRONG ANSWER
| input |
|---|
| 1000 1000 271 687 392 992 11 410 702 870... |
| correct output |
|---|
| 223 |
| user output |
|---|
| 335 |
Feedback: Incorrect character on line 1 col 1: expected "223", got "335"
Test 7
Verdict: WRONG ANSWER
| input |
|---|
| 1000 1000 598 523 703 794 737 689 724 26... |
| correct output |
|---|
| 282 |
| user output |
|---|
| 392 |
Feedback: Incorrect character on line 1 col 1: expected "282", got "392"
Test 8
Verdict: WRONG ANSWER
| input |
|---|
| 200000 1000000000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... |
| correct output |
|---|
| 5000 |
| user output |
|---|
| 5001 |
Feedback: Incorrect character on line 1 col 4: expected "5000", got "5001"
Test 9
Verdict: ACCEPTED
| input |
|---|
| 200000 1 760045594 599341056 300698860 ... |
| correct output |
|---|
| 8214 |
| user output |
|---|
| 8214 |
Test 10
Verdict: WRONG ANSWER
| input |
|---|
| 200000 1000000000 33941840 210038922 596070148 7... |
| correct output |
|---|
| 371045814100 |
| user output |
|---|
| 371194681049 |
Feedback: Incorrect character on line 1 col 4: expected "371045814100", got "371194681049"
Test 11
Verdict: WRONG ANSWER
| input |
|---|
| 25 1000000000 1000000000 1 1 1 1 1 1 1 1 1 1... |
| correct output |
|---|
| 41666667 |
| user output |
|---|
| 41666668 |
Feedback: Incorrect character on line 1 col 8: expected "41666667", got "41666668"
Test 12
Verdict: WRONG ANSWER
| input |
|---|
| 12 1000000000 1 1 1 1 1 1 1 1 1 1 1 10000000... |
| correct output |
|---|
| 90909091 |
| user output |
|---|
| 90909092 |
Feedback: Incorrect character on line 1 col 8: expected "90909091", got "90909092"
Test 13
Verdict: ACCEPTED
| input |
|---|
| 23 1000000000 1000000000 1000000000 10000000... |
| correct output |
|---|
| 43478261000000000 |
| user output |
|---|
| 43478261000000000 |
Test 14
Verdict: ACCEPTED
| input |
|---|
| 3 3 10 11 12 |
| correct output |
|---|
| 12 |
| user output |
|---|
| 12 |
