QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#769591 | #9552. The Chariot | TreeQwQ# | Compile Error | / | / | C++20 | 1006b | 2024-11-21 18:21:20 | 2024-11-21 18:21:26 |
Judging History
This is the latest submission verdict.
- [2024-11-21 18:21:26]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2024-11-21 18:21:20]
- Submitted
answer
from math import *
def solve():
a, b, c, x, y, d = map(int, input().split())
res0 = a * (d // x)
res4 = a * (d // x)
if d % x > 0:
res0 = res0 + a
rem = d % x
res4 = res4 + b * min(rem, y)
rem = rem - y
res4 = res4 + c * max(0, rem)
res1 = a
rem = d - x
if rem > 0:
res1 = res1 + b * min(rem, y)
rem = rem - y
if rem > 0:
res1 = res1 + rem * c
z = x + y
e = a + y * b
res2 = e * (d // z)
rem = d % z
res3 = e * (d // z)
if rem > 0:
res2 = res2 + a
res3 = res3 + a * (rem // x)
if (rem % x > 0):
res3 = res3 + a
rem = rem - x
if rem > 0:
res2 = res2 + rem * b
res5 = res2
if d // z > 0:
res5 = e * (d // z) + c * (d % z)
print(min(res5, min(res4, min(res3, min(res0, min(res1, res2))))))
t = int(input())
for i in range(0, t):
solve()
Details
answer.code:1:1: error: ‘from’ does not name a type 1 | from math import * | ^~~~