Problem:


Score: 100 points

Problem Statement

We held two competitions: Coding Contest and Robot Maneuver.

In each competition, the contestants taking the 3-rd, 2-nd, and 1-st places receive 100000, 200000, and 300000 yen (the currency of Japan), respectively. Furthermore, a contestant taking the first place in both competitions receives an additional 400000 yen.

DISCO-Kun took the X-th place in Coding Contest and the Y-th place in Robot Maneuver.
Find the total amount of money he earned.

Constraints

1 \leq X \leq 205

1 \leq Y \leq 205

X and Y are integers.

Input

Input is given from Standard Input in the following format:

X Y

Output

Print the amount of money DISCO-Kun earned, as an integer.

Sample Input 1

1 1

Sample Output 1

1000000

In this case, he earned 300000 yen in Coding Contest and another 300000 yen in Robot Maneuver. Furthermore, as he won both competitions, he got an additional 400000 yen.
In total, he made 300000 + 300000 + 400000 = 1000000 yen.

Sample Input 2

3 101

Sample Output 2

100000

In this case, he earned 100000 yen in Coding Contest.

Sample Input 3

4 4

Sample Output 3

0

In this case, unfortunately, he was the highest-ranked contestant without prize money in both competitions.



Sample input:
1 1


Sample output:
1000000

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
ans=0

if x==1:
  ans+=300000
elif x==2:
  ans+=200000
elif x==3:
  ans+=100000

if y==1:
  ans+=300000
elif y==2:
  ans+=200000
elif y==3:
  ans+=100000
    
if x==1 and y==1:
  ans+=400000
  
print(ans)

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
print(max(0, (4-X)*100000) + max(0, (4-Y)*100000) + max(0, (3-X-Y)*400000))

Submission status: Accepted

Solution code:
X,Y=map(int,input().split())
if X==Y==1: print(10**6)
else: print((max(0,4-X)+max(0,4-Y))*10**5)

Submission status: Accepted

Solution code:
X,Y=map(int,input().split())
M=[0]*206
M[0],M[1],M[2]=300000,200000,100000
if X+Y==2:
    print(1000000)
else:
    print(M[X-1]+M[Y-1])

Submission status: Accepted

Solution code:
ans = 0
x, y = map(int,input().split())
ans += 100000*max((4-x),0)
ans += 100000*max((4-y),0)
if x == y == 1:
    ans += 400000
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10

#solve
def solve():
    x, y = LI()
    d = defaultdict(int)
    d[3] = 100000
    d[2] = 200000
    d[1] = 300000
    print(d[1] * 2 + 400000 if x == y == 1 else d[x] + d[y])
    return


#main
if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
print(1000000 if a==b==1 else max((4-a)*100000, 0)+max((4-b)*100000, 0))

Submission status: Accepted

Solution code:
a, b = map(int, input().split())
if a==b==1:
    print(1000000)
else:
    print(max((4-a)*100000, 0)+max((4-b)*100000, 0))

Submission status: Accepted

Solution code:
X, Y = map(int,input().split())

ans = 0

if X == 3:
  ans = ans + 100000
elif X == 2:
  ans = ans + 200000
elif X == 1:
  ans = ans + 300000

if Y == 3:
  ans = ans + 100000
elif Y== 2:
  ans = ans + 200000
elif Y == 1:
  ans = ans + 300000

if (X == 1)and(Y==1):
  ans = ans+ 400000
print(ans)

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
ans = 0
for v in [X, Y]:
    if v == 1:
        ans += 300000
    elif v == 2:
        ans += 200000
    elif v == 3:
        ans += 100000

if X == 1 and Y == 1:
    ans += 400000

print(ans)

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())

def cos(c):
  if c==1:
    return 300000
  elif c==2:
    return 200000
  elif c==3:
    return 100000
  else:
    return 0
  
print(cos(X)+cos(Y)+ ( 400000 if X==1 and Y==1 else 0))

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())

ans = 0
if X == 3 :
    ans += 100000
elif X == 2 :
    ans += 200000
elif X == 1 :
    ans += 300000

if Y == 3 :
    ans += 100000
elif Y == 2 :
    ans += 200000
elif Y == 1 :
    ans += 300000

if max(X,Y) == 1 :
    ans += 400000

print(ans)

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
if x == 1 and y == 1:
    print(100000 * (8 - (x + y)) + 400000)
elif x <= 3 and y <= 3:
    print(100000 * (8 - (x + y)))
elif x <= 3:
    print(100000 * (4 - x))
elif y <= 3:
    print(100000 * (4 - y))
else:
    print(0)

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
ans = 0
if x<=3:
    ans += (4-x)*100000
if y<=3:
    ans += (4-y)*100000
if x==1 and y==1:
    ans += 400000
  
print(ans)

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
s = [400000, 300000, 200000, 100000]

if x == 1 and y == 1:
    print(sum(s))
elif x <= 3 and y <= 3:
    print(s[x] + s[y])
elif x <= 3:
    print(s[x])
elif y <= 3:
    print(s[y])
else:
    print(0)

Submission status: Accepted

Solution code:
x, y = map(int, input().split())

ans = 0
if x + y == 2:
    ans += 400000

ans += ((4-min(4, x)) + (4-min(4, y))) * 100000

print(ans)

Submission status: Accepted

Solution code:
x, y = map(int, input().split())

ans = 0
p = [300000, 200000, 100000]
if 1 <= x <= 3:
    ans += p[x-1]
if 1 <= y <= 3:
    ans += p[y-1]

if x * y == 1:
    ans += 400000

print(ans)

Submission status: Accepted

Solution code:
x = list(map(int,input().split()))
ans = 0
for y in x:
    if y == 1:
        ans+=3
    elif y == 2:
        ans+=2
    elif y == 3:
        ans+=1
if sum(x)==2:
    ans += 4
print(ans * 100000)

Submission status: Accepted

Solution code:
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7


X, Y = MI()

w = [0, 300000, 200000, 100000]
ans = 0
ans += w[X] if X <= 3 else 0
ans += w[Y] if Y <= 3 else 0
if X == 1 and Y == 1:
    ans += 400000
print(ans)

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
a = [300000, 200000, 100000]

if x > 3 and y > 3:
	print(0)
elif x == 1 and y == 1:
	print(1000000)
elif x <= 3 and y <= 3:
	print(a[x-1] + a[y-1])
elif x <= 3 and y > 3:
	print(a[x-1])
elif y <= 3 and x > 3:
	print(a[y-1])

Submission status: Accepted

Solution code:
# coding: utf-8

(x,y) = map(int, input().rstrip().split(" "))

ans = sum([max(0, 400000 - (i * 100000)) for i in [x,y]])
if x == 1 and y == 1:
    ans += 400000
print(ans)

Submission status: Accepted

Solution code:
X,Y=map(int,input().split())
awa=0

if X==3:
  awa += 100000
elif X==2:
  awa += 200000
elif X==1:
  awa += 300000
  
if Y==3:
  awa += 100000
elif Y==2:
  awa += 200000
elif Y==1:
  awa += 300000
  
if X==1 and Y==1:
  awa += 400000
  
print(awa)

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
print(400000*(X==1)*(Y==1) + max(0, 400000-100000*X) + max(0, 400000-100000*Y))

Submission status: Accepted

Solution code:
def main():
    x, y = input().split()
    answer = 0
    prize = {"1": 300000, "2": 200000, "3": 100000}
    if x in prize:
        answer += prize[x]
    if y in prize:
        answer += prize[y]
    if x == y == "1":
        answer += 400000
    print(answer)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# Problem A - DDCC Finals

# input process
X, Y = map(int, input().split())

# initialization
cost_ans = 0

if X==1:
    cost_ans += 300000
elif X==2:
    cost_ans += 200000
elif X==3:
    cost_ans += 100000

if Y==1:
    cost_ans += 300000
elif Y==2:
    cost_ans += 200000
elif Y==3:
    cost_ans += 100000

if X==1 and Y==1:
    cost_ans += 400000

print(cost_ans)

Submission status: Accepted

Solution code:
import sys
#input = sys.stdin.readline
input = sys.stdin.buffer.readline

# mod=10**9+7
# rstrip().decode('utf-8')
# map(int,input().split())
# import numpy as np


def main():
	xy=list(map(int,input().split()))
	ans=0
	li=[0,3,2,1]

	for i in xy:
		if i<=3:
			ans+=li[i]

	if sum(xy)==2:
		ans+=4

	print(ans*100000)







if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
#input = sys.stdin.buffer.readline

# mod=10**9+7
# rstrip().decode('utf-8')
# map(int,input().split())
# import numpy as np


def main():
	xy=list(map(int,input().split()))
	ans=0
	li=[0,3,2,1]

	for i in xy:
		if i<=3:
			ans+=li[i]

	if sum(xy)==2:
		ans+=4

	print(ans*100000)







if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
def award(x):
    return max(0, 4*(10**5) - x*(10**5))

x,y = map(int,input().split())

ans  = award(x)
ans += award(y)

if x == 1 and y == 1:
    ans += 4*(10**5)

print(ans)

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
if (x,y) == (1,1):
    print(1000000)
else:
    print((max(0,4-x)+max(0,4-y))*100000)

Submission status: Accepted

Solution code:
x=list(map(int, input().split()))
t=0
if x[0]<4:
	t=t+((4-x[0])*100000)
if x[1]<4:
	t=t+((4-x[1])*100000)
if x[0]==1 and x[1]==1:
	t=t+400000
print(t)

Submission status: Accepted

Solution code:
# import bisect
# from collections import Counter, defaultdict, deque
# import copy
# from heapq import heappush, heappop, heapify
# from fractions import gcd
# import itertools
# from operator import attrgetter, itemgetter
# import math

import sys

# import numpy as np

ipti = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)

def main():
    x, y = list(map(int,ipti().split()))
    prize = [300000, 200000, 100000, 0]

    if x == y == 1:
        print(1000000)
    else:
        x = 4 if x > 3 else x
        y = 4 if y > 3 else y
        print(prize[x-1]+prize[y-1])

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
xy = list(map(int,input().split()))
prise = 0

for i in xy:
  if i == 1:
    prise += 300000
  elif i == 2:
    prise += 200000
  elif i == 3:
    prise += 100000

if sum(xy) == 2:
  prise += 400000

print(prise)

Submission status: Accepted

Solution code:
def padd(x, ans):
    if x==1:
        ans += 300000
    elif x==2:
        ans += 200000
    elif x==3:
        ans += 100000
    return ans

def main():
    x, y = map(int, input().split())
    ans = 400000 if x==1 and y==1 else 0
    ans = padd(x, ans)
    ans = padd(y, ans)
    print(ans)

main()

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
res = 0
if x == 1:
  res += 300000
elif x == 2:
  res += 200000
elif x == 3:
  res += 100000
if y == 1:
  res += 300000
elif y == 2:
  res += 200000
elif y == 3:
  res += 100000
if x==1 and y==1:
  res += 400000
print(res)

Submission status: Accepted

Solution code:
a,b = map(int, input().split())
sum = 0
if a == 1:
  sum = sum + 300000
elif a == 2:
  sum = sum + 200000
elif a == 3:
  sum = sum + 100000

if b == 1:
  sum = sum + 300000
elif b == 2:
  sum = sum + 200000
elif b == 3:
  sum = sum + 100000

if a == 1 and b == 1:
  sum = sum + 400000

print(sum)

Submission status: Accepted

Solution code:
X,Y=map(int,input().split())
def pr(n,prize):
    c=0
    if n==1:
        c=c+300000
    elif n==2:
        c=c+200000
    elif n==3:
        c=c+100000
    return prize+c
prize=0
prize=pr(X,prize)
prize=pr(Y,prize)
if (X==1)and(Y==1):
    prize=prize+400000
print(prize)

Submission status: Accepted

Solution code:
X,Y = map(int,input().split())

prize = [0]*206
prize[1] = 300000
prize[2] = 200000
prize[3] = 100000

money = 0

if X == 1 and Y == 1:
    money += 400000

print(money+prize[X]+prize[Y])

Submission status: Accepted

Solution code:
import math
from collections import deque
def main():
    t = [int(t)for t in input().split()]
    x,y = t[0],t[1]

    earned = 0

    if x == 1:
        earned += 300000
    elif x == 2:
        earned += 200000
    elif x == 3:
        earned += 100000
    if y == 1:
        earned += 300000
    elif y == 2:
        earned += 200000
    elif y == 3:
        earned += 100000

    if x == y and x == 1:
        earned += 400000

    print(earned)
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
if x==y==1:print(10**6)
else:print((max(0,4-x)+max(0,4-y))*10**5)

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
if 1 <= X <= 3:
  x = 400000 - X*100000
else:
  x = 0
if 1 <= Y <= 3:
  y = 400000 - Y*100000
else:
  y = 0
if X == 1 and Y == 1:
  print(x + y + 400000)
else:
  print(x + y)

Submission status: Accepted

Solution code:
from collections import defaultdict
X, Y = map(int, input().split())
d = defaultdict(int)
d[1] = 300000
d[2] = 200000
d[3] = 100000
ans = d[X]+d[Y]
if X==1 and Y==1:
  ans += 400000
print(ans)

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
ans=0
if x<=3:
    ans+=(4-x)*100000
if y<=3:
    ans+=(4-y)*100000
if ans==600000:
    ans=1000000
print(ans)

Submission status: Accepted

Solution code:
prize = [0, 300000, 200000, 100000]
x, y = map(int, input().split())

ans = 0
if x <= 3:
    ans += prize[x]
if y <= 3:
    ans += prize[y]
if x == y == 1:
    ans += 400000
print(ans)

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
ans = 0
ans += 100000 * max(0, 4-X)
ans += 100000 * max(0, 4-Y)
if X == Y == 1:
    ans += 400000
print(ans)

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
ans = 0

if X <= 3:
    ans += (4 - X) * 10 ** 5

if Y <= 3:
    ans += (4 - Y) * 10 ** 5

if X == Y == 1:
    ans += 4 * 10 ** 5

print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

x, y = [int(x) for x in input().split()]
p = [300000, 200000, 100000]
if x == 1 and y == 1:
    print(1000000)
elif x <= 3 and y <= 3:
    print(p[x - 1] + p[y - 1])
elif x <= 3:
    print(p[x - 1])
elif y <= 3:
    print(p[y - 1])
else:
    print(0)

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
ans = 0
if X <= 3:
    ans += (4 - X) * 100000
if Y <= 3:
    ans += (4 - Y) * 100000
if X == Y == 1:
    ans += 400000
print(ans)

Submission status: Accepted

Solution code:
x, y = map(int, input().split())

ans = 0
for i in [x, y]:
  if i <= 3:
    ans += 4 - i

if x == 1 and y == 1:
  ans += 4

print(ans * 100000)

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
li = [300000, 200000, 100000]
ans = 0
for i in range(3) :
    if i + 1 == X :
        ans += li[i]
        break

for i in range(3) :
    if i + 1 == Y :
        ans += li[i]
        break
if X == 1 and Y == 1:
    ans += 400000
print(ans)

Submission status: Accepted

Solution code:
money = [0, 300000, 200000, 100000]
a,b = map(int, input().split())

st = money[a if a < len(money) else 0] \
 + money[b if b < len(money) else 0]
if a == 1 and b == 1:
  st += 400000
print(st)

Submission status: Accepted

Solution code:
X,Y = map(int,input().split())
ans = 0
shokin = [-1,300000,200000,100000]
if X in (1,2,3):
    ans += shokin[X]
if Y in (1,2,3):
    ans += shokin[Y]
if X == 1 and Y == 1:
    ans += 400000
print(ans)

Submission status: Accepted

Solution code:
X,Y = map(int,input().split())
money = [300000,200000,100000]
ans = 0
if X - 1 < 3:
	ans += money[X - 1]
if Y - 1 < 3:
	ans += money[Y - 1]
if X == 1 and Y == 1:
	ans += 400000
print(ans)

Submission status: Accepted

Solution code:
# import math
# import decimal
# import queue
# import bisect
# import heapq
# import time
# import itertools

mod = int(1e9+7)

class Library():
    @staticmethod
    def Swap(a,b):
        return [b,a]

    @staticmethod
    def myRound(a,dig=0): # 四捨五入
        # dig => 桁数
        # dig = 1 => 10の位
        # dig = -1 => 小数第一位
        p = 10 ** dig
        return (a * p * 2 + 1) // 2 / p

    @staticmethod
    def Roundup(a): # 切り上げ
        if a < 0:
            return int(a)
        else:
            return int(a + 0.9)
    # 整数の切り上げ => (a + b - 1) // b

    @staticmethod
    def Gcd(a,b): #最大公約数
        if (a<b):
            a,b = Library.Swap(a,b)
        if (b==0):
            return a
        else:
            return Library.Gcd(b,a%b)

    @staticmethod
    def Lcm(a,b): #最小公倍数
        return a//Library.Gcd(a,b)*b

    @staticmethod
    def Divisors(a): # 約数列挙
        divisors = []
        for i in range(1,int(a**0.5)+1):
            if a%i==0:
                divisors.append(i)
                if i!=a//i:
                    divisors.append(a//i)
        divisors.sort()
        return divisors

class Prime():
    # コンストラクタ
    # エラストテネスの篩
    def __init__(self,num):
        self.num = num
        self.sieve = [0] * (self.num + 1)
        self.sieve[0] = -1
        self.sieve[1] = -1
        for i in range(2,self.num + 1):
            if not self.sieve[i]:
                self.sieve[i] = i
                for j in range(i * i,self.num + 1,i):
                    if self.sieve[j]:
                        self.sieve[j] = i
    
    # 素数判定
    def isPrime(self,num = None):
        if num is None:
            num = self.num
        if self.sieve[num] == num:
            return True
        else:
            return False
    
    # 素数列挙
    def PrimeNum(self,num = None):
        if num is None:
            num = self.num
        prime = []
        for i in range(2,num):
            if self.sieve[i] == i:
                prime.append(i)
        return prime
    
    # 素因数分解
    def PrimeFact(self,num = None):
        if num is None:
            num = self.num
        fact = []
        while self.sieve[num] != num:
            fact.append(self.sieve[num])
            num //= self.sieve[num]
        fact.append(num)
        return fact

def main():
    x,y = map(int,input().split())
    ans = 0
    if x == 1:
        ans += 300000
    elif x == 2:
        ans += 200000
    elif x == 3:
        ans += 100000
    if y == 1:
        ans += 300000
    elif y == 2:
        ans += 200000
    elif y == 3:
        ans += 100000
    if x ==1 and y == 1:
        ans += 400000
    print(ans)
    return

if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

def main():
    X, Y = map(int, input().split())
    ans = 0
    t = [300000, 200000, 100000]

    if X <= 3:
        ans += t[X-1]
    if Y <= 3:
        ans += t[Y-1]
    if X == 1 and Y == 1:
        ans += 400000
    
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main():
    X, Y = map(int, input().split())

    ans = 0;

    if X == 1:
        ans += 300000
    elif X == 2:
        ans += 200000
    elif X == 3:
        ans += 100000

    if Y == 1:
        ans += 300000
    elif Y == 2:
        ans += 200000
    elif Y == 3:
        ans += 100000

    if X == 1 and Y == 1:
        ans += 400000

    print(ans)
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

X, Y = map(int, input().split())

ans = 0
ans += max(0, (4 - X) * 100000)
ans += max(0, (4 - Y) * 100000)
if X == 1 and Y == 1:
    ans += 400000

print(ans)

Submission status: Accepted

Solution code:
from sys import stdin
X, Y = [int(_) for _ in stdin.readline().rstrip().split()]
ans = max(0, 4-X) + max(0, 4-Y)
if X == Y == 1:
    print((ans + 4) * 100000)
else:
    print(ans*100000)

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
c=0
d=0
if x==1:
    c=300000
elif x==2:
    c=200000
elif x==3:
    c=100000
if y==1:
    d=300000
elif y==2:
    d=200000
elif y==3:
    d=100000
print(c+d if c+d!=600000 else 1000000)

Submission status: Accepted

Solution code:
l = [300000,200000,100000]
a,b = map(int,input().split())
res = 0 
if a in range(1,4):
    res +=l[a-1]
if b in range(1,4):
    res +=l[b-1]
if a == b and a==1:
    res+=400000
print(res)

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
print(1000000 if (x,y)==(1,1) else (max(4-x,0)+max(4-y,0))*100000)

Submission status: Accepted

Solution code:
# A - DDCC Finals
def main():
    X, Y = map(int, input().split())
    prize_table = {1: 300000, 2: 200000, 3: 100000}
    prize = 0
    for rank in (X, Y):
        if rank in prize_table:
            prize += prize_table[rank]
    if X == Y and X == 1:
        prize += 400000
    print(prize)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# A - DDCC Finals
def main():
    X, Y = map(int, input().split())
    prize = 0
    for i in (X, Y):
        if i == 1:
            prize += 300000
        elif i == 2:
            prize += 200000
        elif i == 3:
            prize += 100000
    if X == Y and X == 1:
        prize += 400000
    print(prize)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
if x == 3:
  x_cost = 100000
elif x == 2:
  x_cost = 200000
elif x == 1:
  x_cost = 300000
else:
  x_cost = 0

if y == 3:
  y_cost = 100000
elif y == 2:
  y_cost = 200000
elif y == 1:
  y_cost = 300000
else:
  y_cost = 0

print(x_cost + y_cost + 400000 if x_cost == y_cost == 300000 else x_cost + y_cost)

Submission status: Accepted

Solution code:
x, y = map(int, input().split())

award = 0
if x == 3:
	award += 100000
elif x == 2:
	award += 200000
elif x == 1:
	award += 300000

if y == 3:
	award += 100000
elif y == 2:
	award += 200000
elif y == 1:
	award += 300000

if x == y == 1:
	award += 400000

print(award)

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
def a(n):
    if n == 1:
        return 100000 * 3
    if n == 2:
        return 100000 * 2
    if n == 3:
        return 100000
    return 0
res = a(x) + a(y)
if x == y == 1:
    res += 100000*4
print(res)

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
s=[0,]
d={
  1:300000,
  2:200000,
  3:100000,
}

if x in d:
  s.append(d[x])

if y in d:
  s.append(d[y])

if x==1 and y==1:
  s.append(400000)
  
print(sum(s))

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
z = [0, 300000, 200000, 100000]

if(x == 1 and y == 1):
    print(1000000)
elif(1 <= x <= 3 and 1 <= y <= 3):
    print(z[x]+z[y])
elif(1 <= x <= 3):
    print(z[x])
elif(1 <= y <= 3):
    print(z[y])
else:
    print(0)

Submission status: Accepted

Solution code:
x,y=map(int,input().split())

ans=0

ans+=max(4-x,0)*100000
ans+=max(4-y,0)*100000
if x==1 and y==1:
    ans+=400000
    
print(ans)

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())

P = [300000, 200000, 100000, 0]

if X == 1 and Y == 1:
    print(1000000)
else:
    print(P[min(3, X - 1)] + P[min(3, Y - 1)])

Submission status: Accepted

Solution code:
x,y = map(str,input().split())
a = {'1':300000,'2':200000,'3':100000}
if int(x) > 3 or int(y) > 3:
    if int(x) <= 3:
        print(a[x])
    elif int(y) <= 3:
        print(a[y])
    else:
        print(0)
else:
    if x == y == '1':
        print(1000000)
    else:
        print(a[x]+a[y])

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
ans = 0
if x<= 3:
    ans += 400000-100000*x
if y <= 3:
    ans += 400000-100000*y
if x== 1 and y == 1:
    ans += 400000
print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
#S = list(str(input()))
#N = int(input())
X, Y = map(int, input().split())

sum = 0
if X == 1 :
  sum += 300000
elif X == 2 :
  sum += 200000
elif X == 3 :
  sum += 100000

if Y == 1 :
  sum += 300000
elif Y == 2 :
  sum += 200000
elif Y == 3 :
  sum += 100000

if X == 1 and Y == 1 :
  sum += 400000
  
print (sum)

Submission status: Accepted

Solution code:
x, y = map(int, input().split())
wins = [300000, 200000, 100000]
ans = 0
if x <= 3:
    ans += wins[x - 1]
if y <= 3:
    ans += wins[y - 1]

if x == 1 and y == 1:
    ans += 400000

print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
INF = float("inf")


def solve(X: int, Y: int):
    ans = 0
    for x in [X, Y]:
        if x == 3:
            ans += 100000
        elif x == 2:
            ans += 200000
        elif x == 1:
            ans += 300000
    if X == Y == 1:
        ans += 400000
    print(ans)
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  # type: int
    Y = int(next(tokens))  # type: int
    solve(X, Y)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict, deque
import bisect
from heapq import *
from math import factorial, ceil
sys.setrecursionlimit(200000)
input = sys.stdin.readline

# N, M, = map(int, input().split())
# N = int(input())
# L = [int(v) for v in input().split()]
# L = [[int(v) for v in input().split()] for _ in range(N)]
# L = [int(input()) for _ in range(N)]
# L = [list(input().strip())  for _ in range(N)]
# S = input().strip()

N, M, = map(int, input().split())

ans = 0
if N == 1 and M == 1:
    ans += 400000

if N <= 3:
    ans += (4 - N) * 100000

if M <= 3:
    ans += (4 - M) * 100000

print(ans)

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    x,y = LI()
    r = 0
    if x <= 3:
        r += 4 - x
    if y <= 3:
        r += 4 - y
    if x == 1 and y == 1:
        r += 4

    return r * 10**5


print(main())

Submission status: Accepted

Solution code:
X, Y = tuple(map(int, input().split()))

# Calculate prize for "Coding Contest"
prize_code = 0;
if X == 1:
    prize_code = 300000;
elif X == 2:
    prize_code = 200000;
elif X == 3:
    prize_code = 100000;

# Calculate prize for "Robot Maneuver"
prize_device = 0;
if Y == 1:
    prize_device = 300000;
elif Y == 2:
    prize_device = 200000;
elif Y == 3:
    prize_device = 100000;

# Calculate prize for "two victories"
prize_both = 0
if X == 1 and Y == 1:
    prize_both = 400000

# Calculate the sum and print the answer
prize_total = prize_code + prize_device + prize_both
print(prize_total)

Submission status: Accepted

Solution code:
x,y = map(int, input().split())

answer = 0

if x == 1:
  answer += 300000
elif x == 2:
  answer += 200000
elif x == 3:
  answer += 100000

if y == 1:
  answer += 300000
elif y == 2:
  answer += 200000
elif y == 3:
  answer += 100000

if x == 1 and y == 1:
  answer += 400000

print(answer)

Submission status: Accepted

Solution code:
X, Y = map(int, input().split(" "))
print(100000 * max(4 - X, 0) + 100000 * max(4 - Y, 0) + (400000 if X == 1 and Y == 1 else 0))

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
def money(a):
    if a==1:
        return 300000
    elif a==2:
        return 200000
    elif a==3:
        return 100000
    else:
        return 0

ans=money(x)+money(y)
if ans==600000:
    print(1000000)
else:
    print(ans)

Submission status: Accepted

Solution code:
x = list(map(int, input().split()))
ans = 0
for i in x:
    if i == 1:
        ans += 300000
    elif i == 2:
        ans += 200000
    elif i == 3:
        ans += 100000

if ans == 600000:
    print(1000000)
else:
    print(ans)

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
ans = 0
ans += max(0, 4 - X)
ans += max(0, 4 - Y)
if(X == 1 and Y == 1):
	ans += 4
ans *= 100000
print(ans)

Submission status: Accepted

Solution code:
import sys
if sys.platform =='ios':
	sys.stdin=open('input.txt')
	
x,y = map(int,input().split())

if x==1 and y==1:
	print(1000000)
	exit()
	
ans = 0

if x==1:
	ans = ans + 300000
elif x==2:
	ans = ans + 200000
elif x==3:
	ans = ans + 100000

if y==1:
	ans = ans + 300000
elif y==2:
	ans = ans + 200000
elif y==3:
	ans = ans + 100000

print(ans)

Submission status: Accepted

Solution code:
X, Y = list(map(int, input().split()))

ans = 0
if X <= 3:
  ans += (4-X) * 100000
if Y <= 3:
  ans += (4-Y) * 100000
if X * Y == 1:
  ans += 400000
  
print(ans)

Submission status: Accepted

Solution code:
x, y = map(int,input().split())
money = 0
def yy(money):
    if y == 1:
        money += 300000
    elif y ==2:
        money += 200000
    elif y==3:
        money += 100000
    else:
        money +=0
    print(money)

if x==1 and y==1:
    print(300000*2+400000)
else:
    if x == 1:
        money += 300000
        yy(money)
    elif x ==2:
        money += 200000
        yy(money)
    elif x ==3:
        money += 100000
        yy(money)
    else:
        money +=0
        yy(money)

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
def point(a):
  if a == 1:
    return 300000
  elif a == 2:
    return 200000
  elif a == 3:
    return 100000
  else:
    return 0
  
c = point(x)
b = point(y)

if x == 1 and y == 1:
  print(1000000)
else:
  print(c+b)

Submission status: Accepted

Solution code:
x, y = map(int,input().split())
ans = 0
if x == 1:
  ans += 300000
elif x == 2:
  ans += 200000
elif x == 3:
  ans += 100000

if y == 1:
  ans += 300000
elif y == 2:
  ans += 200000
elif y == 3:
  ans += 100000
if x == 1 and y == 1:
  ans += 400000
  
print(ans)

Submission status: Accepted

Solution code:
XY= list(map(int,input().split()))
X=XY[0]
Y=XY[1]

if X==1:
    syokinx=300000
elif X==2:
    syokinx=200000
elif X==3:
    syokinx=100000
else:
    syokinx=0

if Y==1:
    syokiny=300000
elif Y==2:
    syokiny=200000
elif Y==3:
    syokiny=100000
else:
    syokiny=0

if X==1 and Y==1:
    syokinz=400000
else:
    syokinz=0

print(syokinx+syokiny+syokinz)

Submission status: Accepted

Solution code:
#https://atcoder.jp/contests/ddcc2020-qual/tasks/ddcc2020_qual_a
XY=input().split()
X=int(XY[0])
Y=int(XY[1])
award=0
if X==1 and Y==1:
    award+=400000
for num in [X,Y]:
    if num==3:
        award+=100000
    if num==2:
        award+=200000
    if num==1:
        award+=300000
print(award)

Submission status: Accepted

Solution code:
import numpy as np


def add(x):
    if x == 1:
        return 300000
    elif x == 2:
        return 200000
    elif x == 3:
        return 100000
    else:
        return 0


n, m = map(int, input().split())

ans = 0
ans += add(n) + add(m)
if n == 1 and m == 1:
    ans += 400000
print(ans)