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:
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007
flush = sys.stdin.flush()

def solve():
    x,y = LI()
    ans = 0
    f = [300000,200000,100000,0]
    if x == 1 and y == 1:
        print(1000000)
    else:
        ans = f[min(3,x-1)]+f[min(3,y-1)]
        print(ans)
    return

#Solve
if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = 0

if x < 4:
  ans += (4-x)* 100000
  
if y < 4:
  ans += (4-y)* 100000
  
if x + y == 2:
  ans += 400000
  
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x, y = map(int, input().split(" "))
 
total = 0
 
rewards = {1: 300000, 2: 200000, 3: 100000}

x1 = rewards[x] if (x <= 3) else 0
y1 = rewards[y] if (y <= 3) else 0
 
if (x == 1 and y ==  1):
  total += 400000
if (x1 != None):
  total += x1
if (y1 != None):
  total += y1
 
print(total)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter

a = map(int, input().split())
c = Counter(a)
d = {1: 300000, 2: 200000, 3: 100000}

ret = sum(c[rank] * d[rank] for rank in range(1, 3 + 1))
if c[1] == 2:
    ret += 400000
print(ret)

Submission status: Accepted

Solution code:
X,Y=map(int,input().split());print((max((4-X),0)+max((4-Y),0)+4*(X*Y<2))*10**5)

Submission status: Accepted

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

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 x == 1 and y == 1:
         ans += 400000
print(ans)

Submission status: Accepted

Solution code:
a, b = input().split(" ")
x = int(a)
y = int(b)

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

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

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

print (amt)

Submission status: Accepted

Solution code:
x,y=[int(s) for s in input().split()]
ans=0
if x<4:
  ans+=100000
if x<3:
  ans+=100000
if x<2:
  ans+=100000
if y<4:
  ans+=100000
if y<3:
  ans+=100000
if y<2:
  ans+=100000
if x*y==1:
  ans+=400000
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = [int(i) for i in input().split()]
ans = 0
f = [False,False]
for i in range(2):
    if x[i] == 1:
        ans += 300000
        f[i] = True
    elif x[i] == 2:
        ans += 200000
    elif x[i] == 3:
        ans += 100000

if f[0] and f[1]:
    ans += 400000

print(ans)

Submission status: Accepted

Solution code:
X,Y=map(int,input().split());print((max((4-X),0)+max((4-Y),0)+(0,4)[X*Y<2])*10**5)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
#ディスカバリーチャンネルコードコンテスト2020 A

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))


x,y = LI()
if x == 3 and y == 3:
    print(200000)
elif x == 2 and y == 2:
    print(400000)
elif (x == 1 and y == 2) or (x == 2 and y == 1):
    print(500000)
elif (x == 3 and y == 2) or (x == 2 and y == 3):
    print(300000)
elif (x == 3 and y == 1) or (x == 1 and y == 3):
    print(400000)
elif x == 1 and y == 1:
    print(600000+400000)
elif x == 3 or y == 3:
    print(100000)
elif x == 2 or y == 2:
    print(200000)
elif x == 1 or y == 1:
    print(300000)
else:
    print(0)

Submission status: Accepted

Solution code:
X,Y=map(int,input().split());print((max((4-X),0)+max((4-Y),0)+((0,4)[X*Y<2]))*10**5)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
x, y = map(int, input().split())
ans = (x == y == 1) * 400000
ans += 100000 * max(0, 4 - x)
ans += 100000 * max(0, 4 - y)
print(ans)

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
ans = 0
if x == 1 and y == 1:
    ans += 400000

def q(x,ans):
    if x == 1:
        ans += 300000
    elif x == 2:
        ans += 200000
    elif x == 3:
        ans += 100000
    return ans
ans = q(x,ans)
ans = q(y,ans)
print(ans)

Submission status: Accepted

Solution code:
X,Y = [int(x) for x in input().split()]
li = [300000, 200000, 100000]
if(X==Y==1):
    print(1000000)
else:
    ans = 0
    if(X<=3):
        ans += li[X-1]
    if(Y<=3):
        ans += li[Y-1]
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def fun(x):
    if x==1:
        return 300000
    elif x==2:
        return 200000
    elif x==3:
        return 100000
    else:
        return 0
s=input()
s=s.split()
a=eval(s[0])
b=eval(s[1])
su=0
if a==b==1:
    su+=400000
su+=fun(a)
su+=fun(b)
print(su)

Submission status: Accepted

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


#合計を求める
sum = 0

if(X == 1):
  #300,000
  sum += 300000
  if(Y == 1):
    sum += 300000
    sum += 400000
  elif(Y == 2):
    sum += 200000
  elif(Y == 3):
    sum += 100000
  else:
    pass
elif( X == 2):
  #200,000
  sum += 200000
  if(Y == 1):
    sum += 300000
    #sum += 400000
  elif(Y == 2):
    sum += 200000
  elif(Y == 3):
    sum += 100000
  else:
    pass
elif( X == 3):
  #100,000
  sum += 100000
  if(Y == 1):
    sum += 300000
    #sum += 400000
  elif(Y == 2):
    sum += 200000
  elif(Y == 3):
    sum += 100000
  else:
    pass
else:
  if(Y == 1):
    sum += 300000
    #sum += 400000
  elif(Y == 2):
    sum += 200000
  elif(Y == 3):
    sum += 100000
  else:
    pass

print(sum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X,Y = map(int,raw_input().split())
if((X >= 1)and(X <= 205))and((Y >= 1)and(Y <= 205)):
    if(X == 1)and(Y == 1): print("1000000")
    elif((X == 1)and(Y == 2))or((Y == 1)and(X == 2)): print("500000")
    elif((X == 1)and(Y == 3))or((Y == 1)and(X == 3))or((X == 2)and(Y == 2)): print("400000")
    elif((X == 2)and(Y == 3))or((X == 1)and(Y > 3))or((Y == 1)and(X > 3))or((X == 3)and(Y == 2)): print("300000")
    elif((X == 3)and(Y == 3))or((X == 2)and(Y > 3))or((Y == 2)and(X > 3)): print("200000")
    elif((X == 3)and(Y > 3))or((Y == 3)and(X > 3)): print("100000")
    elif(X > 3)and(Y > 3): print("0")

Submission status: Accepted

Solution code:
rank3 = 100000
rank2 = 200000
rank1 = 300000

# prize = {
#     "1": 300000,
#     "2": 200000,
#     "3": 100000
# }

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

reward = 0

if x == 1:
    reward += rank1
elif x == 2:
    reward += rank2
elif x == 3:
    reward += rank3

if y == 1:
    reward += rank1
elif y == 2:
    reward += rank2
elif y == 3:
    reward += rank3

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

print(reward)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
a,b=a-1,b-1
l=[300000,200000,100000]
if a<3 and b<3:
  if a==0 and b==0:
    print(400000+l[a]+l[b])
  else:
    print(l[a]+l[b])
else:
  if a<3:
    print(l[a])
  elif b<3:
    print(l[b])
  else:
    print(0)
  # print("HELLO")

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
def print_ans(A, B):
    """Test Case
    >>> print_ans(1, 1)
    1000000
    >>> print_ans(3, 101)
    100000
    >>> print_ans(4, 4)
    0
    """
    ans = 0
    if A == 1:
        ans += 300000
    elif A == 2:
        ans += 200000
    elif A == 3:
        ans += 100000

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

    if A == 1 and B == 1:
        ans += 400000
    print(ans)

if __name__ == '__main__':
    A, B = map(int, input().rstrip().split())
    print_ans(A, B)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b = input().split(" ")
x = int(a)
y = int(b)
amt = 0
if x == 3:
    amt += 100000
elif x == 2:
    amt += 200000
elif x == 1: 
    amt += 300000

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

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

print (amt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b=map(int, input().split())
s=0
t=400000-100000*a
if t>0:
  s=t
u=400000-100000*b
if u>0:
  s+=u
if a+b==2:
  s+=400000
print(s)

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
m=10**5
print(max(0,m*(4-x))+max(0,m*(4-y))+4*m*(x<2>y))

Submission status: Accepted

Solution code:
X, Y = map(int, input().split(' '))
if X == 1 and Y == 1:
    print(1000000)
elif X == 1:
    if Y == 2:
        print(500000)
    elif Y == 3:
        print(400000)
    else:
        print(300000)
elif X == 2:
    if Y == 1:
        print(500000)
    elif Y == 2:
        print(400000)
    elif Y == 3:
        print(300000)
    else:
        print(200000)
elif X == 3:
    if Y == 1:
        print(400000)
    elif Y == 2:
        print(300000)
    elif Y == 3:
        print(200000)
    else:
        print(100000)
else:
    if Y == 1:
        print(300000)
    elif Y == 2:
        print(200000)
    elif Y == 3:
        print(100000)
    else:
        print(0)

Submission status: Accepted

Solution code:

a,b = map(int,input().split())

res = 0

if a == 1 :
    res += 300000
elif a == 2 :
    res += 200000
elif a == 3 :
    res += 100000

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

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

print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x, y = input().split()
price = 0
try:
    if 1 <= int(x) <= 205 and 1 <= int(y) <= 205:
        if int(x) == 1 and int(y) == 1:
            price += 400000
        if int(x) == 1:
            price += 300000
        elif int(x) == 2:
            price += 200000
        elif int(x) == 3:
            price += 100000
        if int(y) == 1:
            price += 300000
        elif int(y) == 2:
            price += 200000
        elif int(y) == 3:
            price += 100000

    print(price)
except:
    print(price)

Submission status: Accepted

Solution code:
n = input().split(' ')
third = 100000
second = 200000
first = 300000
sum = 0
for i in n:
    if int(i) == 3:
        sum = sum + third
    elif  int(i) == 2:
        sum = sum + second
    elif  int(i) == 1:
        sum = sum + first

if int(n[0]) == 1 and int(n[1]) == 1:
    sum = sum + 400000

print(sum)

Submission status: Accepted

Solution code:
X, Y = [int(x) for x in input().split()]
prize = 0

prize_list = {1:300000, 2:200000, 3:100000}

if X > 0 and X < 4:
    prize += prize_list[X]

if Y > 0 and Y < 4:
    prize += prize_list[Y]

if prize == 600000:
    prize = 1000000

print(prize)

Submission status: Accepted

Solution code:
import math

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

#a = list(map(int, input().split()))


a = list(map(int, input().split()))
ans = 0
for i in range(2):
    ans+=max(4-a[i],0)*100000
if(sum(a)==2):
    ans+=400000
    
print(ans)

Submission status: Accepted

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

ttl=0
if(x>3 and y>3):
  ttl=0
else:
  for i in range(1,4):
    if i==x:
        ttl=(4-i)*100000
        break
  for j in range(1,4):
    if j==y:
        ttl=ttl+(4-j)*100000
        break
  if ttl==600000:
    ttl=ttl+400000
print(ttl)

Submission status: Accepted

Solution code:
input_number = input()
input_list = input_number.split()
coding_contest_rank = int(input_list[0])
robot_maneuver_rank = int(input_list[1])

if coding_contest_rank == 1:
    coding_contest_money = 300000
if robot_maneuver_rank == 1:
    robot_maneuver_money = 300000
if coding_contest_rank == 2:
    coding_contest_money = 200000
if robot_maneuver_rank == 2:
    robot_maneuver_money = 200000
if coding_contest_rank == 3:
    coding_contest_money = 100000
if robot_maneuver_rank == 3:
    robot_maneuver_money = 100000
if coding_contest_rank > 3:
    coding_contest_money = 0
if robot_maneuver_rank > 3:
    robot_maneuver_money = 0
if coding_contest_rank == 1 and robot_maneuver_rank == 1:
    total_money = coding_contest_money + robot_maneuver_money + 400000
    print(total_money)    
else:
    print(coding_contest_money + robot_maneuver_money)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
 
lines = stdin.readlines()
X,Y = map(int, lines[0].split())

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

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

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

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
mod2 = 998244353
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

x,y = inpl()
res = 0
if x == 3 :
    res += 100000
if x == 2 :
    res += 200000
if x == 1 :
    res += 300000
if y == 3 :
    res += 100000
if y == 2 :
    res += 200000
if y == 1 :
    res += 300000
if x == 1 and y == 1:
    res += 400000
print(res)

Submission status: Accepted

Solution code:
A, B = map(int, input().split())

list = [500000,300000,200000,100000,0]

if(A>3):
    A = 4
if(B>3):
    B = 4
elif(A==1 and B==1):
    A=B=0
money = list[A]+list[B]
print(money)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    x,y=list(map(int,input().split(" ")))
    ans=0
    if x==1 and y==1:
        print(300000+300000+400000)
    else:
        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
        print(ans)

if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
def main():
    X, Y = [int(x) for x in input().split()]
    print(a(X)+a(Y)+ (400000 if X==Y==1 else 0))

def a(i):
    if i == 1:
        return 300000
    elif i == 2:
        return 200000
    elif i == 3:
        return 100000
    else:
        return 0
main()

Submission status: Accepted

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

Submission status: Accepted

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

totalAmount = 0
first = 300000
second = 200000
third = 100000
extraPrice = 400000


if X == 1:
    totalAmount = first
    pass
elif X == 2:
    totalAmount = second
    pass
elif X == 3:
    totalAmount = third
    pass
elif X < 1 or X > 3:
    totalAmount = 0
    pass

if Y == 1:
    totalAmount = totalAmount + first
    pass
elif Y == 2:
    totalAmount = totalAmount + second
    pass
elif Y == 3:
    totalAmount = totalAmount + third
    pass
elif Y < 1 or Y > 3:
    totalAmount = totalAmount + 0
    pass

if X == 1 and Y == 1:
    totalAmount = totalAmount + extraPrice

print(totalAmount)

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
t = [300000,200000,100000]+[0 for i in range(300)]
if x==y==1:
    print(1000000)
else:
    print(t[x-1]+t[y-1])

Submission status: Accepted

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

for i in range(len(a)):
  if a[i] == 1:
    a[i] = 300000
  elif a[i] == 2:
    a[i] = 200000
  elif a[i] == 3:
    a[i] = 100000
  else:
    a[i] = 0

    
if a[0] == 300000 and a[1] == 300000:
  p = 1000000
else:
  p = a[0] + a[1]
      
print(p)

Submission status: Accepted

Solution code:
if __name__ == '__main__':
  x, y = map(int, input().split())
  priceX = priceY = 0
  if(x >= 1 and x <= 205 and y >= 1 and y<= 205):
    if(x == 1):
      priceX = 300000
    elif(x == 2):
      priceX = 200000
    elif(x == 3):
      priceX = 100000
    else:
  	  priceX = 0

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

Submission status: Accepted

Solution code:
a,b=map(int,input().split())
s=0
g=0
if a==1:
  s=300000
elif a==2:
  s=200000
elif a==3:
  s=100000
else:
  s=0
if b==1:
  g=300000
elif b==2:
  g=200000
elif b==3:
  g=100000
else:
  g=0
if a==1 and b==1:
  print(g+s+400000)
else:
  print(s+g)

Submission status: Accepted

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

sumPriz = 0

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

if Y == 1:
    sumPriz += 300000
    if X == 1:
        sumPriz += 400000
elif Y == 2:
    sumPriz += 200000
elif Y == 3:
    sumPriz += 100000

print(sumPriz)

Submission status: Accepted

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

ax = 0
ay = 0

if x<4:
	ax=s[x]

if y<4:
	ay=s[y]

ans = ax+ay
if x==1 and y==1:
	ans += s[0]

print(ans)

Submission status: Accepted

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

p = []

if X == 1:
  p.append(300000)
elif X == 2:
  p.append(200000)
elif X == 3:
  p.append(100000)

if Y == 1:
  p.append(300000)
elif Y == 2:
  p.append(200000)
elif Y == 3:
  p.append(100000)


if X == 1 and Y == 1:
  p.append(400000)

ans = sum(p)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

if X == 1 and Y == 1:
    print(1000000)

elif (X == 1 and Y == 2) or (X == 2 and Y == 1):
    print(500000)

elif (X == 1 and Y == 3) or (X == 3 and Y == 1) or (X == 2 and Y == 2):
    print(400000)

elif (X == 1 and Y >= 4) or (X >= 4 and Y == 1) or (X == 2 and Y == 3) or (X == 3 and Y == 2):
    print(300000)

elif (X == 2 and Y >= 4) or (X >= 4 and Y == 2) or (X == 3 and Y == 3):
    print(200000)

elif (X == 3 and Y >= 4) or (X >= 4 and Y == 3):
    print(100000)

else:
    print(0)

Submission status: Accepted

Solution code:
a = input().split()
#print(a)
x = a[0]
y = a[1]
def h(x,y):
    d = dict()
    d = {'1':300000,'2':200000,'3':100000}
    if x=='1' and y =='1':
        print(1000000)
        return
    res = 0
    res = d.get(x,0) + d.get(y,0)
    print(int(res))
h(x,y)

Submission status: Accepted

Solution code:
# 2019/11/23
# DISCO presents ディスカバリーチャンネル コードコンテスト2020 予選 - A

# Input
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

# Output
print(ans)

Submission status: Accepted

Solution code:
code,implement = input().split(" ")

def prize_dict(rank):
    if rank == "1":
        prize = 300000
    elif rank == "2":
        prize = 200000
    elif rank == "3":
        prize = 100000
    else:
        prize = 0
    return prize


if code == "1" and implement == "1":
    prize = 1000000
else:
    prize = prize_dict(code)+prize_dict(implement)
print(prize)

Submission status: Accepted

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

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

if Y==1:
    shokin +=300000
    if X==1:
        shokin += 400000
elif Y==2:
    shokin +=200000
elif Y==3:
    shokin +=100000

print(shokin)

Submission status: Accepted

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

Submission status: Accepted

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

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 == Y == 1:
    ans += 400000
print(ans)

Submission status: Accepted

Solution code:
a,b = map(int,input().split())
price = 0
if a == 1 and b ==1:
  price +=400000
if a == 1:
  price +=300000
elif a ==2:
  price +=200000
elif a ==3:
  price +=100000
else:
  pass
if b == 1:
  price +=300000
elif b ==2:
  price +=200000
elif b ==3:
  price +=100000
else:
  pass
print(price)

Submission status: Accepted

Solution code:
x, y = [int(item) for item in 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:
money = 0
x, y = map(int, input().split())

def func(grade):
    global money
    if grade == 1:
        money += 300000
    elif grade == 2:
        money += 200000
    elif grade == 3:
        money += 100000

func(x)
func(y)

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

print(money)

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())
ans = 0
if X == 1:
    ans += 300000
if Y == 1:
    ans += 300000
if X == 2:
    ans += 200000
if Y == 2:
    ans += 200000
if X == 3:
    ans += 100000
if Y == 3:
    ans += 100000
if X == 1 and Y == 1:
    ans += 400000
print(ans)

Submission status: Accepted

Solution code:
raw_input = input()
input_list = raw_input.split()   
 
coding_contest_rank = int(input_list[0])
robot_rank = int(input_list[1])


if coding_contest_rank == 3:
    coding_money = 100000
if robot_rank == 3:
    robot_money = 100000
if coding_contest_rank == 2:
    coding_money = 200000
if robot_rank == 2:    
    robot_money = 200000
if coding_contest_rank == 1:
    coding_money = 300000
if robot_rank == 1:    
    robot_money = 300000
if coding_contest_rank > 3:
    coding_money = 0
if robot_rank > 3:
    robot_money = 0

if coding_contest_rank == 1 and robot_rank == 1: 
    print(coding_money + robot_money + 400000)
else:
    print(coding_money + robot_money)

Submission status: Accepted

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

d = {1:300000, 2:200000, 3:100000}

if x == 1 and y == 1:
	print(10**6)
	exit()

su = 0
if x in d:
	su += d[x]
if y in d:
	su += d[y]
print(su)

Submission status: Accepted

Solution code:
X,Y = map(int,input().split())
ans = 0
if X == 3:
    ans += 100000
if X == 2:
    ans += 200000
if X == 1:
    ans += 300000
if Y == 3:
    ans += 100000
if Y == 2:
    ans += 200000
if Y == 1:
    ans += 300000
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==1 and y==1:
  print(1000000)
else:
  if x==3:
    ans+=100000
  if y==3:
    ans+=100000
  if x==2:
    ans+=200000
  if y==2:
    ans+=200000
  if x==1:
    ans+=300000
  if y==1:
    ans+=300000
  print(ans)

Submission status: Accepted

Solution code:
a,b= map(int,input().split())
res=0

if a==1:
    res+=300000
if b==1:
    res+=300000
if a==2: 
    res+=200000
if b==2: 
    res+=200000
if a==3: 
    res+=100000
if b==3: 
    res+=100000    
if a==1 and b==1:
    res=1000000
    
print(res)

Submission status: Accepted

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

ans = 0
if x == 1 and y == 1:
    ans += 4
if x == 1:
    ans += 3
if x == 2:
    ans += 2
if x == 3:
    ans += 1
if y == 1:
    ans += 3    
if y == 2:
    ans += 2
if y == 3:
    ans += 1

print(ans * 100000)

Submission status: Accepted

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