problem_id stringclasses 100
values | submission_id stringlengths 10 10 | status stringclasses 2
values | code stringlengths 6 806 |
|---|---|---|---|
p03371 | s822365045 | Wrong Answer | a,b,c,x,y = map(int, input().split())
if a + b <= 2*c:
print(a*x+b*y)
else:
ab_cnt = min(x,y)
remain_a = x-ab_cnt
remain_b = y-ab_cnt
print(ab_cnt*2*c + remain_a*a + remain_b*b) |
p03371 | s521538707 | Wrong Answer | a, b, c, x, y = map(int, input().split())
ans = float('inf')
for i in range(1, 100001):
ans = min(ans, c * 2 * i + max(x - i, 0) * a + max(y - i, 0) * b)
print(ans) |
p03371 | s866200722 | Wrong Answer | a, b, c, x, y = map(int, input().split())
if x > y:
cost = min(a*x + b*y, x*c*2, y*c*2 + (x-y)*a)
else:
cost = min(a*x + b*y, y*c*2, x*c*2 + (y-x)*a)
print(cost) |
p03371 | s005035998 | Wrong Answer | A,B,C,X,Y = map(int,input().split())
l = []
for c in range(0,max(2*X,2*Y)+1,2):
l.append(A*(X-c/2) + B*(Y-c/2) + C*c)
print(int(min(l))) |
p03371 | s844476326 | Wrong Answer | a,b,c,x,y=map(int,input().split())
normal=a*x+b*y
half=c*2*min(x,y)+max(a*(x-y),b*(y-x))
print(min(half,normal)) |
p03371 | s468766840 | Wrong Answer | #095_C
a, b, c, x, y = map(int, input().split())
if a+b > c*2:
if x == y:
print(c*2*x)
elif x > y:
print(a*(x-y) + c*2*y)
elif x < y:
print(b*(y-x) + c*2*x)
else:
print(a*x + b*y) |
p03371 | s956427022 | Wrong Answer | a, b, c, x, y = map(int, input().split())
if min(a, b, c) == c:
print(c * 2 * max(x, y))
# print("1")
elif (a + b) / 2 >= c:
if x >= y:
print(c * 2 * y + a * (x - y))
# print("2-1")
else:
print(c * 2 * x + b * (y - x))
# print("2-2")
else:
print(a * x + b * y)
# print("3") |
p03371 | s395738591 | Wrong Answer | A, B, C, X, Y = map(int, input().split())
C = 2*C
ans = float('inf')
for i in range(1, 10**5+1):
ans = min(ans, C*i + A*max(0, X-i) + B*max(0, Y-i))
print(ans)
|
p03371 | s612185866 | Wrong Answer | A,B,C,X,Y=map(int,input().split())
M=[A,B,C]
ans=[]
ans.append(A*X+B*Y)
ans.append(C*max(X,Y)*2)
if A>B:
ans.append(C*min(X,Y)*2+A*(X-min(X,Y)))
if B>A:
ans.append(C*min(X,Y)*2+B*(Y-min(X,Y)))
print(min(ans)) |
p03371 | s940161503 | Wrong Answer | a, b, c, x, y = map(int, input().split())
ret = 0
if 2 * c <= a + b:
m = min(x, y)
ret += m * c
x -= m
y -= m
ret += min(2 * c, a) * x
y -= x
ret += min(2 * c, b) * y
print(ret)
|
p03371 | s876947087 | Wrong Answer | A, B, C, X, Y = map(int, input().split())
if A + B < 2 * C:
print(A*X + B*Y)
else:
if A*X + B*Y > 2*C*max(X, Y):
print(2*C*max(X, Y))
else:
C_num = min(X, Y)
if X > Y:
print(C_num*2*C + A*(X-C_num))
else:
print(C_num*2*C + B*(Y-C_num))
|
p03371 | s195826211 | Wrong Answer | a, b, c, x, y = map(int, input().split())
count = float("inf")
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 | s475546578 | Wrong Answer | a, b, c, x, y = map(int, input().split())
if a > 2 * c and b > 2 * c:
print(max(x, y) * 2 * c)
elif a > c or b > c:
if c > (a+b) // 2:
print(a*x + b*y)
else:
if x > y:
print(c * y * 2 + a * (x - y))
else:
print(c * x * 2 + b * (y - x))
else:
print(a*x + b*y) |
p03371 | s615396008 | Wrong Answer | #C
a, b, c, x, y = map(int,input().split())
ans = 0
if a + b <= 2*c:
print(a*x + b*y)
else:
ans += min(x,y) * 2*c
r = max(x,y) - min(x,y)
if max(x,y) == x:
if a <= 2*c:
ans += a*r
else:
ans += 2*c*r
else:
if b <= 2*c:
ans += c*r
else:
ans += 2*c*r
print(ans) |
p03371 | s351254855 | Wrong Answer | a,b,c,x,y=map(int, input().split())
if x>y:
print(min(a*x+b*y,2*c*y+a*(x-y),2*c*x))
else:
print(min(a*x+b*y,2*c*y+b*(y-x),2*c*y)) |
p03371 | s989891899 | Wrong Answer | def main():
a, b, c, x, y = map(int, input().split())
total_min = a * x + b * y
for i in range(2, max(x, y)+1):
total = a * max(x - i, 0) + b * max(y - i, 0) + c * i * 2
total_min = min(total, total_min)
print(total_min)
if __name__ == "__main__":
main() |
p03371 | s359507990 | Wrong Answer | a,b,c,x,y=map(int,input().split())
c=c*2
if c<=min(a,b):
print(c*max(x,y))
elif (a+b)>=c:
if x>=y:
print(y*c+(x-y)*a)
else:
print(x*c+(y-x)*b)
else:
print(a*x+b*y) |
p03371 | s498704808 | Wrong Answer | A, B, C, X, Y = map(int, input().split())
ans = 1e1000
for i in range(X):
for j in range(Y):
for k in range(0, X+Y, 2):
if i+k/2==X and j+k/2==Y:
ans = min(ans, A*i+B*j+C*k)
print(ans) |
p03371 | s454552515 | Wrong Answer | import numpy as np
a,b,c,x,y = map(int,input().split())
ans = min(a+b,c*2)*min(x,y)
if c*2 <= min(a,b):
ans +=c*2*np.abs(x-y)
elif x > y:
ans += a*(x-y)
else:
ans += b*(y-x)
print(ans) |
p03371 | s031669146 | 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)
cm+=2
print(min(cost)) |
p03371 | s657071175 | Wrong Answer | # 2020/04/23
# AtCoder Beginner Contest 095 - C
# Input
a, b, c, x, y = map(int,input().split())
# Calc
case1 = a * x + b * y
case2 = x * 2 * c + max(0, (x * 2 - y) * b)
case3 = max(0, (y * 2 - x) * a) + y * 2 * c
case4 = max(x, y) * 2 * c
ans = min(case1, case2, case3, case4)
# Output
print(ans)
|
p03371 | s228351186 | Wrong Answer | a,b,c,x,y = map(int,input().split())
c = c*2
n = max(x,y)
ans = 10**25
for i in range(10**5):
x1,y1 = i,i
p = c*i
if x > x1:
if y > y1:
p += a*(x-x1) + b*(y-y1)
else:
p += a*(x-x1)
else:
if y > y1:
p += b*(y+y1)
if ans > p:
ans = p
print(ans) |
p03371 | s774930301 | 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:
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 | s597585048 | Wrong Answer | a, b, c, x, y = map(int, input().split())
ans = 5000*10**5 + 1
for i in range(10**5+1):
price = a*max(x-i, 0) + b*max(y-i, 0)+ i*2*c
ans = min(ans, price)
print(ans)
|
p03371 | s044855330 | Wrong Answer | a,b,c,x,y=map(int,input().split())
sum=0
tmp=min(x,y)
if a+b>=2*c:
sum+=2*c*tmp
x-=tmp
y-=tmp
print(x)
print(y)
if x==0:
if b>=2*c:
sum+=2*c*y
else:
sum+=b*y
elif y==0:
if a>=2*c:
sum+=2*c*x
else:
sum+=a*x
else:
sum+=a*x+b*y
print(sum) |
p03371 | s609279857 | Wrong Answer | A, B, C, X, Y = map(int,input().split())
m = 10^10
for i in range(X+1):
for j in range(Y+1):
k = min(2*X-i,2*Y-j)
m = min(m,A*i+B*j+C*k)
print(m)
|
p03371 | s145941876 | Wrong Answer | a,b,c,x,y=map(int,input().split())
case=[]
case.append(a*x+b*y)
if x>=y:
case.append(c*x*2)
case.append(((x-y)*a)+(c*y*2))
else:
case.append(y*c*2)
case.append(((y-x)*a)+(c*x*2))
print(min(case)) |
p03371 | s021139678 | Wrong Answer | a, b, c, x, y = map(int, input().split())
if c < (a + b) / 2:
if c < a and c < b:
ans = c * 2 * max(x, y)
else:
ans = c * 2 * min(x, y)
if x > y:
ans += a * abs(y - x)
elif x < y:
ans += b * abs(y - x)
else:
ans = a * x + b * y
print(ans)
|
p03371 | s848797405 | Wrong Answer | a, b, c, x, y = map(int, input().split())
ans1 = a * x + b * y #そのまま
if x > y: #少ない方をABで補う
ans2 = c * min(x, y) * 2 + a * (x - y)
else:
ans2 = c * min(x, y) * 2 + b * (y - x)
ans3 = c * max(a, b) * 2 #すべてABで
print(min(ans1, ans2, ans3)) |
p03371 | s646170614 | Wrong Answer | A,B,C,X,Y=map(int,input().split())
Xo=A*X+B*Y
if X>=Y:
X1=A*(X-Y)+2*C*Y
else:
X1=B*(Y-X)+2*C*Y
X2=2*C*max(X,Y)
print(min(Xo,X1,X2))
|
p03371 | s387060243 | Wrong Answer | a, b, c, x, y = map(int, input().split())
ans = 0
z = min(x, y)
if (a + b) // 2 > c:
ans += z * c * 2
x, y = x - z, y - z
for d, z in ((a, x), (b, y)):
if d // 2 > c:
ans += z * c * 2
else:
ans += d * z
print(ans) |
p03371 | s727725353 | Wrong Answer | A,B,C,X,Y = map(int,input().split())
plan_P = A*X + B*Y
if X >= Y :
plan_Q = A*(X-Y) + C * 2 * Y
else:
plan_Q = B *(Y-X) + C * 2 * X
if (A + B) <= 2 * C:
print(plan_P)
else:
print(plan_Q) |
p03371 | s591844340 | Wrong Answer | a,b,c,x,y = list(map(int, input().split()))
if a + b < 2*c :
print(x*a + y*b)
else :
if x >= y :
if a >= 2*c:
print(y*2*c + (y-x)*2*c)
else :
print(y*2*c + (y-x)*a)
else :
if b >= 2*c:
print(x*2*c + (x-y)*2*c)
else:
print(x*2*c + (x-y)*b)
|
p03371 | s896506038 | 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
elif Y>X:
Q=C*2*Y+(Y-X)*B
L=Y*2*C
elif X==Y:
Q=min(C*2*Y, C*2*X)
L=min(X*2*C, Y*2*C)
print(min(P,Q,L)) |
p03371 | s506144944 | Wrong Answer | A,B,C,X,Y=map(int,input().split())
if A>=2*C:
if B>=2*C:
print(2*C*max(X,Y))
exit()
else:
print(2*C*X+B*max(0,(Y-X)))
exit()
elif B>=2*C:
print(2*C*Y+A*max(0,(X-Y)))
exit()
else:
ans=A*X+B*Y
for i in range(1,max(X,Y)):
p=A*(X-i)+B*(Y-i)+2*C*i
ans=min(ans,p)
print(ans) |
p03371 | s094831593 | Wrong Answer | A, B, C, X, Y = map(int, input().split())
minim = 1e10
for i in range(max(X, Y)):
bill = i*2*C + A*max(0, X-i) + B*max(0, Y-i)
minim = min(minim, bill)
print(minim) |
p03371 | s822976390 | Wrong Answer | a,b,c,x,y = map(int, input().split())
kei = 0
if c >= a/2 + b/2:
kei = a * x + b*y
elif c*2 <= a+ b and a >= c * 2 and b >= c * 2 :
kei += c * (min(x,y)*2)
if x > y:
kei += c * ((x - y)*2)
else:
kei += c * ((y - x)*2)
elif c <= a/2 + b/2:
kei += c * (min(x,y)*2)
if x > y:
kei += a * (x -y)
else:
kei += b *(y-x)
print(kei) |
p03371 | s794337950 | Wrong Answer | a, b, c, x, y = map(int, input().split())
if (a >= 2 * c and b >= 2 * c): print(max(x, y) * 2 * c)
elif (a + b <= 2 * c): print(a * x + b * y)
elif (x > y): print((x - 1) * 2 * c + a)
elif (y < x): print((y - 1) * 2 * c + b)
else: print(2 * c * x)
|
p03371 | s446657648 | Wrong Answer | A,B,C,X,Y=map(int,input().split())
if A+B<=C*2:
print(A*X+B*Y)
elif min(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 | s148497646 | Wrong Answer | # 18:32
a, b, c, x, y = map(int, input().split())
mxy = max(x, y)
sxy = min(x, y)
sum = 0
if a+b-2*c > 0:
sum += c*min(x, y)*2
if x > y and a < 2*c:
sum += (max(x, y)-min(x, y))*a
elif x > y:
sum += (max(x, y)-min(x, y))*2*c
elif x <= y and a < 2*c:
sum += (max(x, y)-min(x, y))*b
elif x <= y:
sum += (max(x, y)-min(x, y))*2*c
else:
sum = a*x+b*y
print(sum)
|
p03371 | s522563048 | Wrong Answer | INF = int(1e5)+5
def main():
a, b, c, x, y = map(int, input().split())
ans = INF*max(a, b, c)
for i in range(INF):
tmp = 2*i*c + a*max(x-i, 0) + b*max(y-i, 0)
ans = min(tmp, ans)
print(ans)
main() |
p03371 | s970633551 | Wrong Answer | A,B,C,X,Y=map(int,input().split())
if A+B>2*C:
if X>=Y:
print(min(C*A,Y*2*C+((X-Y)*A)))
else:
print(min(C*B,X*2*C+((Y-X)*B)))
else:
print(A*X+B*Y) |
p03371 | s323190680 | Wrong Answer | A, B, C, X, Y = map(int, input().split())
ans = 1 << 30
# ABピザを全探索して考える
for i in range(max(2*X,2*Y)+1, 2):
x = X - i // 2
y = Y - i // 2
ans = min(ans, A * max(0,x) + B * max(0,y) + C * i)
print(ans)
|
p03371 | s902941873 | Wrong Answer |
a,b,c,x,y = map(int,input().split())
price = a * x + b * y
for i in range(max(a,b) + 1):
ab = 2 * i
cand = ab * c + a * max(0, x - i) + b * max(0, y-i)
price = min(price, cand)
print(price)
|
p03371 | s804471318 | Wrong Answer | def solve(a,b,c,x,y):
k_max = min(x,y)
l = []
for i in range(k_max+1):
s = a*(min(x-i,0))+b*(min(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 | s614576352 | Wrong Answer | def i():
return int(input())
def i2():
return map(int,input().split())
def s():
return str(input())
def l():
return list(input())
def intl():
return list(int(k) for k in input().split())
a,b,c,x,y = i2()
if a+b > 2*c:
z = min(x,y)
print( a*(x-z)+b*(y-z)+c*2*z)
else:
print( a*x+b*y ) |
p03371 | s030698898 | Wrong Answer | a, b, c, x, y = map(int, input().split())
dc = c * 2
if dc <= a + b:
if dc <= a or dc <= b:
ans = dc * max(x, y)
else:
ans = dc * min(x, y)
if x > y:
ans += a * abs(y - x)
elif x < y:
ans += b * abs(y - x)
else:
ans = a * x + b * y
print(ans)
|
p03371 | s252567311 | Wrong Answer | a,b,c,x,y=map(int,input().split())
m=10**10
for i in range(x+y+1):
p=2*i
m=min(m,(x-i)*a+(y-i)*b+p*c)
print(m)
|
p03371 | s502363798 | Wrong Answer | a, b, c, x, y = map(int, input().split())
ans = 0
if c <= a <= b or c <= b <= a:
ans += c * max(x, y)*2
print(ans)
exit()
if 2*c-a-b > 0:
ans += a*x + b*y
else:
s = min(x, y)
ans += min(c*s*2 + a*(x-s) + b*(y-s), c*max(x, y)*2)
print(ans) |
p03371 | s365117609 | Wrong Answer | #C
a, b, c, x, y = map(int,input().split())
ans = 0
if a + b <= 2*c:
print(a*x + b*y)
else:
ans = min(x,y) * 2*c
r = max(x,y) - min(x,y)
if max(x,y) == x:
if a <= 2*c:
ans += a*r
else:
ans += 2*c*r
else:
if b <= 2*c:
ans += c*r
else:
ans += 2*c*r
print(ans) |
p03371 | s628712323 | Wrong Answer | def resolve():
a, b, c, x, y = map(int, input().split())
ans = 0
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
else:
ans += a*(x-com) + b*(y-com)
else:
ans += a*x + b*y
print(ans)
if __name__ == '__main__':
resolve() |
p03371 | s574745822 | Wrong Answer | a,b,c,x,y = map(int,input().split())
# print(a,b,c,x,y)
v1 = max(x*2,y*2)*c
v2 = a*x+b*y
v3 = min(x,y)*c*2 + abs(x-y)*min(a,b)
# print(v1,v2,v3)
print(min(v1,v2,v3))
|
p03371 | s310504438 | Wrong Answer | a, b, c, x, y = [int(i) for i in input().split(" ")]
s = [x, y, 0]
charge = s[0]*a+s[1]*b+s[2]*c
for i in range(min(x, y), 0, -1):
s = [s[0]-1, s[1]-1, s[2]+2]
charge = min(charge, s[0]*a+s[1]*b+s[2]*c)
print(charge) |
p03371 | s931084602 | Wrong Answer | A, B, C, X, Y = map(int,input().split())
def best_pizza_cost(ln, hn):
if ln == X: lp = A
else: lp = B
if hn == Y: hp = B
else: hp = A
fnp = lp * ln + hp * ln
fhp = C * ln * 2
left = hn-ln
snp = hp * left
shp = C * left * 2
print(fnp, fhp, snp, shp)
return min(fnp, fhp) + min(snp, shp)
print(best_pizza_cost(min(X, Y), max(X, Y))) |
p03371 | s992740715 | 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
print(min(ans1, ans2, ans3, ans4))
|
p03371 | s766574104 | Wrong Answer | def half_and_half(a,b,c,x,y):
z = x if a > b else y
can = []
for n in range(z+1):
p = x - n if x > n else 0
q = y - n if y > n else 0
amount = p*a + q*b + n*c*2
#print("%d = %d x %d + %d x %d + %d x %d " %(amount,p,a,q,b,n,c))
can.append(amount)
print(min(can))
if __name__ == '__main__':
a,b,c,x,y = map(int,input().split())
half_and_half(a,b,c,x,y)
|
p03371 | s976720049 | Wrong Answer | A, B, C, X, Y = map(int, input().split())
total = 0
ans = 10**10
for i in range(2, max(X, Y)*2, 2):
total = A*(X-(i/2)) + B*(Y-(i/2)) + C*i
ans = min(ans, total)
print(int(ans)) |
p03371 | s395657133 | Wrong Answer | A,B,C,X,Y=map(int,input().split())
ans=5000*(10**5)+1
for i in range(max(X,Y)):
total=0
total=2*C*i+A*max(X-i,0)+B*max(Y-i,0)
if ans>=total:
ans=total
print(ans) |
p03371 | s819789229 | Wrong Answer | # ABC095C
a, b, c, x, y = map(int, input().split())
if a > c or b > c:
t = min(x, y)
print("(1)", (x - t)*a + (y - t)*b + t*2*c)
else:
print("(2)", a*x + b*y)
|
p03371 | s621290562 | Wrong Answer | a, b, c, x, y = map(int, input().split())
if a+b < 2*c:
print(a*x + b*y)
else:
if x > y:
if a < c:
print(2*y*c + (x-y)*a)
else:
print(2*x*c)
else:
if b < c:
print(2*x*c + (y-x)*b)
else:
print(2*y*c) |
p03371 | s780682142 | Wrong Answer | a, b, ab, x, y = map(int, input().split())
if a+b <= 2*ab:
print(a*x+b*y)
exit()
if a >= 2*ab and b >= 2*ab:
print(max(x,y)*2*ab)
exit()
mix = min(x,y)*2*ab
f = lambda x, y: a if x - y >= 0 else b
print(mix+f(x, y)*abs(x-y)) |
p03371 | s611874586 | Wrong Answer | import sys
input = sys.stdin.readline
a,b,c,x,y=map(int,input().split())
c1=a*x+b*y
if x>=y:
c2=2*y*c+(x-y)*x
else:
c2=2*x*c+(y-x)*y
c3=2*max(x,y)*c
print(min(c1,c2,c3))
|
p03371 | s209983518 | 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
print(ans)
exit()
if (c-a+c-b) > 0:
ans += a*x + b*y
else:
s = min(x, y)
ans += min(c*s*2 + a*(x-s) + b*(y-s), c*max(x, y)*2)
print(ans) |
p03371 | s830963795 | Wrong Answer | A, B, C, X, Y = [int(x) for x in input().split(' ')]
if (A + B) / 2 > C:
p = 10**6
for i in range(min(X, Y), max(X, Y)+1):
p = min(p, A * max(0, X-i) + B * max(0, Y-i) + C * i * 2)
print(p)
else:
print(A * X + B * Y) |
p03371 | s605203536 | 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
else:
n = Y - n
sum = sum + n*B
print(sum)
s = (X+Y)*2*C
if sum>s:
print(s)
else:
print(sum) |
p03371 | s884400643 | 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 2 * C <= A + B:
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 | s992693046 | Wrong Answer | def LI(): return list(map(int,input().split()))
A,B,C,X,Y = LI()
ans = min(A*X+B*Y,C*(max(X,Y)*2))
if min(X,Y)%2==0:
temp = (min(X,Y)*2)*C + (max(X,Y)-min(X,Y))*(A if X>Y else B)
ans = min(temp,ans)
print(ans)
|
p03371 | s601406200 | Wrong Answer | a, b, c, x, y = map(int, input().split())
A = (a, x)
B = (b, y)
ans = 0
if A[0]+B[0] > 2*c:
mn = min(A, B, key=lambda x: x[1])
mx = max(A, B, key=lambda x: x[1])
q, r = divmod(mn[1], 2)
e1 = 2*q * 2*c + mn[0] * r + (mx[1]-2*q) * mx[0]
e2 = mx[1] * 2*c
ans = min(e1, e2)
else:
ans += A[0]*A[1] + B[0]*B[1]
print(ans)
|
p03371 | s162706448 | Wrong Answer | import math
A,B,C,x,y=map(int,input().split())
price=5000*(10**5)
for c in range(1+max([2*x,2*y])):
a=0
b=0
if x>c/2:
a=math.ceil(x-(c/2))
if y>c/2:
b=math.ceil(y-(c/2))
if A*a+B*b+C*c<price:
price=A*a+B*b+C*c
print(price) |
p03371 | s680322635 | Wrong Answer | a,b,c,x,y = map(int,input().split())
c = c*2
n = max(x,y)
ans = 10**25
for i in range(n*2):
x1,y1 = i,i
p = c*i
if x > x1:
if y > y1:
p += a*(x-x1) + b*(y-y1)
else:
p += a*(x-x1)
else:
if y > y1:
p += b*(y+y1)
if ans > p:
ans = p
print(ans) |
p03371 | s629333803 | Wrong Answer | a, b, c, x, y = map(int, input().split())
ans = 0
z = min(x, y)
if (a + b) // 2 > c:
ans += z * c * 2
x, y = x - z, y - z
if a // 2 <= c and b // 2 > c:
ans += y * c * 2
x = max(0, x - y)
ans += x * a
elif a // 2 > c and b // 2 <= c:
ans += x * c * 2
y = max(0, y - x)
ans += y * b
elif a //2 > c and b // 2 > c:
ans += max(x, y) * c * 2
else:
ans += x * a + y * b
print(ans) |
p03371 | s155799244 | Wrong Answer | a,b,c,x,y = map(int,input().split())
print( min(x,y)*min(a+b,2*c) + (max(x,y)-min(x,y))*(max(x,y)==y)*b + (max(x,y)-min(x,y))*(max(x,y)==x)*a)
|
p03371 | s394049656 | 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,C])==C:
print(2*C*max(X,Y))
elif X<=Y:
print(2*X*C+B*(Y-X))
else:
print(2*Y*C+A*(X-Y)) |
p03371 | s503341131 | Wrong Answer | a, b, c, x, y = map(int,input().split())
if (a+b)//2 <= c:
print(x*a + y*b)
exit()
ans = 0
ans += min(x,y) * c * 2
if x >= y:
ans += min((x-y)*a, (x-y)*2*c)
else:
ans += min((y-x)*b, (y-x)*2*c)
print(ans) |
p03371 | s198333127 | Wrong Answer | a,b,c,x,y = map(int,input().split())
if a+b > c*2:
mmm = min(x,y)
aaa = max(x,y)
if (x > y and x<=2*c):
print(c*2*mmm + a*(aaa-mmm))
elif (x > y and x>2*c):
print(c*2*aaa)
elif (x <= y and y<=2*c):
print(c*2*mmm + b*(aaa-mmm))
elif (x <= y and y>2*c):
print(c*2*aaa)
else:
print(a*x + b*y)
|
p03371 | s661746804 | Wrong Answer | a,b,c,x,y=map(int,input().split())
c=min(c*2,a+b)
ans=min(x,y)*c
if x>y:ans+=min(a,c)*(y-x)
else:ans+=min(b,c)*(x-y)
print(ans) |
p03371 | s530596596 | Wrong Answer | a,b,c,x,y=[int(i) for i in input().split()]
ans=1000000
for k in range(10**5):
money=2*c*k + max(x-k,0)*a + max(y-k,0)*b
if(ans>money):
ans=money
print(ans)
|
p03371 | s436058818 | Wrong Answer | a,b,c,x,y = map(int,input().split())
p = 0
if x > y:
p += (x - y) * a
x = y
if x < y:
p += (y - x) * b
y = x
if x % 2 == 1:
p += x + y
x -= 1
y -= 1
if x > 0:
n = x // 2 * c
m = x * a + y * b
p += min(n,m)
print(p) |
p03371 | s040864852 | Wrong Answer | a , b , c , x , y = map(int,input().split())
k = max(x,y)
minman = 9999999999999
k = k // 2
for i in range(k,-1,-1):
now_x = x
now_y = y
ans = c * (i * 4)
now_x = now_x - (i * 2)
now_y = now_y - (i * 2)
if now_x < 0:
now_x = 0
if now_y < 0:
now_y = 0
ans +=( now_x * a ) + ( now_y * b)
if minman > ans:
minman = ans
print(minman) |
p03371 | s899822974 | Wrong Answer | # -*- coding: utf-8 -*-
"""
Created on Tue Mar 31 11:16:07 2020
@author: liang
"""
A, B, C, X, Y = map(int,input().split())
if A + B > 2*C:
if X > Y :
ans = Y * C * 2 + abs(X-Y) * A
else:
ans = X * C * 2 + abs(X-Y) * B
else:
ans = X * A + Y * B
print(ans) |
p03371 | s892719394 | Wrong Answer | a,b,c,x,y=map(int,input().split())
if a+b<=c:
print(a*x+b*y)
else:
c*2*min(x,y)+min(max(a*min(x,y),b*min(x,y)),c*2*abs(x-y)) |
p03371 | s636686447 | Wrong Answer | a, b, c, x, y = map(int, input().split())
big = max(a, b)
small = min(a, b)
small_many = False
if (small == a and y <= x) or (small == b and x <= y):
small_many = True
if big <= c:
print(x * a + y * b)
elif small <= c < big:
if ((big + small) <= 2 * c):
print(x * a + y * b)
else:
if small_many:
print(2 * c * min(x, y) + small * (max(x, y) - (min(x, y))))
else:
print(2 * c * max(x, y))
else:
print(2 * c * max(x, y))
|
p03371 | s723119878 | Wrong Answer | a, b, c, x, y = map(int, input().split())
pat1 = 0
pat2 = 0
pat3 = 0
pat4 = 0
pat5 = 0
ans = []
if a+b >= c*2:
if x >= y:
pat1 = y * 2 * c
x -= y
pat1 += x * a
x += y
pat2 = x * 2 * c
else:
pat3 = x * 2 * c
y -= x
pat3 += x * a + y * b
y += x
pat4 = y * 2 * c
else:
pat5 += x * a + y * b
ans.extend([pat1, pat2, pat3, pat4, pat5])
ans = [i for i in ans if i!= 0]
print(min(ans)) |
p03371 | s795059436 | 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 | s547005822 | Wrong Answer | cost_a,cost_b,cost_ab,num_a,num_b = map(int,input().split())
num = max(num_a,num_b)
cost1 = num * 2 * cost_ab
cost2 = cost_a * num_a + cost_b * num_b
if cost1 > cost2:
print(cost2)
else:
print(cost1) |
p03371 | s827050699 | Wrong Answer | a,b,c,x,y=map(int,input().split())
if a>=c*2 and b>=c*2:
print(c*2*max(x,y))
elif a<=c*2 and b>=c*2:
print(c*2*y+a*x)
elif b<=c*2 and a>=c*2:
print(c*2*x+b*y)
elif (a+b)>=c*2:
z=min(x,y)
x-=z
y-=z
print(c*2*z+a*x+b*y)
else:
print(a*x+b*y)
|
p03371 | s474854439 | Wrong Answer | A, B, C, X, Y = map(int, input().split())
total = 0
ans = 10**10
for i in range(0, max(X, Y)*2, 2):
total = A*(X-(i/2)) + B*(Y-(i/2)) + C*i
ans = min(ans, total)
print(int(ans)) |
p03371 | s286829831 | Wrong Answer | a,b,c,x,y = map(int,input().split())
c *= 2
ans = 10 ** 16
for i in range(max(x,y)):
m = 0
m += (a*(x-i))+(b*(y-i))+(c*i)
ans = min(ans,m)
print(ans) |
p03371 | s078848107 | Wrong Answer | a,b,c,x,y = map(int, input().split())
mix_price = min(a+b,c*2)
if a > 2 * c or b > 2 * c:
print(max(x,y) * 2 * c)
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 | s258243179 | Wrong Answer | a,b,c,x,y=map(int,input().split())
ans=a*x+b*y
for ab in range(1,max(a,b)):
if 2*ab*c+a*(max(x-ab,0))+b*(max(0,y-ab))<ans:
ans=2*ab*c+a*(max(x-ab,0))+b*(max(0,y-ab))
print(ans) |
p03371 | s694359627 | 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 and x > y:
print(x * 2 * c)
elif a > 2 * c and x < y:
print(x * 2 * c + (y - x) * b)
elif b > 2 * c and x < y:
print(y * 2 * c)
elif b > 2 * c and x > y:
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 | s978016595 | Wrong Answer | a,b,c,x,y = map(int,input().split())
ans = 10**20
for i in range(min(x,y)*2+1):
ans = min(ans,c*i+a*max(0,x-i//2)+b*max(0,y-i//2))
print(ans) |
p03371 | s225710211 | Wrong Answer | #pattern1:Only A-pizza/B-pizza
#pattern2:Only C-pizza
#pattern2:C-pizza & A or B-pizza
a,b,c,x,y = map(int, input().split())
min_price = 1000000000000
for i in range(1, 10**5 + 1):
price = i*2*c + max(0, x-i)*a + max(0, y-i)*b
min_price = min(min_price, price)
print(min_price) |
p03371 | s381689422 | Wrong Answer | a, b, c, x, y = map(int, input().split())
ans = 10000000
for i in range(min(x, y) + 1):
nc = 2 * i * c
na = max(0, (a * (x - i)))
nb = max(0, (b * (y - i)))
ans = min(ans, nc + na + nb)
print(ans) |
p03371 | s383167055 | Wrong Answer |
[A,B,C,X,Y] = list(map(int,input().split()))
out=10**6
for c in range(2*(10**5)+1):
if c%2==0:
a = X - c//2
b = Y - c//2
cost = A*a + B*b + C*c
if cost>=0 and a>=0 and b>=0:
# print('a,b,c,cost:',a,b,c,cost)
out=min(out,cost)
print(out)
|
p03371 | s720137258 | 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
print(min(ans1, ans2, ans3))
|
p03371 | s839968384 | Wrong Answer | import sys
input = sys.stdin.readline
def main():
A, B, C, X, Y = [int(x) for x in input().split()]
ans = []
ans.append(A * X + B * Y)
ans.append(C * 2 * (max(X, Y)))
if X > Y:
ans.append(C * 2 * Y + (X - Y) * A)
else:
ans.append(C * 2 * Y + (Y - X) * B)
print(min(ans))
if __name__ == '__main__':
main()
|
p03371 | s695897922 | Wrong Answer | a , b , c , x , y = map(int,input().split())
k = max(x,y)
minman = 999999999999999999999
ans = 999999999999999999999999
k = k // 2
for i in range(k,-1,-1):
now_x = x
now_y = y
ans = c * (i * 4)
now_x = now_x - (i * 2)
now_y = now_y - (i * 2)
if now_x < 0:
now_x = 0
if now_y < 0:
now_y = 0
ans +=( now_x * a ) + ( now_y * b)
if minman > ans:
minman = ans
print(minman) |
p03371 | s496063874 | Wrong Answer | a,b,c,x,y = map(int,input().split())
ans=float("inf")
for i in range(0,max(x,y)*2+1,2):
ans = min(ans, a*max(0,x-i/2)+b*max(0,y-i/2)+c*i)
print(ans) |
p03371 | s671179041 | Wrong Answer | # AtCoder Beginner Contest 095 C - Half and Half
import sys
A, B, C, X, Y = map(int, sys.stdin.readline().strip().split())
ans = A * X + B * Y
for z in range(2, 10 ** 5 + 1, 2):
x = max(X - int(z / 2), 0)
y = max(Y - int(z / 2), 0)
price = A * x + B * y + C * z
ans = min(price, ans)
print(ans)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.