QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#756932#9552. The Chariotucup-team3734#Compile Error//C++23813b2024-11-16 22:47:042024-11-16 22:47:04

Judging History

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

  • [2024-11-16 22:47:04]
  • 评测
  • [2024-11-16 22:47:04]
  • 提交

answer

import sys


if __name__ == '__main__':
    # sys.stdin = open('input.txt', 'r')

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

        def full(z):
            if z <= x:
                return a
            if z <= x + y:
                return a + (z - x) * b
            return a + y * b + (z - x - y) * c


        def two(z, step):
            cur = full(z)

            rem = z % step
            z -= rem
            cur = min(cur, z // step * full(step) + full(rem))

            if z >= step:
                z -= step
                rem += step
                cur = min(cur, z // step * full(step) + full(rem))

            return cur


        ans = min([full(d), two(d, x + y), two(d, x)])

        print(ans)

詳細信息

answer.code:4:16: warning: character constant too long for its type
    4 | if __name__ == '__main__':
      |                ^~~~~~~~~~
answer.code:5:7: error: invalid preprocessing directive #sys
    5 |     # sys.stdin = open('input.txt', 'r')
      |       ^~~
answer.code:1:1: error: ‘import’ does not name a type
    1 | import sys
      | ^~~~~~
answer.code:1:1: note: C++20 ‘import’ only available with ‘-fmodules-ts’, which is not yet enabled with ‘-std=c++20’