QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#778261 | #9552. The Chariot | TreeQwQ | WA | 12ms | 10608kb | Python3 | 1.4kb | 2024-11-24 13:40:52 | 2024-11-24 13:40:52 |
Judging History
answer
from math import *
def solve():
a, b, c, x, y, d = map(int, input().split())
res0 = a * (d // x + (d % x != 0))
res4 = res0
if d // x > 0:
res4 = a * (d // x)
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
res1 = res1 + c * max(0, rem)
res7 = a * (d // x)
rem = d % x
res7 = res7 + b * min(rem, (d // x) * y)
rem = rem - (d // x) * y
res7 = res7 + c * max(0, rem)
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 + (rem % x != 0))
rem = rem - x
if rem > 0:
res2 = res2 + rem * b
res5 = res0
res6 = res0
if d // z > 0 and d % z > 0:
res5 = e * (d // z) + c * (d % z)
res6 = e * (d // z)
rem = d % z
p = x - rem % x
if p < x:
res6 = res6 - b * min((d // z) * y, p)
res6 = res6 + a * (rem // x + (rem % x != 0))
print(
min(
res7,
min(res6,
min(res5, min(res4, min(res3, min(res0, min(res1, res2))))))))
t = int(input())
for i in range(0, t):
solve()
詳細信息
Test #1:
score: 0
Wrong Answer
time: 12ms
memory: 10608kb
input:
5 160 27 41 3 12 3 160 27 41 3 12 4 160 27 41 3 12 99 1 999 999 1 99 999 999 999 1 1 99 9999999999999999
output:
160 187 2904 999 10000000000099799
result:
wrong answer 3rd lines differ - expected: '3226', found: '2904'