problem_id stringclasses 100
values | submission_id stringlengths 10 10 | status stringclasses 2
values | code stringlengths 6 806 |
|---|---|---|---|
p03371 | s475395720 | Wrong Answer | a,b,c,x,y = map(int,input().split())
piza_min = min(x,y)
plan1 = c*piza_min*2 + a*(x-piza_min) + b*(y-piza_min)
plan2 = a*x + b*y
print(min(plan1,plan2)) |
p03371 | s275713370 | Wrong Answer | a,b,c,x,y = map(int,input().split())
ans = 10**18
for i in range(0,10**5+1,2):
temp = 2*i*c + max(0,x-i)*a + max(0,y-i)*b
ans = min(ans,temp)
print(ans)
|
p03371 | s312223550 | Wrong Answer | A, B, C, X, Y = map(int, input().split())
ans = float('inf')
if A + B > 2 * C:
p = (2 * max(X, Y)) * C
ans = min(ans, p)
else:
for x in range(X + 1):
for y in range(Y + 1):
c = max(X - x, Y - y)
p = x * A + y * B + (2 * c) * C
ans = min(ans, p)
print(ans) |
p03371 | s073511044 | Wrong Answer | A, B, C, X, Y = map(int, input().split())
cost_list = []
for i in range(0, max([X, Y]) * 2 + 1, 2):
AB_cost = C * i
A_cost = A * (X - int(i / 2))
B_cost = B * (Y - int(i / 2))
if A_cost >= 0 and B_cost >= 0:
cost = AB_cost + A_cost + B_cost
cost_list.append(cost)
#print(cost_list)
print(min(cost_list))
|
p03371 | s815164756 | Wrong Answer | A,B,C,X,Y=list(map(int,input().split()))
money=0
if min(A,B,2*C)==2*C:
money+=2*C*max(X,Y)
elif A+B>2*C:
money+=2*C*min(X,Y)
if min(X,Y)==X:
Y-=X
money+=Y*B
else:
X-=Y
money+=X*A
else:
money+=A*X
money+=B*Y
print(money) |
p03371 | s162972000 | Wrong Answer | a,b,c,x,y=map(int,input().split())
if a+b<=2*c:
print(a*x+b*y,1)
else:
if a>c and b>c:
print(2*max(x,y)*c,2)
elif a>c and c>b:
print(2*min(x,y)*c+min(b,c)*(y-x),3)
elif a<c and b>c:
print(2*min(x,y)*c+min(a,c)*(x-y),4)
|
p03371 | s482987960 | Wrong Answer | def main():
import sys
def input(): return sys.stdin.readline().rstrip()
a, b, c, x, y = map(int, input().split())
lim = max(x, y)
ans = 10**8
for i in range(lim+1):
price = a*max(0, x-i) + b*max(0, y-i) + c*2*i
ans = min(ans, price)
print(ans)
if __name__ == '__main__':
main() |
p03371 | s115357267 | Wrong Answer | a,b,c,x,y = map(int,input().split())
ans=a*x+b*y
if x>y:
e = c*2*y
f = a*(x-y)
ans=min(ans,e+y)
g= 2*c*x
ans=min(ans,g)
else:
e = c*2*x
f = b*(y-x)
ans = min(ans,e+f)
g = 2*c*x
ans = min(ans,g)
print(ans)
|
p03371 | s246462394 | Wrong Answer | # -*- coding: utf-8 -*-
a, b, c, x, y = map(int, input().split())
total = a * x + b * y
c_total = 2 * c * min(x, y)
if total > c_total:
total = c_total
if x > y:
total += c_total + (x - y) * min(a, 2 * c)
elif y > x:
total += c_total + (y - x) * min(b, 2 * c)
print(total)
|
p03371 | s396746473 | Wrong Answer | A, B, C, X, Y = map(int, input().split())
ans = float('INF')
for i in range(0, 2*min(X, Y)+1, 2):
ans = min(ans, int(A*max(0, X-i/2)+B*max(0, Y-i/2)+C*i))
print(ans) |
p03371 | s771679673 | Wrong Answer | A, B, C, X, Y = map(int,input().split())
m = 10^9
for i in range(X):
for j in range(Y):
m = min(m,A*i+B*j+C*((X+Y)-(i+j)))
print(m) |
p03371 | s419827179 | Wrong Answer | A, B, C, X, Y = map(int, input().split())
ans = A*X + B*Y
i = 1
while True:
if X-i < 0 or Y-i < 0:
break
cost = A*(X-i) + B*(Y-i) + 2*C*i
if cost > ans:
break
ans = min(cost, ans)
i += 1
print(ans)
|
p03371 | s154881642 | Wrong Answer | A, B, C, X, Y = map(int, input().split())
ans = float('INF')
for k in range(2*max(X, Y)+1, 2):
i = max(0, X - 2*k)
j = max(0, Y - 2*k)
ans = min(ans, A*i + B*j + C*k)
print(ans) |
p03371 | s935811494 | Wrong Answer | A,B,C,X,Y=map(int,input().split())
if A+B<=C*2:
print(A*X+B*Y)
elif max(A,B)<=2*C:
if X>=Y:
print(Y*2*C+(X-Y)*A)
else:
print(X*2*C+(Y-X)*B)
else:
print(2*Y*C) |
p03371 | s946363703 | Wrong Answer | a, b, c, x, y = [int(i) for i in input().split()]
if a >= 2*c and b >= 2*c:
ans = 2 * c * max(x,y)
elif a+b >= 2*c:
if x >= y:
ans = c * 2 * y
ans += a * (x - y)
else:
ans = c * 2 * x
ans += b * (y - x)
else:
ans = a * x + b * y
print(ans) |
p03371 | s899408818 | Wrong Answer | a , b , c , x , y = map(int,input().split())
ans = 10*10
for i in range(10**8):
ans = min(ans, a * max(x -i,0) + b * max ( y - i , 0 ) + (2 * c * i) )
print(ans) |
p03371 | s423877469 | Wrong Answer | a, b, c, x, y = map(int,input().split())
total = []
for i in range(1, max(x, y) + 1):
c_price = i * 2 * c
if x - i <= 0:
a_price = 0
else:
a_price = (x - i) * a
if y - i <= 0:
b_price = 0
else:
b_price = (y - i) * b
total.append(a_price + b_price + c_price)
print(min(total))
|
p03371 | s241847240 | Wrong Answer | a,b,c,x,y = map(int, input().split())
ans = 7000000000
for i in range(10001):
amount = i*2*c + max(0, x-i)*a + max(0, y-i)*b
if ans > amount:
ans = amount
print(ans)
|
p03371 | s431877693 | Wrong Answer | def solve(a,b,c,x,y):
k_max = min(x,y)
l = []
for i in range(k_max+1):
s = a*(x-i)+b*(y-i)+c*i*2
l.append(s)
return min(l)
A,B,C,X,Y = map(int,input().split())
print(solve(A,B,C,X,Y)) |
p03371 | s868638601 | Wrong Answer | a, b, c, x, y = map(int, input().split())
pata = a*x + b*y
patb = c * (2 * max(x,y))
if x >= y:
patc = c * (2*y) + a*(x-y)
else:
patc = c * (2*x) + a*(y-x)
print(min(pata,patb,patc)) |
p03371 | s351391851 | Wrong Answer | a, b, c, x, y = map(int, input().split())
ans = 5000 * max(x, y)
for i in range(max(x, y) * 2 + 1):
n = c * i * 2 + max(0, x - i) * a + max(0, y - i) * b
ans = min(ans, n)
print(ans) |
p03371 | s101388441 | Wrong Answer | A, B, C, X, Y = map(int, input().split())
xn, yn = 0, 0
price = 0
if (A+B) >= 2*C:
ammount = min(X, Y)
price += C * ammount * 2
xn += ammount
yn += ammount
if A >= 2*C and X > xn:
ammount = X - xn
price += C * X * 2
xn += X
yn += X
if B >= 2*C and Y > yn:
ammount = Y - yn
price += C * ammount * 2
xn += ammount
yn += ammount
price += A * (X - xn)
price += B * (Y - yn)
print(price)
|
p03371 | s638196677 | Wrong Answer | A,B,C,X,Y = map(int,input().split())
min_ = min(X,Y)
max_ = max(X,Y)
sum = 0
res = A*X + B*Y
for i in range(0,min_):
sum += C * 2
if(C<0.5*A and C< 0.5*B):
sum += 2*C*(max_-min_)
elif(max_==X):
sum += (max_-min_)*A
else:
sum += (max_-min_)*B
print(min(res,sum)) |
p03371 | s716264462 | Wrong Answer | a,b,c,x,y = map(int,input().split())
chp = min(a+b,c*2)
memo1 = min(x,y)
memo2 = max(x,y)-min(x,y)
if x>y:
print(memo2*a+memo1*chp)
else:
print(memo2*b+memo1*chp) |
p03371 | s659888073 | Wrong Answer | a, b, c, x, y = map(int, input().split())
ans = float("inf")
for i in range(max(x, y)):
ans = min(ans, i * 2 * c + a * max(0, x - i) + b * max(0, y - i))
print(ans)
|
p03371 | s139856705 | Wrong Answer | #<全探索>
#<ABC95C>
A,B,C,X,Y = map(int,input().split())
ans1 = A*X + B* Y
ans2=0
if X > Y:
ans2= C * 2 * Y + A * (X-Y)
else:
ans2= C * 2 * X + A * (Y-X)
ans3 = 0
if X > Y:
ans3 = C * 2 * X
else:
ans3 = C * 2 * Y
print(min(ans1,ans2,ans3))
|
p03371 | s396928461 | Wrong Answer | A, B, C, X, Y = map(int, input().split())
min_price = A * X + B * Y
if A + B > 2 * C:
if X > 0 and Y > 0:
min_price -= (A + B - 2 * C) * min(X, Y)
if X > Y:
X = X - Y
Y = 0
if Y > X:
X = 0
Y = Y - X
if X > 0 and A > 2 * C:
min_price -= (A - 2 * C) * X
if Y > 0 and B > 2 * C:
min_price -= (B - 2 * C) * Y
print(min_price)
|
p03371 | s356738255 | Wrong Answer | a,b,c,x,y = map(int,input().split())
A_B = a*x+b*y
A_AB = a*(x-y)+2*c*y
AB_B = 2*c*x+b*(y-x)
AB = 2*c*max(x,y)
ans = min(A_B,A_AB,AB_B,AB)
print(ans)
|
p03371 | s193453044 | Wrong Answer | A, B, C, X, Y = map(int, input().split())
ans = 0
if (A+B)/2 >= C:
if X >= Y:
ans += C * Y * 2
ans += A * (X-Y)
else:
ans += C * X * 2
ans += B * (Y-X)
else:
ans = A*X + B*Y
print(ans) |
p03371 | s733679333 | Wrong Answer | from sys import stdin
from sys import setrecursionlimit
setrecursionlimit(10 ** 7)
a,b,c,x,y = map(int,stdin.readline().rstrip().split())
mi = 10**10
if a+b <= 2*c:
mi = a*x+b*y
else:
mi = min(mi,max(x,y)*2*c)
if x >= y:
mi = min(mi,(x-y)*a+y*2*c)
else:
mi = min(mi,(y-x)*a+x*2*c)
print(mi) |
p03371 | s361120599 | Wrong Answer | a,b,c,x,y=map(int,input().split())
ans=0
if a+b<=c*2:
while x>0 and y>0:
ans+=a+b
x-=1
y-=1
elif a+b>=c*2:
while x>0 and y>0:
ans+=c*2
x-=1
y-=1
if x==0:
while y>0:
ans+=b
y-=1
elif y==0:
while x>0:
ans+=a
x-=1
print(ans) |
p03371 | s259231879 | Wrong Answer | A,B,C,X,Y = map(int, input().split())
n = min(X,Y)
sum = 0
sum = min(n*2*C, A*n+B*n)
if X>Y:
n = X-n
sum = sum + n*A
elif X < Y:
n = Y - n
sum = sum + n*B
print(sum) |
p03371 | s973745067 | Wrong Answer | a, b, c, x, y = map(int, input().split())
ans = 10**5
for i in range(10**5):
tmp = 2*c*i + max((x-i), 0)*a + max((y-i), 0)*b
ans = min(ans, tmp)
print(ans) |
p03371 | s091665148 | Wrong Answer | A, B, C, X, Y = map(int, input().split())
value = float('inf')
D = max(A,B)
for i in range(D+1):
E = min((X-i)*A, 0)
F = min((Y-i)*B, 0)
valueX = 2*i*C+E+F
if valueX < value:
value = valueX
print(str(value)) |
p03371 | s935107695 | Wrong Answer | def resolve():
a, b, c, x, y = map(int, input().split())
ans = a*x + b*y
for i in range(x):
num = a*i
a_diff = x - i
for j in range(y):
c_max = max(a_diff, y-j)
num += b*j + (c*2*c_max)
ans = min(num, ans)
print(ans)
if __name__ == '__main__':
resolve() |
p03371 | s613654779 | Wrong Answer | a,b,ab,x,y=map(int,input().split())
ans=0
abcnt=min(x,y)
if (a+b)//2>=ab:
if min(a,b)>ab*2:
ans+=max(x,y)*2*ab
else:
ans+=abcnt*2*ab
if x>y:
ans+=(x-abcnt)*a
else:
ans+=(y-abcnt)*b
else:
ans+=x*a+y*b
print(ans)
|
p03371 | s256730886 | Wrong Answer | def resolve():
A, B, C, X, Y = list(map(int, input().split()))
if min(A, B) > C:
print(2 * max(X, Y) * C)
return
if A + B > 2 * C:
if X >= Y:
print(2 * Y * C + max(X-Y, 0) * A)
else:
print(2 * X * C + max(Y-X, 0) * B)
else:
print(A * X + B * Y)
return
resolve() |
p03371 | s554033730 | Wrong Answer | a,b,c,x,y = map(int, input().split())
mix_price = min(a+b,c*2)
if a > 2 * c:
print(x * 2 * c + (y - x) * b)
elif b > 2 * c:
print(y * 2 * c + (x - y) * a)
elif a + b > 2 * c and x > y:
print(y * mix_price + (x - y) * a)
elif a + b > 2 * c and x < y:
print(x * mix_price + (y - x) * b)
else:
print(x * a + y * b) |
p03371 | s840366367 | Wrong Answer | a,b,c,x,y = map(int,input().split())
c *= 2
ans = 10 ** 16
for i in range(max(x,y)):
p = 0
p += c * i
p += a * (max(0,x - i))
p += b * (max(0,y - i))
ans = min(ans,p)
print(ans) |
p03371 | s627784572 | Wrong Answer | a, b, c, x, y = map(int, input().split())
ans = 5000*(10**5)
for i in range(max(x, y)+1):
tmp_ans = i*2*c
if (x-i)*a > 0:
tmp_ans += (x-i)*a
if (y-i)*b > 0:
tmp_ans += (y-i)*b
ans = min(ans, tmp_ans)
print(ans)
|
p03371 | s048839937 | Wrong Answer | a, b, c,x,y = map(int, input().split())
total = a*x+b*y
if a/2 + b/2 > c:
if a > c and b > c:
total = max(x,y)*2*c
elif a < c and x >y:
total = y*2*c+ round(x-y)*a
elif b < c and y >x:
total = x*2*c+ round(y-x)*b
print(total) |
p03371 | s331232357 | Wrong Answer | A, B, C, X, Y = map(int, input().split())
minXorY = min(2*X,2*Y)
if X > Y :
amari = A*(X-Y)
else:
amari = B*(Y-X)
yen = min(A*X+B*Y, C*minXorY+amari)
print(yen) |
p03371 | s216156336 | Wrong Answer | A, B, C, X, Y = map(int, input().split())
if A+B<=C*2:
print(X*A+Y*B)
elif A<=C*2 and B<=C*2:
if X>=Y:
print(Y*C*2+(X-Y)*A)
else:
print(X*C*2+(Y-X)*B)
elif A>=C*2:
if X>=Y:
print(C*2*X)
else:
print(C*2*X+(Y-X)*B)
else:
if X>=Y:
print((X-Y)*A+C*2*Y)
else:
print(C*2*Y) |
p03371 | s674364836 | Wrong Answer | a,b,ab,x,y=map(int, input().split())
ans = 10**10
yen=0
for i in range(10**5):
yen = i*2*ab + max(0, x-i)*a + max(0,y-i)*b
ans = min(ans,yen)
print(ans) |
p03371 | s500285730 | Wrong Answer | a, b, c, x, y = map(int, input().split())
ans = 5000*(10**5)
for i in range(max(x, y)+1):
tmp_ans = i*2*c
if x > i:
tmp_ans += (x-i)*a
if y > i:
tmp_ans += (y-i)*b
ans = min(ans, tmp_ans)
print(ans)
|
p03371 | s775359770 | Wrong Answer | a,b,c,x,y = map(int, input().split())
if (a+b <= c*2):
print(a*x+b*y)
else:
if (x>=y):
print(min(y*c*2+(x-y)*a,x*c*2))
else:
print(min(y*c*2+(y-x)*b,y*c*2)) |
p03371 | s468430407 | Wrong Answer | from sys import stdin
from sys import setrecursionlimit
setrecursionlimit(10 ** 7)
a,b,c,x,y = map(int,stdin.readline().rstrip().split())
mi = 10**10
mi = min(mi,max(x,y)*2*c)
mi = min(mi,a*x+b*y)
if x >= y:
mi = min(mi,(x-y)*a+y*2*c)
else:
mi = min(mi,(y-x)*a+x*2*c)
print(mi) |
p03371 | s968936341 | Wrong Answer | A, B, C, X, Y = map(int, input().split())
ret = 5000 * (10 ** 5)
for i in range(10 ** 5 + 1):
ret = min(ret, A * max(0, X - i) + B * max(0, Y - i) + 2 * i * C)
print(ret) |
p03371 | s519442202 | Wrong Answer | import sys
input = sys.stdin.readline
A,B,C,X,Y = list(map(int,input().split()))
cost = A*X+B*Y
if X >= Y:
maxXY = X
maxAB = A
else:
maxXY = Y
maxAB = B
ans = cost
for xy in range(1,maxXY+1):
nc = 2*C*xy +max(0,(X-xy))*A+max(0,(Y-xy))*B
#print(nc,cost)
if nc >= cost:
break
else:
ans = nc
print(ans)
|
p03371 | s535953441 | Wrong Answer | a,b,c,x,y = map(int, input().split())
mix_price = min(a+b,c*2)
if a > 2 * c and b > 2 * c:
print(2 * c * max(x,y))
elif a > 2 * c:
print(x * 2 * c + (y - x) * b)
elif b > 2 * c:
print(y * 2 * c + (x - y) * a)
elif a + b > 2 * c and x > y:
print(y * mix_price + (x - y) * a)
elif a + b > 2 * c and x < y:
print(x * mix_price + (y - x) * b)
else:
print(x * a + y * b) |
p03371 | s311657696 | Wrong Answer | A, B, C, X, Y = map(int, input().split())
list = []
for i in range(100001):
price = 2*C*i + A*max(0,X-i) + B*min(0,Y-i)
list.append(price)
print(min(list))
|
p03371 | s256348371 | Wrong Answer | a, b, c, x, y = map(int, input().split())
if x >= y:
tmp1 = y*2*c + (x-y)*a
tmp2 = c*x*2
tmp3 = a*x + b*y
print(min([tmp1, tmp2, tmp3]))
else:
tmp1 = x * 2 * c + (y-x) * a
tmp2 = c * y * 2
tmp3 = a * x + b * y
print(min([tmp1, tmp2, tmp3]))
|
p03371 | s046992841 | Wrong Answer | def solve(a,b,c,x,y):
l = []
for i in range(10**5):
s = a*max(x-i,0)+b*max(y-i,0)+c*i*2
l.append(s)
return min(l)
A,B,C,X,Y = map(int,input().split())
print(solve(A,B,C,X,Y))
|
p03371 | s979052055 | Wrong Answer | a, b, c, x, y = map(int, input().split())
ans = 0
if c < a and c < b:
ans += c * max(x, y)*2
elif (c - a < 0 and abs(a-c) < abs(b-c)) or (c - b < 0 and abs(a-c) > abs(b-c)):
ans += a*x + b* y
else:
s = max(x, y)
t = min(x, y)
ans += c*t*2 + min(a, b)*(s-t)
print(ans) |
p03371 | s144730566 | Wrong Answer | A,B,C,X,Y=map(int, input().split())
ans = 500000000
for i in range( max(X,Y)+1 ):
ans = min(ans, C*i*2 + A*(max(0,(X-i)))+B*(max(0,(Y-i))))
print(ans)
|
p03371 | s968064850 | Wrong Answer | A,B,C,X,Y = map(int,input().split())
if A<=C and B<=C:
print(A*X+B*Y)
elif C<=A and C<=B:
if X<=Y:
a = 2*C*X+(Y-X)*B
b = 2*C*Y
print(min(a,b))
else:
a = 2*C*Y+(X-Y)*A
b = 2*C*X
print(min(a,b))
elif A<=C and B>C:
print(A*X+min(B,2*C)*Y)
else:
print(B*Y + min(A,2*C)*X) |
p03371 | s602460626 | Wrong Answer | a,b,c,x,y = map(int,input().split())
min = x if x<y else y
price=0
if a+b > 2*c:
price = min*2*c
print(price)
if a < c*2 and y<x:
price+=a*(x-y)
elif b<c*2 and x<y:
price+=b*(y-x)
else:
diff = y-x if x<y else x-y
price+=2*c*(diff)
else:
price = a*x+b*y
print(price) |
p03371 | s398663045 | Wrong Answer | a,b,c,x,y = map(int,input().split())
ans = 0
if a+b<c*2:
ans = a*x+b*y
elif a+b>c:
ans = c*2*max(x,y)
else:
ans = abs(x-y)
if x<y:ans*=b
else:ans*=a
ans += c*2*min(x,y)
print(ans) |
p03371 | s727324722 | Wrong Answer | a,b,c,x,y=map(int,input().split())
if a+b<=2*c:
print(a*x+b*y)
else:
if a>c and b>c:
print(2*max(x,y)*c)
elif a>c and c>b:
print(2*min(x,y)*c+min(b,c)*(y-x))
elif a<c and b>c:
print(2*min(x,y)*c+min(a,c)*(x-y))
|
p03371 | s922109126 | Wrong Answer | a,b,c,x,y = map(int,input().split())
n = max(x,y) * 2 * c
m = x * a + y * b
print(min(n,m))
|
p03371 | s581692164 | Wrong Answer | pa, pb, pab, x, y = map(int, input().split())
li = []
if x-y>= 0:
li.append(pa*x+pb*y)
li.append(pa*(x-y)+pab*2*y)
li.append(pab*2*x)
if y-x>= 0:
li.append(pa*x+pb*y)
li.append(pb*(y-x)+pab*2*y)
li.append(pab*2*y)
li.sort()
print(li[0]) |
p03371 | s765886480 | Wrong Answer | A, B, C, X, Y = map(int, input().split())
C *= 2
ans = 0
if A + B > C:
ans += min(X, Y) * C
n = abs(X - Y)
ans += n * A if X > Y else n * B
else:
ans += A*X + B*Y
print(ans) |
p03371 | s925385284 | Wrong Answer | a,b,c,x,y=map(int,input().split())
if a + b <= 2*c:
print(a*x + b*y)
elif min(a,b) < 2*c:
if x > y:
print(c*y*2 + a*(x-y))
else:
print(c*x*2 + b*(y-x))
else:
print(c*max(x,y)*2) |
p03371 | s347185588 | Wrong Answer | a,b,c,x,y=map(int,input().split())
if a+b<=2*c:
print(a*x+b*y)
else:
if a>c and b>c:
print(2*max(x,y)*c)
elif a>c and c>b:
c=c*2
print(min(x,y)*c+min(b,c)*(y-x))
elif a<c and b>c:
c=2*c
print(min(x,y)*c+min(a,c)*(x-y))
|
p03371 | s089018619 | Wrong Answer | a, b, c, x, y = map(int, input().split())
ans = 5000 * max(x, y)
for i in range(max(x, y) * 2 + 1):
if x - i//2 < 0 and y - i//2 < 0:
n = c * i
elif x - i//2 < 0:
n = c * i + (y - i//2) * b
elif y - i//2 < 0:
n = c * i + (x - i//2) * a
else:
n = c * i + (x - i//2) * a + (y - i//2) * b
ans = min(ans, n)
print(ans) |
p03371 | s833824875 | Wrong Answer | a, b, c, x, y = map(int, input().split())
max_value = max(a, b)
min_value = min(a, b)
boundary_value = 2 * c
if boundary_value <= min_value:
print(boundary_value * max(x, y))
elif min_value < boundary_value <= (min_value + max_value):
if (a == max_value and y <= x) or (b == max_value and x <= y):
print(boundary_value * max(x, y))
else:
print(boundary_value * (max(x, y) - abs(x - y)) +
min_value * abs(x - y))
elif (min_value + max_value) < boundary_value:
print(a * x + b * y)
|
p03371 | s829822899 | Wrong Answer | A,B,C,X,Y=map(int,input().split())
if A+B<=2*C:
print(X*A+Y*B)
else:
if X<=Y:
print(2*X*C+(Y-X)*B)
else:
print((X-Y)*A+2*Y*C) |
p03371 | s465781665 | Wrong Answer | A, B, C, X, Y = map(int, input().split())
if X > Y:
many = A
else:
many = B
if min(A, B) > 2 * C:
ans = C * 2 * max(X, Y)
elif (A + B) / 2 <= C:
ans = A * X + B * Y
else:
ans = min(X, Y) * 2 * C + (max(X, Y) - min(X, Y)) * many
print(ans) |
p03371 | s387589511 | Wrong Answer | a, b, c, x, y = map(int, input().split())
A = a * x + b * y
B = c * min(x, y) * 2 + a * abs(x - y)
C = c * max(x, y) * 2
print(min(A, B, C)) |
p03371 | s382147843 | Wrong Answer | A, B, C, X, Y = map(int, input().split())
value = float('inf')
D = max(A,B)
for i in range(D+1):
valueX = 2*i*C+(X-i)*A+(Y-i)*B
if valueX < value:
value = valueX
print(str(value)) |
p03371 | s995764338 | Wrong Answer | a,b,c,x,y = map(int,input().split())
if 2*c >= a+b:
print(a*x+b*y)
else:
if 2*c <=a or 2*c <=b:
print(2*c*(max(x,y)))
else:
if x>=y:
print(2*c*y+a*(x-y))
else:
print(2*c*x+a*(y-x)) |
p03371 | s360257700 | Wrong Answer | a, b, c, x, y = map(int, input().split())
ab = min(x, y)//2 * 2
ans1 = ab*2*c + max(0, x-ab)*a + max(0, y-ab)*b
ans2 = x*a + y*b
ab = max(x, y)//2 * 2
ans3 = ab*2*c + max(0, x-ab)*a + max(0, y-ab)*b
ab = -(-max(x, y)//2) * 2
ans4 = ab*2*c + max(0, x-ab)*a + max(0, y-ab)*b
ab = -(-min(x, y)//2) * 2
ans5 = ab*2*c + max(0, x-ab)*a + max(0, y-ab)*b
print(min(ans1, ans2, ans3, ans4, ans5))
|
p03371 | s402469843 | Wrong Answer | a, b, c, x, y = map(int, input().split())
mini = 10000000000
if x < y: temp = x
else: temp = y
for i in range(0, temp * 2 + 1, 2):
# print(x - i/2, y - i/2, i)
price = a * (x - int(i/2)) + b * (y - int(i/2)) + c * i
if price < mini:
mini = price
print(mini) |
p03371 | s060397605 | Wrong Answer | a, b, c, x, y = [int(i) for i in input().split()]
ans = 10**18
for i in range(min(x, y)*2 + 1):
ans = min(ans, c * i + (x - i//2) * a + (y - i//2) * b)
print(ans)
|
p03371 | s575307363 | Wrong Answer | A,B,C,X,Y=map(int,input().split())
if 2*C <= A+B:
price= 2*C
else:
price = A+B
maxN = max(X,Y)
miniN = min(X,Y)
res = miniN * price
residue = maxN - miniN
if residue == 0:
print(res)
elif X > Y:
res+= min(residue*A, residue*2*C)
print(res)
elif Y < X:
res += min(residue*B, residue*2*C)
print(res) |
p03371 | s367584730 | Wrong Answer | A,B,C,X,Y=map(int,input().split())
P=X*A+B*Y
if X>Y:
Q=C*2*Y+(X-Y)*A
L=X*2*C
else:
Q=C*2*Y+(Y-X)*B
L=Y*2*C
print(min(P,Q,L)) |
p03371 | s359133494 | Wrong Answer | A, B, C, X, Y = map(int, input().split())
res = float('Inf')
for Z in range(10**5):
total = 2*Z*C + max(0, X - Z)*A + max(0, Y - Z)*B
if res > total:
res = total
print(res) |
p03371 | s339884156 | Wrong Answer | A, B, C, X, Y = map(int, input().split())
cost1 = A+B; cost2 = C*2
if X == Y :
print( X* min( cost1, cost2))
if X> Y:
print( min( Y* min( cost1, cost2) + (X-Y)*A , X* min( cost1, cost2)))
else :
print( min( X* min( cost1, cost2) + (Y-X)*A , Y* min( cost1, cost2)))
|
p03371 | s594750387 | Wrong Answer | pa,pb,pab,a,b=list(map(int,input().split()))
S1=pa*a+pb*b
S2=2*pab*max(a,b)
if S1>S2:
print(S2)
else:
if pa+pb>pab*2:
print(2*pab*min(a,b)+pa*(a-min(a,b))+pb*(b-min(a,b)))
else:
print(S1)
|
p03371 | s856448767 | Wrong Answer | A,B,C,X,Y = map(int,input().split())
ans = 10**9+7
for i in range(1,(10**5)+1):
tmp = i * 2 * C + max(0,X-i) * A + max(0,Y-i) * B
ans = min(ans,tmp)
print(ans) |
p03371 | s686796505 | Wrong Answer | # -*- coding: utf-8 -*-
a, b, c, x, y = map(int, input().split())
total = a * x + b * y
if total > 2 * c * max(x, y):
total = 2 * c * max(x, y)
elif a + b > 2 * c:
diff_price_a_and_b = a + b - 2 * c
total -= diff_price_a_and_b * min(x, y)
print(total)
|
p03371 | s897673661 | Wrong Answer | def resolve():
a, b, c, x, y = map(int, input().split())
if a+b > 2*c:
com = min(x, y)
ans = 2*c*com
if 2*c < a or 2*c < b:
ans += max(x-com, y-com)*2*c
elif x > y:
ans += a*(x-com)
else:
ans += b*(y-com)
else:
ans = a*x + b*y
print(ans)
if __name__ == '__main__':
resolve() |
p03371 | s296312760 | Wrong Answer | a,b,c,x,y = map(int, input().split())
costs = 0
while x>0 and y>0:
if a+b>2*c:
costs += 2*c
else:
costs = costs+a+b
x -= 1
y -= 1
if x>0:
if a<=2*c:
costs += x*a
else:
costs += x*2*c |
p03371 | s800471477 | Wrong Answer | def resolve():
a, b, c, x, y = map(int, input().split())
if a+b >= 2*c:
com = min(x, y)
ans = 2*c*com
if 2*c < a or 2*c < b:
ans += max(x-com, y-com)*2*c
elif x > y:
ans += a*(x-com)
else:
ans += b*(y-com)
else:
ans = a*x + b*y
print(ans)
if __name__ == '__main__':
resolve() |
p03371 | s938254582 | Wrong Answer | A, B, C, X, Y = map(int, input().split())
C = min(2*C, A+B)
ans = 0
ans += C*min(X, Y)
if X > Y:
ans += min(C, A) * abs(X-Y)
else:
ans + min(C, B) * abs(X-Y)
print(ans)
|
p03371 | s669826798 | Wrong Answer | a,b,c,x,y=map(int,input().split())
cost=[]
cm=0
while cm<=max(x,y):
am=x-cm//2
bm=y-cm//2
if am>=0 and bm>=0: cost.append(am*a+bm*b+cm*c)
elif am>=0 and bm<=0: cost.append(am*a+cm*c)
elif am<=0 and bm>=0: cost.append(bm*b+cm*c)
elif am<=0 and bm<=0: cost.append(cm*c)
cm+=2
print(min(cost)) |
p03371 | s134345325 | Wrong Answer | import sys
input = sys.stdin.readline
A, B, C, X, Y = map(int, input().split(' '))
ans = 10**5 * 5000
for i in range(10**5+1):
price = 2*C*i + A*max(0, X-i) + B*max(0, Y-i)
ans = min(ans, price)
print(ans) |
p03371 | s628805495 | Wrong Answer | a,b,c,x,y = map(int, input().split())
ans = 700000000
for i in range(10001):
amount = i*2*c + max(0, x-i)*a + max(0, y-i)*b
if ans > amount:
ans = amount
print(ans)
|
p03371 | s874104101 | Wrong Answer | import math
A, B, C, X, Y = map(int, input().split())
m = 10000000000
for c in range(max(X, Y) * 2 + 1):
a = math.ceil(X - 0.5 * c) if X - 0.5 * c >= 0 else 0
b = math.ceil(Y - 0.5 * c) if Y - 0.5 * c >= 0 else 0
m = min(a * A + b * B + c * C, m)
print(a, b, c)
print(m) |
p03371 | s572376109 | Wrong Answer | def main():
a, b, c, x, y = map(int, input().split())
t1 = a * x + b * y
t2 = c * max(x, y) * 2
if x >= y:
t3 = c * y * 2 + a * (x - y)
else:
t3 = c * x * 2 + b *(y - 1)
print(min(t1, t2, t3))
if __name__ == '__main__':
main() |
p03371 | s248088524 | Wrong Answer | A,B,C,X,Y = map(int,input().split())
ans = 0
if 4 * C < (A + B):
ans = C * max(X,Y) * 2
elif C < int((A + B) / 2):
if X > Y:
ans = Y * 2 * C + (X - Y) * A
else:
ans = X * 2 * C + (Y - X) * B
else:
ans = A * X + B * Y
print(ans) |
p03371 | s428516289 | Wrong Answer | A, B, C, X, Y = map(int, input().split())
MIN = None
for i in range(100001):
price = 2*C*i + A*max(0,X-i) + B*min(0,Y-i)
if MIN is None:
MIN = price
MIN = min(MIN, price)
print(MIN)
|
p03371 | s709438799 | Wrong Answer | #095_C
a,b,c,x,y=map(int,input().split())
ans=10**10
for ab in range(0,max(a,b)+1,2):
tmp=max(0,x-ab//2)*a+max(0,y-ab//2)*b+ab*c
ans=min(ans,tmp)
print(ans) |
p03371 | s251364941 | Wrong Answer | A, B, C, X, Y = map(int, input().split())
if (A+B)/2 >= C:
if X >= Y:
print(C*2*Y + A*(X-Y))
else:
print(C*2*X + A*(Y-X))
else:
print(A*X + B*Y)
|
p03371 | s687323284 | Wrong Answer | A,B,C,X,Y = map(int, input().split())
if A+B < 2*C:
print(A*X+B*Y)
else: #ABピザを二枚ずつ増やしていく
ans = float('inf')
for i in range(0,max(X,Y)*2+1,2):
ans = min(ans, max((X-i//2), 0)+max(B*(Y-i//2),0) + C*i)
print(ans) |
p03371 | s590046979 | Wrong Answer | pa, pb, pab, x, y = map(int, input().split())
li = []
if x-y>= 0:
li.append(pa*x+pb*y)
li.append(pa*(x-y)+pab*2*y)
li.append(pa*(x-y+1)+pb+pab*2*(y-1))
li.append(pab*2*x)
if y-x>= 0:
li.append(pa*x+pb*y)
li.append(pb*(y-x)+pab*2*y)
li.append(pa+pb*(y-x+1)+pab*2*(y-1))
li.append(pab*2*y)
li.sort()
print(li[0]) |
p03371 | s550509314 | Wrong Answer | ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
a,b,c,x,y = nm()
min_cost = 10**7
for i in range(10**6):
cost=2*c*i+max(0,x-i)*a+max(0,y-i)*b
min_cost = min(min_cost,cost)
print(min_cost)
|
p03371 | s057385519 | Wrong Answer | import sys
a,b,c,x,y=map(int,input().split())
ans=0
ans1=0
if a+b<=c*2:
while x>0 and y>0:
ans+=a+b
x-=1
y-=1
elif a+b>=c*2:
while x>0 and y>0:
ans+=c*2
x-=1
y-=1
while x>0 or y>0:
ans1+=c*2
x-=1
y-=1
if x==0:
while y>0:
ans+=b
y-=1
elif y==0:
while x>0:
ans+=a
x-=1
if ans>ans1:
print(ans1)
sys.exit()
print(ans) |
p03371 | s543506991 | Wrong Answer | a, b, c, x, y = map(int, input().split())
count = a * x + b * y
for i in range(10 ** 5):
num = i * 2 * c + max(0, x - i) * a + max(0, y - i) * b
if(count > num):
count = num
print(count)
|
p03371 | s285761879 | Wrong Answer | def resolve():
import sys
input = sys.stdin.readline
a,b,c,x,y=map(int,input().split())
z=min(x,y)
ans=min(a*x+b*y,a*(x-z)+b*(y-z)+c*z*2)
print(ans)
if __name__ == '__main__':
resolve() |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.