problem_id
stringclasses
100 values
submission_id
stringlengths
10
10
status
stringclasses
2 values
code
stringlengths
6
806
p03371
s471116631
Wrong Answer
a,b,c,x,y = map(int,input().split()) a_b = (a+b) // 2 ans = 0 if a_b > c: ans += min(x,y)*c*2 if x > y: if a > c*2: ans += (x - y)*c*2 else: ans += (x - y)*a else: if b > c*2: ans += (y - x)*c*2 else: ans += (y - x)*b else: ans += x*a+y*b print(ans)
p03371
s082857938
Wrong Answer
A,B,C,X,Y = map(int,input().split()) if 2*C<A and 2*C<B: ans=C*(2*max(X,Y)) print(ans) exit() ans=10**10 for i in range(0,2*min(X,Y)+1,2):#ABピザを買う枚数を2枚ずらしで全探索 tmp = A*(X-0.5*i) + B*(Y-0.5*i) + C*i ans=min(ans,tmp) print(int(ans))
p03371
s020625115
Wrong Answer
a, b, c, x, y = map(int, input().split()) n = a*x + b*y sx, rx = divmod(x, 2) sy, ry = divmod(y, 2) s = 2*min(sx, sy) m = 2*c*s + a*(2*sx-s+rx) + b*(2*sy-s+ry) print(min(n, m))
p03371
s167026012
Wrong Answer
a, b, c, x, y = (int(each) for each in input().split()) cost = [x*a + y*b] for i in range(max(x, y)*2): numofabpizza = i*2 numofapizza = max(0, (x-numofabpizza)) numofbpizza = max(0, (y-numofabpizza)) # print(numofapizza, numofbpizza, numofabpizza) cost.append(numofapizza*a + numofbpizza*b + (2*numofabpizza)*c) # print(cost) print(min(cost))
p03371
s239957095
Wrong Answer
a,b,c,x,y = map(int,input().split()) ans = 0 if a + b >= c * 2: ans = c * 2 * min(x,y) if min(a,b) >= c * 2: ans += (max(x,y) - min(x,y)) * (c * 2) else: if x >= y: ans += min((max(x,y) - min(x,y)) * a,(max(x,y) - min(x,y)) * b) else: ans = a * x + b * y print(ans)
p03371
s708608005
Wrong Answer
A,B,C,X,Y=map(int,input().split()) ans=5000*(10**5)+1 for i in range(max(X,Y)+1): total=0 total=2*C*i+A*max(X-i,0)+B*max(Y-i,0) ans=min(total,ans) print(ans)
p03371
s951991728
Wrong Answer
A,B,C,X,Y=map(int,input().split()) price=0 if A+B>C+C: minXY=min(X,Y) price+=minXY*C*2 X-=minXY Y-=minXY if A>C+C: price=X*2*C X=0 else: price+=A*X X=0 if B>C+C: price=Y*2*C Y=0 else: price+=B*Y Y=0 print(price)
p03371
s716671620
Wrong Answer
a, b, c, x, y = map(int, input().split()) ans = 10**5 for i in range(10**5): tmp = 2*c*i + (x-i)*a + (y-i)*b ans = min(ans, tmp) if i >= x or i >= y: break print(ans)
p03371
s264449220
Wrong Answer
piza = list(map(int,input().split())) x = piza[0] * piza[3] + piza[1] * piza[4] #普通に買うパターン y = piza[2] * 2 * max(piza[3],piza[4]) if piza[3] >= piza[4]: z = piza[2] * (2 * piza[4]) + piza[0] * (piza[3] - piza[4]) else: z = piza[2] * (2 * piza[3]) + piza[0] * (piza[4] - piza[3]) print(min(x,y,z))
p03371
s495479428
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**6): 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
s421382961
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*max(X,Y)*C)
p03371
s948975707
Wrong Answer
a,b,c,x,y=map(int,input().split()) ans=0 if a+b<=c*2: print(a*x+b*y) exit() elif x>=y: ans+=c*y*2 x-=y if a>=c*2: ans+=c*2*x else: ans+=a*x elif y>x: ans+=c*x*2 y-=x if b>=c*2: ans+=c*2*y else: ans+=b*x print(ans)
p03371
s092412890
Wrong Answer
a,b,c,x,y=map(int,input().split()) ans=[] ans.append(a*x+b*y) ans.append(c*x+y*max(0,b-c)) ans.append(c*y+x*max(0,a-c)) print(min(ans))
p03371
s633805876
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 if y>0: if b<=2*c: costs += x*b else: costs += x*2*c print(costs)
p03371
s282533534
Wrong Answer
a, b, c, x, y = list(map(int, input().split())) ans = 10**5*max(a,b,c) for i in range(0, max(x,y)+1): s = a*max(0,x-i)+b*max(0,y-i)+c*2*i ans = min(ans, s) print(ans)
p03371
s597693307
Wrong Answer
a, b, c, x, y = [int(i) for i in input().split()] m = 0 if a + b > c * 2: if x > y: m += 2 * c * min(x, y) + min(a * (x - y), 2 * c * (x - y)) else: m += min(b * (y - x), 2 * c * (y - x)) else: m += a * x + b * y print(m)
p03371
s278380447
Wrong Answer
A, B, C, X, Y = map(int, input().split()) print(min(C*2*min(X, Y)+abs(X-Y)*min(A, B), C*2*max(X, Y), C*2*max(X, Y)+abs(X-Y)*min(A, B), A*X+B*Y))
p03371
s757219422
Wrong Answer
a,b,c,x,y=map(int,input().split()) if x>y: print(min(2*x*c,2*y*c+(x-y)*a,a*x+b*y)) else: print(min(2*y*c,2*x*c+(y-x)*a,a*x+b*y))
p03371
s670689879
Wrong Answer
A,B,C,X,Y=map(int,input().split()) ans_2=A*X+B*Y ans=min(X,Y)*2*C mindelta=10**20 for i in range(1,max(X,Y)+1-min(X,Y)): delta=0 if X>Y: delta=2*C*i+A*(max(X,Y)-min(X,Y)-i) if delta<mindelta: mindelta=delta if Y>X: delta=2*C*i+B*(max(X,Y)-min(X,Y)-i) if delta<mindelta: mindelta=delta val=min([ans+mindelta,ans_2]) print(val)
p03371
s860497484
Wrong Answer
a,b,c,x,y = map(int,input().split()) if a+b<=2*c:#そのまま買えばいいとき print(x*a+y*b) else:#ABピザを買ったほうが安くなる場合 if a*x+b*y<2*c*max(x,y): cnt=2*c*min(x,y) #ABピザを買えるだけ買う if x<y: cnt+=b*(y-x) elif x>y: cnt+=a*(x-y) else: cnt=2*c*max(x,y) print(cnt)
p03371
s225443647
Wrong Answer
##import sys #import numpy as np import math #from fractions import Fraction import itertools from collections import deque from collections import Counter import heapq from fractions import gcd #input=sys.stdin.readline #import bisect a,b,c,x,y=map(int,input().split()) if x<y: ans=min((a*x+b*y),2*x*c+a*(y-x),2*y*c) else: ans=min((a*x+b*y),2*y*c+b*(x-y),2*x*c) print(ans)
p03371
s185077536
Wrong Answer
S = input().split(" ") A = int(S[0]) B = int(S[1]) C = int(S[2]) X = int(S[3]) Y = int(S[4]) def calculate(a,b,c,x,y): s1 = a * x + b * y base = min([x,y]) values = [s1] for i in range(base): index = (i + 1) tmp = s1 - (A + B) * index + 2 * C * index values.append(tmp) print(min(values)) calculate(A,B,C,X,Y)
p03371
s690529565
Wrong Answer
a, b, c, x, y = (map(int, input().split())) candi = [] for i in range(100001): candi.append(c*i+max(0,(x-i//2))*a+max(0,(y-i//2))*b) print(min(candi))
p03371
s972257542
Wrong Answer
a, b, c, x, y = map(int, input().split()) if min(a, b) >= 2 * 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
s085980222
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*2 + (x - i//2) * a + (y - i//2) * b) print(ans)
p03371
s313739284
Wrong Answer
A, B, C, X, Y = map(int, input().split()) ans = 2*(5000*10**5) for Z in range(10**5+1): total = A*abs(X-Z)+B*abs(Y-Z)+2*C*Z ans = min(total,ans) print(ans)
p03371
s830652626
Wrong Answer
A, B, C, X, Y = map(int, input().split()) ans = 10**18 Z = max(X, Y) for i in range(Z+1): price = C*i + A*max(0, X-i) + B*max(0, Y-i) ans = min(ans, price) print(ans)
p03371
s919591229
Wrong Answer
a,b,c,x,y=map(int,input().split()) ans=int(5000*(10**5)) for i in range(10**5): a_cnt=max(0,x-i) b_cnt=max(0,y-i) total=i*2*c+a_cnt*a+b_cnt*b ans=min(ans,total) print(ans)
p03371
s071424275
Wrong Answer
a,b,c,x,y=map(int,input().split()) result=[] if(x>y): result.append(a*x+b*y) result.append(a*(x-y)+2*c*y) result.append(2*c*x) elif(x<y): result.append(a*x+b*y) result.append(b*(y-a)+2*c*x) result.append(2*c*y) else: result.append(a*x+b*y) result.append(2*c*x) print(min(result))
p03371
s677064392
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 i, j in ((a, x), (b, y)): if a // 2 > c: ans += j * c * 2 else: ans += i * j print(ans)
p03371
s168527198
Wrong Answer
a,b,c,x,y=list(map(int,input().split())) ans=0 if 2*c*max(x,y)<=a*x+b*y: ans+=2*c*max(x,y) elif a+b>2*c: ans+=2*c*min(x,y) if x>y: ans+=a*(x-y) else: ans+=b*(y-x) else: ans+=a*x+b*y print(ans)
p03371
s213799082
Wrong Answer
A, B, C, X, Y = map(int, input().split()) Sum = A * X + B * Y if A+B > 2*C: if X < Y: if 2*C <= B: Sum = C * Y else: Sum = C * X + B * (Y - X) elif Y < X: if 2*C <= A: Sum = C * X else: Sum = C * Y + A * (X - Y) else: Sum = C * X print(Sum)
p03371
s532755218
Wrong Answer
#関数リスト import sys input = sys.stdin.readline def RD(): return input().rstrip() def I(): return int(input().rstrip()) def MI(): return map(int, input().split()) def MF(): return map(float,input().split()) def LI(): return list(map(int, input().split())) def LF(): return list(map(float,input().split())) def main(): A, B, C, X, Y = MI() if C >= (A+B) / 2: print(A*X+B*Y) else: temp = min(X,Y) print(C*temp*2+(X-temp)*A+(Y-temp)*B) if __name__ == "__main__": main()
p03371
s190942040
Wrong Answer
A,B,C,X,Y = map(int,input().split()) X_piza = X Y_piza = Y minimum = 10**10 for i in range(0,10**5+2,2): if minimum>C*2*i+max(0,X-i)*A+max(0,Y-i)*B: minimum = C*2*i+max(0,X-i)*A+max(0,Y-i)*B print(minimum)
p03371
s176401907
Wrong Answer
a,b,c,x,y = map(int, input().split()) if c<a/2 and c<b/2: print(c*max(x,y)*2) elif (a+b)/2 < c: print(a*x + b*y) else: if x<y: print(c*2*x + b*(y-x)) else: print(c*2*y + a*(x-y))
p03371
s734068412
Wrong Answer
a,b,c,x,y=map(int,input().split()) sum=0 if a+b>=2*c: sum+=2*c*min(x,y) x-=min(x,y) y-=min(x,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
s972868575
Wrong Answer
A,B,C,X,Y=map(int,input().split()) ans=5000*(10**5)+1 for i in range(max(X,Y)+1): total=0 total=2*C*i+A*max(X-i,0)+B*max(Y-i,0) if ans>=total: ans=total print(ans)
p03371
s601060219
Wrong Answer
a,b,c,x,y = map(int,input().split()) if a//2 + b//2 > c: buf = min(x,y) * c * 2 buf2 = max(x,y) * c * 2 if min(x,y) == y: tmp = buf + abs(x-y) * a else: tmp = buf + abs(x-y) * b ans = min(buf2,tmp) else: ans = x * a + y * b print(ans)
p03371
s831771160
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
s332175188
Wrong Answer
A, B, C, X, Y = map(int, input().split()) K = 2 * C - A - B S = A*X + B*Y t =-1 * S * K z = min(X, Y, t) Z = max(X, Y) if K >= 0: print(S) elif S > Z*C*2: print(Z*C*2) else: P =S + K* z print(P)
p03371
s160641250
Wrong Answer
def solve(a,b,c,x,y): k_max = min(x,y) l = [] for i in range(k_max): 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
s479108781
Wrong Answer
A, B, C, X, Y = map(int, input().split()) faceAB = (A + B) / 2 if faceAB <= C: print(X * A + Y * B) elif 2 * C <= A and 2 * C <= B: print(2 * C * max(X, Y)) else: if X <= Y: print(2 * C * min(X, Y) + ((Y - X) * B)) else: print(2 * C * min(X, Y) + ((X - Y) * A))
p03371
s493421842
Wrong Answer
A,B,C,X,Y=map(int,input().split(' ')) price=0 if X>Y: N_same=Y flag='A' else: N_same=X flag='B' if A+B >2*C: price+=2*C*N_same else: price+=(A+B)*N_same if flag=='A': if A*(X-Y)>2*C*(X-Y): price+=2*C*(X-Y) else: price+=A*(X-Y) else: if B*(X-Y)>2*C*(X-Y): price+=2*C*(X-Y) else: price+=B*(X-Y) print(price)
p03371
s177200981
Wrong Answer
A, B, C, X, Y = map(int, input().split()) if C * 2 < A and C * 2 < B: print(C * max(X, Y) * 2) elif C * 2 < A + B: if X < Y: print(C * X * 2 + B * (Y - X)) else: print(C * Y * 2 + A * (X - Y)) else: print(A * X + B * Y)
p03371
s467070957
Wrong Answer
a,b,c,x,y = map(int,input().split()) ans = 0 if a + b >= c * 2: ans = c * 2 * min(x,y) if min(a,b) >= c * 2: ans += (max(x,y) - min(x,y)) * (c * 2) else: ans += min((max(x,y) - min(x,y)) * a,(max(x,y) - min(x,y)) * b) else: ans = a * x + b * y print(ans)
p03371
s679986086
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
s915639933
Wrong Answer
a, b, c, x, y = map(int, 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 = 2*c*x + b*(y-x) else: ans = 2*c*y + a*(x-y) else: ans = a*x + b*y print(ans)
p03371
s231702618
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 QQ=X*A+C*2*Y L=X*2*C elif Y>X: Q=C*2*Y+(Y-X)*B QQ=Y*B+X*2*C L=Y*2*C print(min(P,Q,L,QQ))
p03371
s627389225
Wrong Answer
A,B,C,X,Y = map(int,input().split()) mini=float("inf") for a in range(0,X+1): c_num = 2*(X-a) b_num = Y- (X-a) if b_num>=0: P= A*a + B*b_num + C*c_num #print(a,b_num,c_num,P) mini=min(mini,P) print(mini)
p03371
s416483554
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 sum_ab = X*A + Y*B sum_a_b = 2*(X+Y)*C print(min(sum,sum_ab,sum_a_b))
p03371
s166937180
Wrong Answer
A, B, C, X, Y = map(int, input().split()) ans = 1e1000 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
s247625129
Wrong Answer
a,b,c,x,y = map(int,input().split()) z = 0 p = 0 if a + b < c * 2: p = a * x + b * y else: if x > y: x -= y z = y * 2 y = 0 if a > c * 2: z += x * 2 x = 0 else: y -= x z = x * 2 x = 0 if b > c * 2: z += 0 print(x * a + y * b + z * c)
p03371
s668407779
Wrong Answer
A,B,C,X,Y = list(map(int, input().split())) ans1 = 0 ans2 = 0 ans3 = 0 # 通常のケース ans1 = A * X + B * Y # 半分のケース if X >= Y: ans2 = Y * 2 * C + (X - Y) * A if Y * 2 > X: ans3 = X * 2 * C else: ans2 = X * 2 * C + (Y - X) * A if X * 2 > Y: ans3 = Y * 2 * C print(min(ans1,ans2,ans3))
p03371
s347888542
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) else: 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
s921041127
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: print(c*2*mmm + a*(aaa-mmm)) elif x < y: print(c*2*mmm + b*(aaa-mmm)) else: print(a*x + b*y)
p03371
s025815800
Wrong Answer
[a,b,c,x,y] = [int(i) for i in input().split()] ans = a * x + b * y cnt = 1 while x != 0 or y != 0: x = max(x - 1, 0) y = max(y - 1, 0) ans = min(ans,a*x+b*y+c*2*cnt) cnt += 1 print(ans)
p03371
s814691283
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)<=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
s697442450
Wrong Answer
a, b, c, x, y = map(int, input().split()) m = 100000000 for i in range(max(x, y)*2): total = a*(max(0, x-i//2)) + b*(max(0, y-i//2)) + c*i if total < m: m = total print(m)
p03371
s205581494
Wrong Answer
a, b, c, x, y = A = list(map(int, input().split())) l = a * x + b * y m = c * max(x, y) * 2 if x >= y : n = c * y * 2 + a * (x - y) else: n = c * x * 2 + a * (y - x) ans = min(l, m, n) print(ans)
p03371
s739035990
Wrong Answer
a, b, c, x, y = map(int, input().split()) m = 1000000000000 for i in range(max(x, y)*2): total = a*(max(0, x-i//2)) + b*(max(0, y-i//2)) + c*i if total < m: m = total print(m)
p03371
s514668507
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 + min(a, b)*(max(x, y) - s), c*max(x, y)*2) print(ans)
p03371
s334562027
Wrong Answer
a, b, c, x, y = map(int, input().split()) l = [] for i in range(x+y): if i%2!=0: continue if (i//2)>=x: a_p = 0 b_p = b*(y-(i//2)) if (i//2)>=y: a_p = a*(x-(i//2)) b_p = 0 else: a_p = a*(x-(i//2)) b_p = b*(y-(i//2)) price = (c*i)+ a_p + b_p l.append(price) print(min(l))
p03371
s328323551
Wrong Answer
a, b, c, x, y = map(int, input().split()) ans = 1000000000000 for i in range(50000): ans = min(2 * c * i + max(0, x-i) * a + max(0, y-i) * b, ans) print(ans)
p03371
s672523281
Wrong Answer
a, b, c, x, y = map(int, input().split()) ans = float('inf') for i in range(0, 2 * max(x, y)+1, 2): if min((x - (i // 2)), (y - (i // 2))) < 0: break #合計費用 total = a * (x - (i // 2)) + b *(y - (i // 2)) + c * i ans = min(ans, total) print(ans)
p03371
s407361798
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
s046235506
Wrong Answer
a,b,c,x,y=map(int,input().split());print(min(c*2*min(x,y)+abs(x-y)*min(a,b,2*c),a*x+b*y))
p03371
s621054299
Wrong Answer
a, b, c, x, y = map(int, input().split()) if a + b <= 2 * c: ans = a * x + b * y else: z = min(x, y) ans = 2 * c * min(x, y) + a * (x - z) + b * (y - z) print(ans)
p03371
s038664389
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 + max_value): if boundary_value <= min_value: print(boundary_value * max(x, y)) elif (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
s567926898
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 if x < i and y < i: break ans = min(ans, tmp) print(ans)
p03371
s837185874
Wrong Answer
if __name__ == '__main__': A, B, C, X, Y = map(int, input().split()) min_cost = C*2*max(X, Y) for c in range(-1, 2*pow(10, 5)+2, 2): a = X-c//2 b = Y-c//2 if a==100000 and b==100000: print("ans") if a>=0 and b>=0: cost = A*a+b*B+C*c min_cost = min(cost, min_cost) print(min_cost)
p03371
s098297642
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
s075114018
Wrong Answer
A, B, C, X, Y = map(int, input().split()) if X >= Y: print(C*2*Y + A*(X-Y)) else: print(C*2*X + A*(Y-X))
p03371
s591520318
Wrong Answer
A, B, C, X, Y = map(int,input().split()) m = 10^10 for i in range(X): for j in range(Y): k = max(2*X-2*i,2*Y-2*j) m = min(m,A*i+B*j+C*k) print(m)
p03371
s564373067
Wrong Answer
a, b, c, x, y = map(int, input().split()) if a > 2*c and b > 2*c: ans = 2*c*max(x, y) elif a < c and b < c: ans = a*x + b*y else: ans = float('inf') for i in range(min(x, y)+1): p = 2*c*i + (x-i)*a + (y-i)*b #; print(i, p) ans = min(p, ans) print(ans)
p03371
s181881245
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()) price1 = x*a + y*b price2 = max(x, y)*2*c if x<=y: price3 = x*2*c price3 += (y-x)*b else: price3 = y*2*c price3 += (y-x)*a print(min(price1, price2, price3))
p03371
s787756333
Wrong Answer
a, b, c, x, y =map(int, input().split()) ab = 2*c i = 1 cost = 0 while True: cost = i *ab if i <= x or i <= y: break i += 1 cost += a *(max(0, (x-i))) cost += b *(max(0, (y-i))) print(cost)
p03371
s954622660
Wrong Answer
A, B, C, X, Y = map(int, input().split()) if A*X + B*Y > 2*C*max(X, Y): print(2*C*max(X, Y)) elif A + B > 2 * C: 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)) else: print(A*X + B*Y)
p03371
s637474209
Wrong Answer
a, b, c, x, y = map(int, input().split()) cost = 0 for i in range(min(x, y)): if a + b > 2 * c: cost += 2 * c else: cost += a + b for i in range(abs(x - y)): if a < 2 * c: cost += a elif b < 2 * c: cost += b else: cost += 2 * c print(cost)
p03371
s268358044
Wrong Answer
a,b,c,x,y = map(int,input().split()) c *= 2 ans = 10 ** 8 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
s697536382
Wrong Answer
a, b, c, x, y = map(int, input().split()) if (a >= 2 * c and b >= 2 * c): print(int(max(x, y) * 2 * c)) elif (a + b <= 2 * c): print(int(a * x + b * y)) else: print(int(min(x, y) * 2 * c) + int((max(x, y) - min(x, y)) * min(a, b)))
p03371
s035189049
Wrong Answer
a, b, c, x, y = map(int, input().split()) if a+b<=2*c: print(x*a+y*b) else: ans = c*2*min(x, y) if x>=y: ans += (x-y)*a else: ans += (y-x)*b print(ans)
p03371
s391348655
Wrong Answer
A, B, C, X, Y = map(int, input().split()) a = A*X+B*Y if 2*C < A+B: b = max(X,Y)*C*2 else: b = min(X, Y) * C * 2 if X > Y: b += A * (X-Y) elif X < Y: b += B * (Y-X) print(min(a, b))
p03371
s561262945
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 > 0: n = x * 2 * c m = x * a + y * b p += min(n,m) print(p)
p03371
s274715404
Wrong Answer
A, B, C, X, Y = map(int, input().split()) ans = min(A*X+B*Y, C*max(X, Y)*2, C*min(X,Y)*2+(max(X,Y)-min(X,Y))*A) print(ans)
p03371
s585290603
Wrong Answer
a, b, c, x, y = map(int, input().split()) half = min(x, y) * 2 * c + (max(x, y) - min(x, y)) * min(a, b) a_b = a * x + b * y halfOnly = max(x, y) * 2 * c print(min(min(half, a_b), halfOnly))
p03371
s777227041
Wrong Answer
A, B, C, X, Y = map(int, input().split()) ans = 0 for i in range(X): for j in range(Y): for k in range(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
s593648448
Wrong Answer
A,B,C,X,Y = map(int, input().split()) ans = 0 if A >= C: ans += 2*C*X Y -= X if Y > 0: if B >= C: ans += 2*C*Y else: ans += B*Y else: if B >= C: ans += 2*C*Y X -= Y else: ans += B*Y if X > 0: ans += A*X print(ans)
p03371
s822848639
Wrong Answer
a, b, c, x, y = map(int, input().split()) ans = float('inf') for i in range(0, 2 * max(x, y)+1, 2): total = a * (x - (i // 2)) + b *(y - (i // 2)) + c * i ans = min(ans, total) print(ans)
p03371
s346997717
Wrong Answer
A,B,C,X,Y = map(int, input().split()) ans = X*A + Y*B for i in range(max(X,Y)+1): C = 2*C*i + max(0,X-i)*A + max(0,Y-i)*B ans = min(ans, C) print(ans)
p03371
s488975168
Wrong Answer
a,b,c,x,y = map(int,input().split()) first = 2 * max(x,y) + 1 total = 5000 * 10 ** 5 * 2 for i in range(0,x+1): for j in range(0,y+1): k = 2 * max(x-i,y-j) if first > k : first = k target = a * i + b * j + c * k if total > target: total = target else: continue else: break print(total)
p03371
s129414701
Wrong Answer
a,b,c,x,y = map(int,input().split()) A_B = a*x+b*y A_AB = a*x+2*c*y AB_B = 2*c*x+b*y AB = 2*c*max(x,y) ans = min(A_B,A_AB,AB_B,AB) print(ans)
p03371
s320509347
Wrong Answer
A,B,C,X,Y=map(int,input().split()) if A+B<2*C: ans=A*X+B*Y else: if X<=Y: ans=C*2*X if 2*C<=B: ans+=2*C*(Y-X) else: ans+=B*(Y-X) else: ans=C*2*Y if Y<=X: ans+=2*C*(X-Y) else: ans+=B*(Y-X) print(ans)
p03371
s606398666
Wrong Answer
a, b, c, x, y = map(int, input().split()) ans = 0 if a + b > c * 2: ans += (c * 2) * min(x,y) if x > y: ans += a * (x-y) if ans > (c * 2) * max(x,y): ans = (c * 2) * max(x,y) elif y > x: ans += b * (y-x) if ans > (c * 2) * max(x,y): ans = (c * 2) * max(x,y) elif a + b < c * 2: ans += (a * x) + (b * y) print(ans)
p03371
s985361331
Wrong Answer
a, b, c, x, y = map(int, input().split()) ans = x * a + y * b ans = min(ans, abs(x - y) * a + min(x, y) * c * 2) ans = min(ans, max(x, y) * c * 2) print(ans)
p03371
s557351442
Wrong Answer
a, b, c, x, y = (int(each) for each in input().split()) cost = [x*a + y*b] for i in range(max(x, y)*2+1): numofabpizza = i*2 numofapizza = max(0, (x-numofabpizza)) numofbpizza = max(0, (y-numofabpizza)) # print(numofapizza, numofbpizza, numofabpizza) cost.append(numofapizza*a + numofbpizza*b + (2*numofabpizza)*c) # print(cost) print(min(cost))
p03371
s319078188
Wrong Answer
a,b,c,x,y=map(int,input().split()) ans=100000 for i in range(1,100001): tmp=i*2*c+max(0,x-i)*a+max(0,y-i)*b ans=min(ans,tmp) print(ans)
p03371
s826558713
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 < a+ b: 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
s692406425
Wrong Answer
a,b,c,x,y=map(int,input().split()) ans=0 ans+=min(x,y)*min(2*c,a+b) x-=min(x,y) y-=min(x,y) if x!=0: ans+=x*min(a,2*c) else: ans+=y*min(b,2*c) print(ans)
p03371
s151246398
Wrong Answer
a,b,c,x,y = map(int, input().split()) if a>= c*2 and b >= c*2: print(max(x,y)*c*2) elif a>= c*2 and x >=y : print(x*c*2) elif b >= c*2 and y<=x: print(y*c*2) elif a + b < c*2: print(a*x+b*y) elif a+b >= c*2: if x > y: print(y*c*2+(x-y)*a) else: print(x*c*2+(y-x)*b)
p03371
s522412556
Wrong Answer
A, B, C, X, Y = map(int, input().split()) sum = 0 min_num = 10**10 num = [0]*3 if min(A/2, B/2) > C: print(C*Y*2) exit() for c in range(min(X, Y)+1): sum += C*c*2 num[0] = c*2 for a in range(X-c): sum += A num[1] = a for b in range(Y-c): sum += B num[2] = b if min_num > sum: min_num = sum print(sum, num) sum = 0 print(min_num)