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:
def resolve():
    X, Y = input().split()
    ans = 0
    if X == "3":
        ans += 100000
    elif X == "2":
        ans += 200000
    elif X == "1":
        ans += 300000
    else:
        ans += 0
    if Y == "3":
        ans += 100000
    elif Y == "2":
        ans += 200000
    elif Y == "1":
        ans += 300000
    else:
        ans += 0
    if X == "1" and Y == "1":
        ans += 400000
    else:
        ans += 0
    print(ans)
resolve()

Submission status: Accepted

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

ans=0
prize=[0, 300000, 200000, 100000, 0]
if x ==1 and y == 1:
    print(1000000)
else:
    print(prize[min(x,4)] + prize[min(y,4)])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X,Y=map(int, input().split())
l=[0,300000,200000,100000]
for i in range(202):
    l.append(0)
sc=l[X]+l[Y]
print(sc+400000 if X==Y==1 else sc)

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2, log
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
from decimal import Decimal
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7
from decimal import *

X, Y = MAP()

money = [0]*206
money[1] = 3*10**5
money[2] = 2*10**5
money[3] = 10**5

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

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:
X,Y=map(int,input().split())
S=[0,3e5,2e5,1e5]+[0]*205
if X==Y==1:
    print(round(1e6))
else:
    print(round(S[X]+S[Y]))

Submission status: Accepted

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

if x == 3:
    m += 100000

if x == 2:
    m += 200000

if x == 1:
    m += 300000

if y == 3:
    m += 100000

if y == 2:
    m += 200000

if y == 1:
    m += 300000

if m == 600000:
    m += 400000

print(m)

Submission status: Accepted

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()

#####Shorten#####
def DD(arg): return defaultdict(arg)


#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr

#####MakeDivisors######
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)
  return divisors

#####MakePrimes######
def make_primes(N):
  max = int(math.sqrt(N))
  seachList = [i for i in range(2,N+1)]
  primeNum = []
  while seachList[0] <= max:
    primeNum.append(seachList[0])
    tmp = seachList[0]
    seachList = [i for i in seachList if i % tmp != 0]
  primeNum.extend(seachList)
  return primeNum

#####GCD#####
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase#####
def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i-1])*n**i for i in range(len(str(X))))

#####IntLog#####
def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count

#############
# Main Code #
#############
X,Y = IL()
ans = 0
if X==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:

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

ans = max(4-X,0)* 100000 + max(4-Y,0)* 100000
if (X == Y) *  (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)
    exit()

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:
import sys

stdin = sys.stdin
inf = 1 << 60
mod = 1000000007

sys.setrecursionlimit(10**7)

ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
nf = lambda: float(ns())
nfn = lambda y: [nf() for _ in range(y)]
nfa = lambda: list(map(float, stdin.readline().split()))
nfan = lambda y: [nfa() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

x, y = na()
x -= 1
y -= 1
c = [300000, 200000, 100000]
ans = 0
if x < 3:
    ans += c[x]
if y < 3:
    ans += c[y]
if x == 0 and y == 0:
    ans += 400000

print(ans)

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
ans = 0
for i in range(1,4):
    for j in [x,y]:
        if j == i:
            ans += (4-i)*10**5
print(ans+400000 if x*y == 1 else ans)

Submission status: Accepted

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

money = [3*10**5,2*10**5,10**5]

ans = 0
if X == 1 and Y == 1:
    ans = 2*money[0] + 4*10**5
    print(ans)
else:
    if X <= 3:
        ans += money[X-1]
    if Y <= 3:
        ans += money[Y-1]
    print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8

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

l1 = [1,2,3]
l2 = [300000,200000,100000]

ans = 0
if x in l1:
    ans += l2[l1.index(x)]
    
if y in l1:
    ans += l2[l1.index(y)]

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

print(ans)

Submission status: Accepted

Solution code:
from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations # (string,3) 3回
from collections import deque
from collections import defaultdict
import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
x,y = readInts()
a = [300000,200000,100000] + [0] * 2000
print(a[0] + a[0] + 400000 if x == y == 1 else a[x-1] + a[y-1])

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
l = LI()
ans = 0
for i in l:
    if i == 1:
        ans += 300000
    elif i == 2:
        ans += 200000
    elif i == 3:
        ans += 100000
if l[0] == l[1] == 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+=100000
    elif i==2:ans+=200000
    elif i==1:ans+=300000
if x==y==1:
    ans += 400000
print(ans)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

X, Y = mi()

l = [0, 300000, 200000, 100000]

for i in range(205):
    l.append(0)
    
ans = l[X] + l[Y]
if X==Y==1:
    print(ans + 400000)
else:
    print(ans)

Submission status: Accepted

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

ans = max(0, (4 - X) * 100000)
ans+= max(0, (4 - Y) * 100000)

if X == Y == 1:
    ans += 100000 * 4

print (ans)

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
price = [0, 300000, 200000, 100000] + [0]*300
ans = price[X] + price[Y] + 400000*(X == Y == 1)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

#入力
# s = list(input()[0:-1])
# n = int(input())
x = list(map(int, input().split()))
# a = list(map(int,input().split()))
# b = list(map(int,input().split()))
# w = [int(input()) for i in range(n)]

# ab=[]
# for i in range(N):
#     a,b = map(int, input().split())
#     ab.append((a,b))
 
def main():
    sal = {1:(3*10**5),2:2*(10**5),3:10**5}
    ans = 0
    for i in x:
        if i not in sal:
            continue
        ans+=sal[i]
    if x[0]==1 and x[1]==1:
        ans+=4*(10**5)
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

ans=0
if X==1 and Y==1:
    print(1000000)
    quit()
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:
x,y = map(int,input().split())
if x==1 and y==1:
    print(1000000)
else:
    print(100000*(max(4-x,0)+max(4-y,0)))

Submission status: Accepted

Solution code:
a = input().split()
x = 0
if a[0] == "1" and a[1] == "1":
    x = 1000000
elif a[0] == "1":
    x = x + 300000
elif a[1] == "1":
    x = x + 300000
if a[0] == "2":
    x = x + 200000
if a[0] == "3":
    x = x + 100000
if a[1] == "2":
    x = x + 200000
if a[1] == "3":
    x = x + 100000
print(x)

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 += (4-x)*100000
if y<=3:
	ans += (4-y)*100000
print(ans)

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

Submission status: Accepted

Solution code:
X,Y=map(int, input().split())
v = [300000, 200000, 100000]
x = 0
y = 0
if X <= 3:
    x = int(v[X-1])
if Y <= 3:
    y = int(v[Y-1])
print(int(x + y + ((X==1) & (Y==1)) * 400000))

Submission status: Accepted

Solution code:
X,Y=map(int, input().split())
v1 = [300000, 200000, 100000]
v2 = [300000, 200000, 100000]
x = 0
y = 0
if X <= 3:
    x = int(v1[X-1])
if Y <= 3:
    y = int(v2[Y-1])
if ((X==1) & (Y==1)):
    print(int(x + y + 400000))
else:
    print(int(x + y))

Submission status: Accepted

Solution code:
A,B = list(map(int,input().split()))
N={1:300000,2:200000,3:100000}
if A ==1 and B==1:
    print(1000000)
else:
    try:
        A=N[A]
    except KeyError:
        A=0
    try:
        B=N[B]
    except KeyError:
        B=0
    print(A+B)

Submission status: Accepted

Solution code:
XY=list(map(int,input().split()))
prize=0
for xy in XY:
    if xy==1:
        prize+=300000
    elif xy==2:
        prize+=200000
    elif xy==3:
        prize+=100000
if sum(XY)==2:
    prize+=400000
print(prize)

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
ans = 0
for z in [X,Y]:
  if z == 3:
    ans += 10**5
  elif z == 2:
    ans += 2*10**5
  elif z == 1:
    ans += 3*10**5
if X == Y == 1:
  ans += 4*10**5
print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
x,y = input().split()
d = {"1":300000,"2":200000,"3":100000}
if x=="1" and y=="1":
    print(d.get(x,0)+d.get(y,0)+400000)
else:
    print(d.get(x,0)+d.get(y,0))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x,y = map(int,input().split())
c = 0
for i in [x,y]:
  if i < 4:
    c += [3*10**5,2*10**5,10**5][i-1]
if x == y == 1:
  c += 4*10**5
print(c)

Submission status: Accepted

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

r=0

if x==3:
  r+=100000
elif x==2:
  r+=200000
elif x==1:
  r+=300000
  
if y==3:
  r+=100000
elif y==2:
  r+=200000
elif y==1:
  r+=300000
  
if x==1 and y==1:
  r+= 400000

print(r)

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
award = [300000, 200000, 100000]
ans = 0

if X <= 3:
    ans += award[X-1]

if Y <= 3:
    ans += award[Y-1]

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

print(ans)

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

def main():
    x,y = map(int, readline().split())

    ans = 0

    d = {}
    d[1] = 300000
    d[2] = 200000
    d[3] = 100000

    if x in d:
        ans += d[x]
    
    if y in d:
        ans += d[y]

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

for i in [x,y]:
    if i > 3:
        continue
    ans += (4-i)*100000
print(ans)

Submission status: Accepted

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

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

ans = f(x)+f(y)
if x == y== 1:
  ans += 400000
print(ans)

Submission status: Accepted

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

if x == 1:
    if y==1:
        print(1000000)
    elif y==2:
        print(a+b)
    elif y==3:
        print(a+c)
    else:
        print(a)
if x == 2:
    if y==1:
        print(a+b)
    elif y==2:
        print(b+b)
    elif y==3:
        print(b+c)
    else:
        print(b)
if x == 3:
    if y==1:
        print(a+c)
    elif y==2:
        print(c+b)
    elif y==3:
        print(c+c)
    else:
        print(c)
if x>3 and y>3:
    print(0)
if x>3 and y == 1:
    print(a)
if x>3 and y == 2:
    print(b)
if x>3 and y == 3:
    print(c)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
sys.setrecursionlimit(10**9)
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
def lispin(t=int):return list(pin(t))
#%%code
def resolve():
    X,Y=pin()
    t=10**5
    a=[0,t*3,t*2,t*1]+[0]*1000
    print(a[X]+a[Y]+4*t*(X==Y and X==1))
#%%submit!
resolve()

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

Submission status: Accepted

Solution code:
x = list(map(int, input().split()))
top_count = 0
ans = 0
for i in x:
  if i == 1:
    ans += 300000
    top_count += 1

  elif i == 2:
    ans += 200000

  elif i == 3:
    ans += 100000

if top_count == 2:
  print(ans + 400000)
else:
  print(ans)

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
ans = 0
if X == 1 and Y == 1:
    ans = 1000000
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)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

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

aa = [0, 300000, 200000, 100000]
ans=0
if n <4:
    ans += aa[n]
if m <4:
    ans += aa[m]


if n == 1 and m ==1:
    ans += 400000

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    x,y=map(int, input().split())
    ans=0
    if x<=3:
        ans+=100000
        if x<=2:
            ans+=100000
            if x==1:
                ans+=100000
    if y<=3:
        ans+=100000
        if y<=2:
            ans+=100000
            if y==1:
                ans+=100000
    if x==1 and y==1:
        ans+=400000
    print(ans)

resolve()

Submission status: Accepted

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

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

print(total)

Submission status: Accepted

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

p = 0
pr = [300000,200000,100000]

if(x <= 3):p += pr[x-1]
if(y <= 3):p += pr[y-1]

if(x == y and x == 1):p += 400000

print(p)

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    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)

resolve()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():

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


resolve()

Submission status: Accepted

Solution code:
x,y = map(int, input().split())
p = [300000,200000,100000]
ot = [0]*205
dt = p+ot

if x * y == 1:
  print(dt[x-1]+dt[y-1]+400000)
else:
  print(dt[x-1]+dt[y-1])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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())
s = [300000, 200000, 100000]
if X == 1 and Y == 1:
    print(s[0]*2 + 400000)
else:
    if X <= 3 and Y <= 3:
        print(s[X-1] + s[Y-1])
    elif X <= 3 and Y > 3:
        print(s[X-1])
    elif X > 3 and Y <= 3:
        print(s[Y-1])
    else:
        print(0)

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    x,y = map(int, input().split())
    a = 0
    b = 0
    if x==1:
        a += 300000
    if x==2:
        a += 200000
    if x==3:
        a += 100000
    if y==1:
        b += 300000
    if y==2:
        b += 200000
    if y==3:
        b += 100000
    if a+b == 600000:
        print(1000000)
    else:
        print(a+b)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
a=[300000,200000,100000]
b=[0]*300
a=a+b
add=0
if x*y==1:
    add=400000
print(a[x-1]+a[y-1]+add)

Submission status: Accepted

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

ans = 300000 if x == 1 else (200000 if x == 2 else (100000 if x == 3 else 0))
ans += 300000 if y == 1 else (200000 if y == 2 else (100000 if y == 3 else 0))
ans += 400000 if x == 1 and y == 1 else 0


print(ans)

Submission status: Accepted

Solution code:
x, y = (max(4 - int(i), 0) for i in input().split())
print((x + y + 4*(x==y==3)) * 10**5)

Submission status: Accepted

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

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

money = {3: 100000, 2: 200000, 1: 300000}
if X <= 3:
    ans += money[X]
if Y <= 3:
    ans += money[Y]

print(ans)

Submission status: Accepted

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

prize = [300000, 200000, 100000]

ans = 0

if 1 <= X <= 3:
    ans += prize[X-1]
if 1 <= Y <= 3:
    ans += prize[Y-1]

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

print(ans)

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    X=[int(_) for _ in input().split()]
    sum=0
    for x in X:
        if x == 1:sum+=300000
        elif x==2:sum+=200000
        elif x==3:sum+=100000
    if X[0]==X[1] and X[0]==1:
        sum+=400000
    print(sum)

if __name__=='__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
tmp=0
if X==1 and Y==1:
    tmp+=400000

for i in (X, Y):
    if i==1:
        tmp+=300000
    elif i==2:
        tmp+=200000
    elif i==3:
        tmp+=100000
print(tmp)

Submission status: Accepted

Solution code:
x,y=map(int,input().split())
lis=[0,300000,200000,100000]
lis=lis+[0]*1000
ans=lis[x]+lis[y]
if x==y==1:
  ans+=400000
print(ans)

Submission status: Accepted

Solution code:
from sys import setrecursionlimit, exit
setrecursionlimit(1000000000)

def main():
    x, y = map(int, input().split())
    a = max(0, (4 - x) * 100000)
    b = max(0, (4 - y) * 100000)
    c = 400000 if x == y == 1 else 0
    print(a + b + c)

main()

Submission status: Accepted

Solution code:
X, Y = map(int, input().split())
tmp=0
if X==1 and Y==1:
    tmp+=400000

for i in (X, Y):
    if i==1:
        tmp+=300000
    elif i==2:
        tmp+=200000
    elif i==3:
        tmp+=100000
print(tmp)

Submission status: Accepted

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

x, y = [int(x) for x in 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 == 1 and y == 1:
    ans += 400000

print(ans)

Submission status: Accepted

Solution code:
from collections import defaultdict
money = defaultdict(int)
for i, m in enumerate([300000, 200000, 100000]):  
    money[i] = m
    
X, Y = map(int, input().split())
X -= 1; Y -= 1
ans = money[X] + money[Y]
if X + Y:
    print(ans)
else:
    print(ans + 400000)

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 a == 1 and b == 1:
  ans += 400000

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

check = list(map(int, readline().split()))
prize = [3 * 10 ** 5, 2 * 10 ** 5, 10 ** 5]
ans = 0
if check.count(1) == 2:
    ans = 10 ** 6
else:
    if check[0] <= 3:
        ans += prize[check[0] - 1]
    if check[1] <= 3:
        ans += prize[check[1] - 1]
print(ans)

Submission status: Accepted

Solution code:
a = list(map(int, input().split()))
ans = 0
prise = {1: 300000, 2: 200000, 3: 100000}
for i in a:
  if i not in prise:
    continue
  ans += prise[i]
if a[0] == a[1] == 1:
  ans += 400000
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

if __name__ == '__main__':
    a = [int(i) for i in input().split()]
    count =0

    if a[0] ==1:
        count+=300000
    if a[1] ==1:
        count+=300000
    if a[0] ==2:
        count+=200000
    if a[1] ==2:
        count+=200000
    if a[0] ==3:
        count+=100000
    if a[1] ==3:
        count+=100000
    if a[0] == a[1]==1 :
        count+=400000
    print(count)