QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#783725#9552. The ChariotInkyoWA 15ms10692kbPython3802b2024-11-26 11:32:112024-11-26 11:32:13

Judging History

你现在查看的是最新测评结果

  • [2024-11-26 11:32:13]
  • 评测
  • 测评结果:WA
  • 用时:15ms
  • 内存:10692kb
  • [2024-11-26 11:32:11]
  • 提交

answer

t = int(input())
for i in range(t):
    a, b, c, x, y, d = map(int, input().split())

    def cost(dis):
        if dis <= 0:
            return 0
        elif dis <= x:
            return a
        elif dis <= x + y:
            return a + (dis - x) * b
        else:
            return a + b * y + (dis - x - y) * c

    cx = d // x
    ans = cx * cost(x) + cost(d % x)
    if d % x <= cx * y:
        ans = min(ans, cx * cost(x) + d % x * b)
    else:
        ans = min(ans, cx * cost(x) + cx * y * b + (d % x - cx * y) * c)

    cxy = d // (x + y)
    ans = min(ans, cxy * cost(x + y) + cost(d % (x + y)))
    ans = min(ans, cxy * cost(x + y) + d % (x + y) * c)
    cxyp = (d + x + y - 1) // (x + y)
    ans = min(ans, cxyp * a + max(d - cxyp * x, 0) * b)

    print(ans)

详细

Test #1:

score: 0
Wrong Answer
time: 15ms
memory: 10692kb

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:

123
164
3226
999
9989999999999900199

result:

wrong answer 1st lines differ - expected: '160', found: '123'