QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#769591#9552. The ChariotTreeQwQ#Compile Error//C++201006b2024-11-21 18:21:202024-11-21 18:21:26

Judging History

This is the latest submission verdict.

  • [2024-11-21 18:21:26]
  • Judged
  • [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()

詳細信息

answer.code:1:1: error: ‘from’ does not name a type
    1 | from math import *
      | ^~~~