QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#759642#9552. The ChariotliuhengxiCompile Error//C++14319b2024-11-18 10:47:192024-11-18 10:47:21

Judging History

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

  • [2024-11-18 10:47:21]
  • 评测
  • [2024-11-18 10:47:19]
  • 提交

answer

def solve():
	a,b,c,x,y,d=map(int,input().split())
	def calc(n):
		n=max(n,1)
		td=max(d-n*x,0)
		ny=n*y if b<=c else y
		if td<ny:
			return n*a+td*b
		else:
			return n*a+ny*b+(td-ny)*c
	n=[1,d//x,d//x+1,d//(x+y),d//(x+y)+1]
	return min(map(calc,n))
tt=int(input())
for i in range(tt):
	print(solve())

Details

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