QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#753326#9552. The Chariotucup-team896#Compile Error//C++23505b2024-11-16 12:23:592024-11-16 12:24:01

Judging History

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

  • [2024-11-16 12:24:01]
  • 评测
  • [2024-11-16 12:23:59]
  • 提交

answer

def work():
	a, b, c, x, y, d = map(int, input().split())
	ans = ((d + x - 1) // x) * a
	for i in (1, d // (x + y), (d + x + y - 1) // (x + y), d // x):
		if i < 1: continue
		p = d - i * x
		if p <= 0: ans = min(ans, i * a)
		elif p <= y: ans = min(ans, i * a + p * b)
		else:
			q = p - y
			ans = min(ans, i * a + y * b + q * c)
			q = p - i * y
			if q <= 0: ans = min(ans, i * a + p * b)
			else: ans = min(ans, i * a + p * b + q * c)
	print(ans)

for _ in range(int(input())): work()

详细

answer.code:1:1: error: ‘def’ does not name a type
    1 | def work():
      | ^~~