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/python3
# -*- coding: utf-8 -*-
x, y = map(int, input().split())
total = 0
if x == 1 and y == 1:
    total += 400000
if x == 1:
    total += 300000
elif x == 2:
    total += 200000
elif x == 3:
    total += 100000
if y == 1:
    total += 300000
elif y == 2:
    total += 200000
elif y == 3:
    total += 100000

print(total)

Submission status: Accepted

Solution code:
def MAP(): return list(map(int,input().split()))
def INT(): return int(input())
def FLOAT(): return float(input())
MOD = 10**9+7

def aa(num):
    if num==1:
        return 300000
    if num==2:
        return 200000
    if num==3:
        return 100000
    else:
        return 0
x,y = MAP()
ans=0
if x==1 and y==1:
    ans += 400000

ans += aa(x) + aa(y)
print(ans)

Submission status: Accepted

Solution code:
import sys

val = sys.stdin.readline()
x, y = val.split()
a = int(x)
b = int(y)
ans=0
if a==1 and b==1 :
    ans+=400000
ans+=max(4-a,0)*100000+max(4-b,0)*100000
print(ans)

Submission status: Accepted

Solution code:
from sys import stdout
printn = lambda x: stdout.write(x)
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
DBG = True # and False
BIG = 999999999
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)


x,y = inm()
sum = 0
sum += (300000 if x==1 else 200000 if x==2 else 100000 if x==3 else 0)
sum += (300000 if y==1 else 200000 if y==2 else 100000 if y==3 else 0)
if x==1 and y==1:
    sum += 400000
print(sum)

Submission status: Accepted

Solution code:
import sys
import heapq
from collections import defaultdict
input = sys.stdin.readline

n = 100000

X, Y = map(int, input().split())
if X == 1 and Y == 1:
    print(1000000)
elif X <= 3 and Y <= 3:
    print((4 - X) * n + (4 - Y) * n)
elif X <= 3:
    print((4 - X) * n)
elif Y <= 3:
    print((4 - Y) * n)
else:
    print(0)

Submission status: Accepted

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

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())
get = 0

if X == 1:
    get += 300000
if X == 2:
    get += 200000
if X == 3:
    get += 100000
if Y == 1:
    get += 300000
if Y == 2:
    get += 200000
if Y == 3:
    get += 100000
if X == 1 and Y == 1:
    get += 400000

print(get)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 20 20:47:47 2019

@author: Owner
"""

import numpy as np
import sys
import collections
import scipy.misc
import math
from operator import itemgetter
import itertools
import copy
import bisect
import heapq

#素因数を並べる
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(int(n))
  return table   
# 桁数を吐く
def digit(i):
    if i > 0:
        return digit(i//10) + [i%10]
    else:
        return []
    
def getNearestValueIndex(list, num):
    """
    概要: リストからある値に最も近い値のインデックスを取得する関数
    @param list: データ配列
    @param num: 対象値
    @return 対象値に最も近い値
    """

    # リスト要素と対象値の差分を計算し最小値のインデックスを取得
    idx = np.abs(np.asarray(list) - num).argmin()
    return idx

def find_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

class UnionFind(object):
    def __init__(self, n=1):
        self.par = [i for i in range(n)]
        self.rank = [0 for _ in range(n)]
        self.size = [1 for _ in range(n)]

    def find(self, x):
        """
        x が属するグループを探索
        """
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def union(self, x, y):
        """
        x と y のグループを結合
        """
        x = self.find(x)
        y = self.find(y)
        if x != y:
            if self.rank[x] < self.rank[y]:
                x, y = y, x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
            self.par[y] = x
            self.size[x] += self.size[y]

    def is_same(self, x, y):
        """
        x と y が同じグループか否か
        """
        return self.find(x) == self.find(y)

    def get_size(self, x):
        """
        x が属するグループの要素数
        """
        x = self.find(x)
        return self.size[x]
    



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

    
def main():
    res = 0
    if X == 3:
        res += 10**5
    elif X == 2:
        res += 2*10**5
    elif X == 1:
        res += 3*10**5
        if Y == 1:
            res += 7*10**5
    if Y == 3:
        res+= 10**5
    elif Y == 2:
        res+= 2*10**5
    elif Y == 1 and X != 1:
        res += 3*10**5
    print(res)
                
                
                
            
            
                

    
if __name__ == '__main__':
    main()



"""
N, X = map(int, input().split())

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

P = [0]*N
Y = [0]*N
for n in range(N):
    P[n], Y[n] = map(int, input().split())


all(nstr.count(c) for c in '753')

# 複数配列を並び替え
ABT = zip(A, B, totAB)
# itemgetterには何番目の配列をキーにしたいか渡します
A, B, totAB = zip(*ABT)

# 2進数のbit判定
(x >> i) & 1

# dp最小化問題
dp = [np.inf]*N
for n in range(N):
    if n == 0:
        dp[n] = 0
    else:
        for k in range(1,K+1):
            if n-k >= 0:
                dp[n] = min(dp[n], dp[n-k] + abs(h[n]-h[n-k]))
            else:
                break
# 累積和
add = 1 # 問題によって決まる
res = 0
sums = [0]*(len(nums)+1)
for i in range(len(nums)):
    sums[i+1] = sums[i] + nums[i]
for i in range(0, len(nums), 2):
    left = i
    right = min(i+add, len(nums))
    tmp = sums[right] - sums[left]
    res = max(tmp, res)

#２分探索
li, ri = bisect.bisect_left(p_ac, l[i]-1), bisect.bisect_right(p_ac, r[i]-1)    

#ソート関数
org_list = [3, 1, 4, 5, 2]
new_list = sorted(org_list)
print(org_list)
print(new_list)
# [3, 1, 4, 5, 2]
# [1, 2, 3, 4, 5]

#Distance Transformation
    for h in range(0,H):
        for w in range(0,W):
            if h == 0 and w == 0:
                pass
            elif h == 0:
                D[H-h-1][W-w-1]= min(D[H-h-1][W-w-1], D[H-h-1][W-w]+1)
            elif w == 0:   
                D[H-h-1][W-w-1]= min(D[H-h-1][W-w-1], D[H-h][W-w-1]+1)
            else:
                D[H-h-1][W-w-1]= min(D[H-h-1][W-w-1], D[H-h][W-w-1]+1, D[H-h-1][W-w]+1, D[H-h][W-w]+2)
            d_max = max(D[H-h-1][W-w-1], d_max)

"""

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:
def main():
    #print = out.append
    ''' Cook your dish here! '''
    x, y = get_list()
    res = 100000 * (4-x) if x<=3 else 0
    res += 100000 * (4-y) if y<=3 else 0
    if x==1 and y==1: res += 400000
    print(res)


''' Coded with love at India by Satyam Kumar '''
import sys
#from collections import defaultdict
import math
#input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
out = []
get_int = lambda: int(input())
get_list = lambda: list(map(int, input().split()))
main()
#[main() for _ in range(int(input()))]
print(*out, sep='\n')

Submission status: Accepted

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

if b == 3:
    c += 1
elif b == 2:
    c += 2
elif b == 1:
    c += 3

if a == b == 1:
    c += 4

print(c*100000)

Submission status: Accepted

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

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

Submission status: Accepted

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

M = 0

if X == 1:
    M += 300000
elif X == 2:
    M += 200000
elif X == 3:
    M += 100000
else:
    pass

if Y == 1:
    M += 300000
elif Y == 2:
    M += 200000
elif Y == 3:
    M += 100000
else:
    pass

if X == 1 and Y == 1:
    M = 1000000

print(M)

Submission status: Accepted

Solution code:
x, y = [int(i) for i in input().split()]
mon = 0
money = [300000, 200000, 100000]
if x -1 < 3:
    mon += money[x-1]
if y -1 < 3:
    mon += money[y-1]
if x == y and x == 1:
    mon += 400000
print(mon)

Submission status: Accepted

Solution code:
x, y=(int(i) for i in input().split())
a=[1,2,3]
sc=0
if x<4:
	sc+=4-x
if y<4:
	sc+=4-y
if x==1 and x==y:
	sc+=4
print(sc*100000)

Submission status: Accepted

Solution code:
n,m=map(int,input().split())
ans=0
if(n==3):
  ans+=1
if(n==2):
  ans+=2
if(n==1):
  ans+=3
if(m==3):
  ans+=1
if(m==2):
  ans+=2
if(m==1):
  ans+=3
  
if(n==1 and m==1):
  ans+=4
  
print(ans*100000)

Submission status: Accepted

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

Submission status: Accepted

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

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

if Y == 1:
  money += 300000
elif Y == 2:
  money += 200000
elif Y == 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:
x,y = (int(i) for i in input().split())
ans = 0
if x == 1:
    ans += 300000
    if y == 1:
        ans += 400000
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)

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
r = 0
if(X == 1):
  r += 300000
elif(X == 2):
  r += 200000
elif(X == 3):
  r += 100000
else:
  pass

if(Y == 1):
  r += 300000
elif(Y == 2):
  r += 200000
elif(Y == 3):
  r += 100000
else:
  pass

if(X == Y == 1):
  r += 400000

print(r)

Submission status: Accepted

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

Submission status: Accepted

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

if(x == 1 and y == 1):
  print(1000000)
  sys.exit()

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
  
print(ans)

Submission status: Accepted

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

ans = 0
m1 = 300000
m2 = 200000
m3 = 100000
for i in [X,Y]:
  if i == 1:
    ans += m1
  elif i == 2:
    ans += m2
  elif i == 3:
    ans += m3

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

print(ans)

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
l = [0,300000,200000,100000]
alpha = 400000
ans = 0
if x == 1 and y == 1:
  ans = l[1]*2 + alpha
  print(ans)
else:
  if 1 <= x <= 3:
    ans += l[x]
  if 1 <= y <= 3:
    ans += l[y]  
  print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import stdin
from itertools import accumulate, dropwhile, takewhile, groupby
import bisect
import copy
import math

d = [int(s) for s in stdin.readline().rstrip().split()]
x = d[0]
y = d[1]
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:
    print(1000000)
else:
    print(res)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print(m)

Submission status: Accepted

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

def money(n):
  ret = 0
  if n == 1:
    ret = 300000
  elif n == 2:
    ret = 200000
  elif n == 3:
    ret = 100000
  
  return ret 

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

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
cnt=0
for i in (x,y):
    if i==3:cnt +=1
    elif i==2:cnt +=2
    elif i==1:cnt +=3

print((cnt+4)*10**5 if x==y==1 else cnt*10**5)

Submission status: Accepted

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

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

result = 0

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

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

Submission status: Accepted

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

ans = 0
p = [0, 300000, 200000, 100000] + [0] * 205
# print(p)

ans = p[x] + p[y]


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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

ans=0

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

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

Submission status: Accepted

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

v = 0

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

def prize(rank):
    if rank == 3:
        return 100000
    elif rank == 2:
        return 200000 
    elif rank == 1:
        return 300000
    else:
        return 0
 
v += prize(X) + prize(Y)
print(v)

Submission status: Accepted

Solution code:
def getmoney(p: int):
    if p == 3:
        return 100000

    elif p == 2:
        return 200000

    elif p == 1:
        return 300000

    else:
        return 0


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

money = getmoney(x) + getmoney(y)

if x == 1 and y == 1:
    print(money + 400000)
else:
    print(money)

Submission status: Accepted

Solution code:
ans = 0
num = list(map(int,input().split()))
for i in range(2):
    if num[i] == 1:
        ans += 300000
    elif num[i] == 2:
        ans += 200000
    elif num[i] == 3:
            ans += 100000
if num[1] == num[0] == 1:
    ans += 400000
print(ans)

Submission status: Accepted

Solution code:
"""
NTC here
"""
from sys import stdin, setrecursionlimit
setrecursionlimit(10**7)

def iin(): return int(stdin.readline())
 
 
def lin(): return list(map(int, stdin.readline().split()))

# range = xrange
# input = raw_input
def main():
    x,y=lin()
    ans=[0,3,2,1]
    sol=0
    if x<4:sol+=ans[x]
    if y<4:sol+=ans[y]
    if x==y==1:sol+=4
    print(sol*100000)
    



    
                











main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#n = input()
#n = int(input())
a,b = map(int,input().split())
#a_L = map(int,input().split())
rank_dic = {1:300000,2:200000,3:100000}

if a == 1 and b ==1:
    print(1000000)
    exit()

ans = 0
try:
    ans += rank_dic[a]
except:
    pass

try:
    ans += rank_dic[b]
except:
    pass

print(ans)

Submission status: Accepted

Solution code:
import sys
MAX_INT = int(10e15)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

x, y = IL()

if x == y == 1:
  print(1000000)
  exit()

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
print(ans)

Submission status: Accepted

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

ans=0
for x in rank:
    if(x==3):
        ans+=100000
    elif(x==2):
        ans+=200000
    elif(x==1):
        ans+=300000

if(ans==600000):
    ans+=400000
print(ans)

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:
# 2019-11-23 21:00:35(JST)
import sys

def main():
    xy = map(int, sys.stdin.readline().split())
    ans = 0
    for i in xy:
        if i == 1:
            ans += 3 * 10 ** 5
        if i == 2:
            ans += 2 * 10 ** 5
        elif i == 3:
            ans += 1 * 10 ** 5
    
    if ans == 6 * 10 ** 5:
        ans = 1 * 10 ** 6
    
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:

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

if x>3 :
    if y>3:
        print(0)
        exit()
    elif y==3:
        print(100000)
        exit()
    elif y==2:
        print(200000)
        exit()
    elif y==1:
        print(300000)
        exit()
elif x==3:
    if y > 3:
        print(100000)
        exit()
    elif y == 3:
        print(200000)
        exit()
    elif y == 2:
        print(300000)
        exit()
    elif y == 1:
        print(400000)
        exit()
elif x==2:
    if y > 3:
        print(200000)
        exit()
    elif y == 3:
        print(300000)
        exit()
    elif y == 2:
        print(400000)
        exit()
    elif y == 1:
        print(500000)
        exit()

elif x==1:
    if y > 3:
        print(300000)
        exit()
    elif y == 3:
        print(400000)
        exit()
    elif y == 2:
        print(500000)
        exit()
    elif y == 1:
        print(1000000)
        exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
list = [int(i) for i in input().split()]

ans = 0
for i in list:
    if i==1:
        ans += 300000
    elif i==2:
        ans += 200000
    elif i==3:
        ans += 100000
if list[0]==1 and list[1]==1:
    ans += 400000
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

class AtCoder:
    def main(self):
        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)


# Run main
if __name__ == '__main__':
    AtCoder().main()

Submission status: Accepted

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

count_sum = 0

def count_money(X,count_sum):
    if X == 1:
        count_sum += 300000
    elif X ==2:
        count_sum += 200000
    elif X ==3:
        count_sum += 100000
    return count_sum

count_sum = count_money(X,count_sum)
count_sum = count_money(Y,count_sum)
if X == 1 and Y ==1:
    count_sum += 400000
print(count_sum)

Submission status: Accepted

Solution code:
x, y = (int(_) for _ in input().split())
mon = {1:3, 2:2, 3:1}
if x == 1 and y == 1:
    print((3 + 3 + 4)*10**5)
elif x < 4 and y < 4:
    print((mon[x] + mon[y])*10**5)
elif x < 4:
    print(mon[x]*10**5)
elif y < 4:
    print(mon[y]*10**5)
else:
    print(0)

Submission status: Accepted

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

print(man)

Submission status: Accepted

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

i = 0
if i == 0:
    r = 0
    if a[0]==1 and a[1] == 1:
        r += 400000
    if a[1] ==1:
        r += 300000
    elif a[1] == 2:
        r += 200000
    elif a[1] == 3:
        r += 100000
    if a[0] ==1:
        r += 300000
    elif a[0] == 2:
        r += 200000
    elif a[0] == 3:
        r += 100000
    print(r)

Submission status: Accepted

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

Submission status: Accepted

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

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

ans = ctr(X) + ctr(Y)
ans += 400000 if X == Y == 1 else 0
print(ans)

Submission status: Accepted

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

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

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

if X == 1 and Y == 1:
    ans = 1000000

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 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 += 400000
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)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# DDCC A
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
x,y = nm()
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:

xy = input().split()
x = int(xy[0])
y = int(xy[1])

result = 0

if x == 1:
    result =result+ 300000
if y == 1:
    result =result+ 300000

if x == 2:
    result =result+ 200000
if y == 2:
    result =result+ 200000

if x == 3:
    result =result+ 100000
if y == 3:
    result =result+ 100000

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

print(result)

Submission status: Accepted

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

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

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

print(sum_price)

Submission status: Accepted

Solution code:
m,n=map(int,input().split())
ans=0
if m==1:
  ans+=300000
if m==2:
  ans+=200000
if m==3:
  ans+=100000
if n==1:
  ans+=300000
  if ans==600000:
    ans=1000000
if n==2:
  ans+=200000
if n==3:
  ans+=100000
print(ans)

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:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline
INF = 2**62-1

def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(X, Y):
    def f(x):
        if x == 3:
            return 100000
        elif x == 2:
            return 200000
        elif x == 1:
            return 300000
        return 0

    b = 400000 if X == 1 and Y == 1 else 0
    return f(X) + f(Y) + b


def main():
    X, Y = read_int_n()
    print(slv(X, Y))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

a = [300000, 200000, 100000]

cnt = 0
if 1 <= x <= 3:
    cnt += a[x - 1]
if 1 <= y <= 3:
    cnt += a[y - 1]
if x == 1 and y == 1:
    cnt += 400000
print(cnt)

Submission status: Accepted

Solution code:
X,Y=map(int,input().split())
Prize1=0
Prize2=0
if X+Y==2:
  Prize2=400000
if X==3:
  Prize1=Prize1+100000
elif X==2:
  Prize1=Prize1+200000
elif X==1:
  Prize1=Prize1+300000
if Y==3:
  Prize1=Prize1+100000
elif Y==2:
  Prize1=Prize1+200000
elif Y==1:
  Prize1=Prize1+300000
print(Prize1+Prize2)

Submission status: Accepted

Solution code:
inpl = lambda: list(map(int,input().split()))
X = inpl()
ans = 0
for i in range(2):
    if X[i] <= 3:
        ans += (4-X[i])*100000
if X[0]==X[1]==1:
    ans += 400000
print(ans)

Submission status: Accepted

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

ans = 0
if x==1 and y==1:
    print(1000000)
    sys.exit()
if x<=3:
    ans += a[x-1]
if y<=3:
    ans += a[y-1]

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def examA():
    AB = LI(); AB.sort()
    ans = 0
    if AB[1]==1:
        ans += 400000
    for i in range(2):
        if AB[i]==1:
            ans +=300000
        elif AB[i]==2:
            ans +=200000
        elif AB[i]==3:
            ans +=100000
    print(ans)


def examB():
    return

def examC():
    return

def examD():
    return

def examE():
    return

import sys,copy,bisect,itertools
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examA()

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
p = [300000, 200000, 100000] + [0] * max(X, Y)
num = p[X - 1] + p[Y - 1]
if X == 1 and Y == 1:
    num += 400000
print(num)

Submission status: Accepted

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

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

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

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

print(total)

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:
from math import *
from collections import *
import sys
sys.setrecursionlimit(10**9)
n,m = map(int,input().split())
a = [0,300000,200000,100000]
ans = 0
if(n <= 3):
	ans = a[n]
if(m <= 3):
	ans += a[m]
if(ans == 600000): ans += 400000
print(ans)

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)