QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#752585 | #9552. The Chariot | ucup-team3931# | WA | 11ms | 10632kb | Python3 | 803b | 2024-11-16 08:33:17 | 2024-11-16 08:33:21 |
Judging History
answer
def calc(n, a, b, c, x, y):
if n == 0:
return 0
ans = a
n -= x
if n <= 0:
return ans
t = min(n, y)
ans += t * b
n -= t
if n <= 0:
return ans
return ans + n * c
T = int(input())
for i in range(T):
a, b, c, x, y, d = map(int, input().split())
if d <= x:
print(a)
continue
if a == min([a, b * x, c * x]):
t = d // x
print((t - 1) * a + min(a * 2, calc(d - (t - 1) * x, a, b, c, x, y)))
continue
if (b == min([a, b * x, c * x])):
t = d // (x + y)
print(t * (a + b * y) + calc(d - t * (x + y), a, b, c, x, y))
continue
t = d // x
print(min([calc(d, a, b, c, x, y), (t - 1) * a + min(a * 2, calc(d - (t - 1) * x, a, b, c, x, y))]))
詳細信息
Test #1:
score: 0
Wrong Answer
time: 11ms
memory: 10632kb
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 3928 999 10000000000099799
result:
wrong answer 3rd lines differ - expected: '3226', found: '3928'