QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#756932 | #9552. The Chariot | ucup-team3734# | Compile Error | / | / | C++23 | 813b | 2024-11-16 22:47:04 | 2024-11-16 22:47:04 |
Judging History
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’