Problem:


Score : 100 points

Problem Statement

You have decided to give an allowance to your child depending on the outcome of the game that he will play now.

The game is played as follows:

There are three "integer panels", each with a digit between 1 and 9 (inclusive) printed on it, and one "operator panel" with a + printed on it.

The player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)

Then, the amount of the allowance will be equal to the resulting value of the formula.

Given the values A, B and C printed on the integer panels used in the game, find the maximum possible amount of the allowance.

Constraints

All values in input are integers.

1 \leq A, B, C \leq 9

Input

Input is given from Standard Input in the following format:

A B C

Output

Print the maximum possible amount of the allowance.

Sample Input 1

1 5 2

Sample Output 1

53

The amount of the allowance will be 53 when the panels are arranged as 52+1, and this is the maximum possible amount.

Sample Input 2

9 9 9

Sample Output 2

108

Sample Input 3

6 6 7

Sample Output 3

82



Sample input:
1 5 2


Sample output:
53

Submission status: Runtime Error

Solution code:
LX = list(input().split(" "))sort(reverse=True)
print(int(LX[0]+LX[1])+int(LX[2]))

Submission status: Runtime Error

Solution code:
n = [int(x) for x in input().split()].sort()
print(10*n[2]+n[1]+n[0])

Submission status: Runtime Error

Solution code:
from collections import Counter as c
from scipy.misc import comb
from functools import reduce

def f(n):
  d=c()
  for i in range(2,1+int(n**0.5)):
    while n%i==0:
      d[i]+=1
      n//=i
  if n:d[n]+=1
  return d.values()

n,m=map(int,input().split())
mod=10**9+7
print(reduce(lambda x,y:x*y%mod,map(lambda x:comb(x+n-1,x,exact=True),f(m)))%mod)

Submission status: Runtime Error

Solution code:
l = [int(i) for i in input().split()]
# sort()は破壊的じゃないです
l = l.sort
print(l[0]*10 + l[1] + l[2])

Submission status: Runtime Error

Solution code:
l = [int(input()) for i in range(3)]
l.sort()
print(l[2]*10 + l[0] + l[1])

Submission status: Runtime Error

Solution code:
n,m,x,y=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
a.sort(reverse=True)
b.sort()
# xx=a[0]
f=0
# if xx<x:
#     xx=x 
for i in range(x+1,y+1):
    if i<=b[0] and i>a[0]:
        #print(i)
        f=1 
        break 
if f==1:
    print("No War")
else:
    print("War")

Submission status: Runtime Error

Solution code:
N,M,X,Y = map(int, input().split())
num_list = [list(map(int, input().split())) for _ in range(2)]

x_max = max(num_list[0])
y_max = max(num_list[1])

if x_max >= y_max:
    print('War')
elif x_max < X or y_max > Y:
    print('War')
else:
    print('No war')

Submission status: Runtime Error

Solution code:
num = list(map(int, input().split()))
num.sort(reverse=True)
a = str(num[0])
b = str(num[1])
c = int(num[2])
ab = a + b
ab = int("ab")
print(ab + c)

Submission status: Runtime Error

Solution code:
def C(x, y):
    z = 1
    for i in range(x, x-y, -1):
        z *= i
    for i in range(y, 1, -1):
        z //= i
    return z
def H(x, y):
    return C(x+y-1, y) % 1000000007
n, m = list(map(int, input().split()))
p = 2
prime_factorization = []
while p * p <= m:
    count = 0
    while m % p == 0:
        m //= p
        count += 1
    if count > 0:
        prime_factorization.append(count)
    p += 1
if m > 1:
    prime_factorization.append(1)
ans = 1
for r in prime_factorization:
    ans *= H(n, r)
print(ans % 1000000007)

Submission status: Runtime Error

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


ans = max(A*10 + B + C, B*10 + A + C, C*10 + A + B)
print(ans)

Submission status: Runtime Error

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


int ans = max(A*10 + B + C, B*10 + A + C, C*10 + A + B)
print(ans)

Submission status: Runtime Error

Solution code:
data = int(input().split())

int A = data[0]
int B = data[1]
int C = data[2]

int ans = max(A*10 + B + C, B*10 + A + C, C*10 + A + B)
print(ans)

Submission status: Runtime Error

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

int ans = max(A*10 + B + C, B*10 + A + C, C*10 + A + B)
print(ans)

Submission status: Runtime Error

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

int D = max(A, B, C)

if A == D :
  print(A * 10 + B + c)
  
elif B == D:
  print(B * 10 + A + C)
  
elif C == D
  print(C * 10 + A + B)

Submission status: Runtime Error

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

int D = max(A, B, C)

if A == D :
  print(A * 10 + B + c)
  
elif B == D:
  print(B * 10 + A + C)
  
elif C == D
  print(C * 10 + A + B)

Submission status: Runtime Error

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

int D = max(A, B, C)

if A == D :
  print(A * 10 + B + c)
  
elif B == D:
  print(B * 10 + A + C)
  
elif C == D
  print(C * 10 + A + B)

Submission status: Runtime Error

Solution code:
A, B, C = int(input[])

int D = max(A, B, C)

if A == D :
  print(A * 10 + B + c)
  
elif B == D:
  print(B * 10 + A + C)
  
elif C == D
  print(C * 10 + A + B)

Submission status: Runtime Error

Solution code:
A, B, C = (int(x) for x in input().split())

int D = max(A, B, C)

if A == D :
  print(A * 10 + B + c)
  
elif B == D:
  print(B * 10 + A + C)
  
elif C == D
  print(C * 10 + A + B)

Submission status: Runtime Error

Solution code:
A, B, C = int(input())

int D = max(A, B, C)

if A == D :
  print(A * 10 + B + c)
  
elif B == D:
  print(B * 10 + A + C)
  
elif C == D
  print(C * 10 + A + B)

Submission status: Runtime Error

Solution code:
A, B, C = int(input())

int D = max(A, B, C)

if A == D :
  print(A * 10 + B + c)
  
elif B == D:
  print(B * 10 + A + C)
  
else :
  print(C * 10 + A + B)

Submission status: Runtime Error

Solution code:
l = sorted(ist(map(int, input().split())))
print(l[0] + int(str(l[1]) + str(l[2])))

Submission status: Runtime Error

Solution code:
s = input()
t = input()
dict_s = ["_"]*26
dict_t = ["_"]*26
alphabet = [chr(i) for i in range(97, 97 + 26)]
print(alphabet)
for i in range(len(s)):
    if dict_s[alphabet.index(s[i])] == "_":
        dict_s[alphabet.index(s[i])] = t[i]
    elif dict_s[alphabet.index(s[i])] != t[i]:
            print("No")
            exit()
    if dict_t[alphabet.index(t[i])] == "_":
        dict_t[alphabet.index(t[i])] = s[i]
    elif dict_t[alphabet.index(t[i])] != s[i]:
            print("No")
            exit()
print("Yes")

Submission status: Runtime Error

Solution code:
num = map(int, input().split())
num = sorted(num, reverce = True)
print(num[0]*10 + num[1] + num[2])

Submission status: Runtime Error

Solution code:
import time
import collections
import scipy.misc

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   

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

factors = collections.Counter(prime_decomposition(M))
t_elps = time.time()
#print(f"{t_elps - t_strt} [sec]")
num_pattern = 1;

for exponent in factors.values():
    tmp_num_pattern = scipy.misc.comb(exponent + N -1, N-1, exact = True) 
    num_pattern = num_pattern * int(tmp_num_pattern)
    
#print(num_pattern%(10**9+7))

t_elps = time.time()
print(f"{t_elps - t_strt} [sec]")

Submission status: Runtime Error

Solution code:
s, t = [input() for _ in range(2)]

for i in range(len(s)):
    if s[i] == t[i]:
        pass
    else:
        s_diff = s[i]
        t_diff = t[i]
        s = s.translate(str.maketrans({s_diff: "", t_diff: ""}))
        t = t.translate(str.maketrans({s_diff: "", t_diff: ""}))
if s == t:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
a, = list(map(int,input().split()))
a.sort(reverse=True)
print(10*a[0] + a[1] +a[2])

Submission status: Runtime Error

Solution code:

Copy
S = input()
T = input()
 
S_list = []
T_list = []
alpha = "abcdefghijklmnopqrstuvwxyz"
 
for i in alpha:
    SS = S.count(i)
    TT = T.count(i)
    if SS and TT> 0:
        S_list.append(SS)
        T_list.append(TT)
 
if sorted(S_list) != sorted(T_list):
    print('No')
else:
    print('Yes')

Submission status: Runtime Error

Solution code:
a = list(map(int,input().split())
a.sort()
print(10*a[2]+a[1]+a[0])

Submission status: Runtime Error

Solution code:
a = list(int,input().split())
a.sort()
print(10*a[2]+a[1]+a[0])

Submission status: Runtime Error

Solution code:
n, m, X, Y = map(int, input().split())
xlist = list(map(int, input().split()))
ylist = list(map(int, input().split()))
xlist.sort()
ylist.sort()

if xlist[-1] <= ylist[0]:
   for i in range(xlist[-1]+1, ylist[0]+1):
      if X < i and i <= Y:
          print("No War")
          break
else:
   print("War")

Submission status: Runtime Error

Solution code:
prin

Submission status: Runtime Error

Solution code:
a = [int(i) for i in input().split())]
a.sort()
print(a[2]*10+a[1]+a[0])

Submission status: Runtime Error

Solution code:
# coding: utf-8
 
n, m, x, y = map(int, input().split())
xn = list(map(int, input().split()))
ym = list(map(int, input().split()))
xn.append(x)
ym.append(y)
flag = 0
 
if x < y:
    for i in range(min(xn), max(ym)+1):
        if max(xn) < i and min(ym)>=i:
            print("No War")
            flag = 1
    if flag == 0:
        print("War")
else:
    print("War")

Submission status: Runtime Error

Solution code:
# coding: utf-8
 
n, m, x, y = map(int, input().split())
xn = list(map(int, input().split()))
ym = list(map(int, input().split()))
flag = 0

if x < y:
    for i in range(x+1, y+1):
        if max(xn) < i and min(ym)>=i:
            print("No War")
            flag = 1
        elif flag == 0 and i == y:
            print("War")
else:
    print("War")

Submission status: Runtime Error

Solution code:
# coding: utf-8
 
n, m, x, y = map(int, input().split())
xn = list(map(int, input().split()))
ym = list(map(int, input().split()))

if x < y:
    for i in range(x, y+1):
        if max(xn) < i and min(ym)>=i:
            print("No War")
            break
        elif i == y:
            print("War")
else:
    print("War")

Submission status: Runtime Error

Solution code:
# coding: utf-8
 
n, m, x, y = map(int, input().split())
xn = list(map(int, input().split()))
ym = list(map(int, input().split()))
 
if x < y:
    for i in range(x, y+1):
        if max(xn) < i and min(ym)>=i:
            print("War")
        elif i == y:
            print("No War")
else:
    print("No War")

Submission status: Runtime Error

Solution code:
a = input().split()
a = [int(i) for i in a]
print(a)
amax = a[0]
for i in range(1,3):
    if a[i] > amax:
        amax = a[i]
        count = i
    else:
        pass
a.pop(count)
print(amax*10+a[0]+a[1])

Submission status: Runtime Error

Solution code:
# coding: utf-8

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

x = a*10 + b
y = b*10 + c
z = c*10 + a

if x >= y and x >= z:
    print(x + c)
elif y >= x and y >= z:
    print(y + a)
else
    print(z + b)

Submission status: Runtime Error

Solution code:
abc = list(map(int, input().split()))
abc = sort(abc)
abc = abc[:,:,-1]
print(abc[0]*10+abc[1]+abc[2])

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())

MOD = 10 ** 9 + 7


def prime_counter(n):
    ret = []
    for i in range(2, int(n / 2) + 2):
        count = 0
        while n % i == 0:
            n /= i
            count += 1
        if 0 < count:
            ret.append(count)
        if n == 1:
            break
    if 1 < n:
        ret.append(1)
    return ret


def comb(n, r):
    r = min(r, n - r)
    if r == 0:
        return 1
    elif r == 1:
        return n
    return (n % MOD) * pow(r, MOD - 2, MOD) * comb(n - 1, r - 1) % MOD


factnum = prime_counter(M)
ans = 1

for p in factnum:
    ans *= comb(p + N - 1, p)

ans %= MOD
print(ans)

Submission status: Runtime Error

Solution code:
N,M,X,Y = map(int, input().split())
num_list = [list(map(int, input().split())) for _ in range(M)]

Z = list(range(X+1,Y+1))

for z in Z:
    if max(num_list[0]) < z and min(num_list[1]) >= z:
        print('No War')
        break
    if z == Z[-1]:
        print('War')

Submission status: Runtime Error

Solution code:
N,M = map(int,input().split(" "))
fact = {}
for i in range(2,M):
    while (M%i == 0):
        if i in fact:
            fact[i] += 1
        else:
            fact[i] = 1
        M //= i
    if (M == 1):
        break


MOD = 10**9+7

def nCr_mod(n,r,mod): #nCrmod
    r = min(n-r,r)
    v = 1
    for i in range(r):
        v = (v * ((n-i)%mod) * pow((i+1),mod-2,mod)) % mod
    return v

ans = 1
for key,item in fact.items():
    ans *= nCr_mod((item + (N) - 1),N-1,MOD)
    ans %= MOD
print(ans)

Submission status: Runtime Error

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

if a>=b and a>=c:
    print(10*a+b+c)
    
elif b>=a and b>=c:
    prnt(a+10*b+c)
    
elif c>=a and c>=b:
    print(a+b+10*c)

Submission status: Runtime Error

Solution code:
abc = list(map(int,input().split(" "))
m = max(abc)
s = sum(abc)
ans = s-m+(m*10)
print(ans)

Submission status: Runtime Error

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

if a+b>=b+c:
    print(10*a+b+c)
    
elif a+b<=b+c:
    prnt(a+10*b+c)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(100000)

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

MOD = 10 ** 9 + 7

if m == 1:
    print('1')
    exit()

factor = []
temp = 0
x = 2
while m > 1:
    if m % x == 0:
        m //= x
        temp += 1
    elif temp > 0:
        factor.append(temp)
        temp = 0
        x += 1
    else:
        x += 1
factor.append(temp)

nCr = {}
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n;
    if (n, r) in nCr: return nCr[(n, r)]

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p;
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    nCr[(n, r)] = result
    return result;

ans = 1
for x in factor:
    ans *= cmb(x + n - 1, n - 1)
    ans %= MOD

print(ans)

Submission status: Runtime Error

Solution code:
import numpy as np
 
inp = np.asarray(input().split(), dtype=int)
inp = np.sort(inp)
print(inp[2]*10+np.sum(inp[:1])

Submission status: Runtime Error

Solution code:
import numpy as np

inp = np.asarray(input().split(), dtype=int)
inp = np.sort(inp)
print(inp[0]*10+np.sum(inp[1:])

Submission status: Runtime Error

Solution code:
import numpy as np

inp = list(map(input().split(), int))
inp = np.sort(inp)
print(inp[0]*10+np.sum(inp[1:])

Submission status: Runtime Error

Solution code:
import numpy as np

inp = list(map(input(), int))
inp = np.sort(inp)
print(inp[0]*10+np.sum(inp[1:])

Submission status: Runtime Error

Solution code:
S = str(input())
T = str(input())

from collections import defaultdict
s = defaultdict(int)
t = defaultdict(int)

for i in S:
	s[i] += 1

for j in T:
	t[j] += 1

ss = sorted(s.values())
tt = sorted(t.values())

if ss == tt:
	print('Yes')
else:
	print('No')

Submission status: Runtime Error

Solution code:
S = str(input())
T = str(input())

#辞書型を使ってみる。defaultdictは便利らしい。どこがかはちょっとよく分からなかった。
from collections import defaultdict
s = defaultdict(int)
t = defaultdict(int)


for i in S:
	s[i] += 1

for j in T:
	t[j] += 1

#辞書型をソートできるsoted()を使う。
#values()で辞書型のkey valueのvalueだけを取り出している。

ss = sorted(s.values())
tt = sorted(t.values())

if ss == tt:
	print('Yes')
else:
	print('No')

Submission status: Runtime Error

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

max_lines = [[int(x + y), int(z)],
			 [int(x + z), int(y)],
             [int(y + x), int(z)],
             [int(y + z), int(x)],
             [int(z + x), int(y)],
             [int(z + y), int(x)]]

max_point = 0
one_point = 0
for max_line in max_lines:
    if max_line[0] >= max_point:
    	max_point = max_line[0]
        one_point = max_line[1]

print(max_point + one_point)

Submission status: Runtime Error

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

max_lines = [[int(x + y), int(z)],
			 [int(x + z), int(y)],
             [int(y + x), int(z)],
             [int(y + z), int(x)],
             [int(z + x), int(y)],
             [int(z + y), int(x)]]

max_point = 0
one_point = 0
for max_line in range(max_lines):
    if max_line[0] >= max_point:
    	max_point = max_line[0]
        one_point = max_line[1]

print(max_point + one_point)

Submission status: Runtime Error

Solution code:
line = input().rstrip().split(' ')

max_lines = [[int(line[0] + line[1]), int(line[0])],
			 [int(line[0] + line[2]), int(line[1])],
             [int(line[1] + line[0]), int(line[2])],
             [int(line[1] + line[2]), int(line[0])],
             [int(line[2] + line[0]), int(line[1])],
             [int(line[2] + line[1]), int(line[0])]]

max_point = 0
one_point = 0
for max_line in max_lines:
    if max_line[0] >= max_point:
    	max_point = max_line[0]
        one_point = max_line[1]

print(max_point + one_point)

Submission status: Runtime Error

Solution code:
line = input().rstrip().split(' ')

fst_point = int(line[0]) * 10 + int(line[1])
sec_point = int(line[1]) * 10 + int(line[2])

if fst_point > sec_point:
    return print(fst_point + int(line[2]))
else:
    return print(sec_point + int(line[0]))

Submission status: Runtime Error

Solution code:
line = input().rstrip().split(' ')

fst_point = int(line[0]) * 10 + int(line[1])
sec_point = int(line[1]) * 10 + int(line[2])

if fst_point >= sec_point:
    return print(fst_point + int(line[2]))
else:
    return print(sec_point + int(line[0]))

Submission status: Runtime Error

Solution code:
line = input().rstrip().split(' ')

fst_point = int(line[0]) * 10 + int(line[1])
sec_point = int(line[1]) * 10 + int(line[2])

if fst_point >= sec_point then:
    return print(fst_point + int(line[2]))
else:
    return print(sec_point + int(line[0]))

Submission status: Runtime Error

Solution code:
from collections import Counter

mod = 1000000007

# nの素因数分解

def prime(n):
    d = Counter()
    i = 2
    while n != 1:
        while n%i == 0:
            n //= i
            d[i] += 1
        i += 1
    return d

# xのn乗を計算する
def mod_pow(x, n):
    if n == 0:
        return 1
    elif n % 2 == 0:
        half_x = mod_pow(x, n // 2)
        return half_x * half_x % mod
    else:
        return x * mod_pow(x, n-1) % mod

fact = [0] * 100099
inv = [0] * 100099
fact[0] = 1
inv[0] = 1
for k in range(1, 100099):
    fact[k] = fact[k-1] * k % mod
    inv[k] = mod_pow(fact[k], mod-2)

def nCr(n, r):
    return fact[n] * inv[r] % mod * inv[n-r] % mod

def solve():
    N, M = map(int, input().split())
    p = prime(M)
    s = 1
    for i in p.values():
        s *= nCr(i + N - 1, N - 1)
        s %= mod
    print(s)

solve()

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())

mod = 1000000007

f = [] # 素因数分解(指数部のみ)

for p in range(2, M): # 素因数分解
    e = 0
    while M%p == 0:
        e += 1
        M /= p
    
    if e>0:
        f.append(e)
    
    if M == 1:
        break

def pw(a, e):
    if e == 1:
        return a
    p = pw(a, e // 2)
    if e%2 == 1:
        return p * p % mod a % mod
    else:
        return p * p % mod

# fact, inv の計算
fact = [1] * 100040
inv = [1] * 100040
for k in range(1, 100040):
    fact[k] = fact[k-1] * k % mod
    inv[k] = pw(fact[k], mod-2)

ans = 1
for e in f:
    ans = ans * fact[e+N-1] % mod * inv[e] % mod * inv[N-1] % mod # N_H_e (重複組合せ)

print(ans)

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())

mod = 1000000007

f = [] # 素因数分解(指数部のみ)

for p in range(2, M): # 素因数分解
    e = 0
    while M%p == 0:
        e += 1
        M /= p
    
    if e>0:
        f.append(e)
    
    if M == 1:
        break

def pw(a, e):
    if e == 1:
        return a
    p = pw(a, e // 2)
    if e%2 == 1:
        return p * p * a % mod
    else:
        return p * p % mod

# fact, inv の計算
fact = [1] * 100040
inv = [1] * 100040
for k in range(1, 100040):
    fact[k] = fact[k-1] * k % mod
    inv[k] = pw(fact[k], mod-2)

ans = 1
for e in f:
    ans *= fact[e+N-1] * inv[e] * inv[N-1] % mod # N_H_e (重複組合せ)

print(ans)

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())

mod = 1000000007

f = [] # 素因数分解(指数部のみ)

for p in range(2, M): # 素因数分解
    e = 0
    while M%p == 0:
        e += 1
        M /= p
    
    if e>0:
        f.append(e)
    
    if M == 1:
        break

def pw(a, e):
    if e == 1:
        return a
    p = pw(a, e // 2)
    if e%2 == 1:
        return p * p % mod * a % mod
    else:
        return p * p % mod

# fact, inv の計算
fact = [1] * 100033
inv = [1] * 100033
for k in range(1, 100033):
    fact[k] = fact[k-1] * k % mod
    inv[k] = pw(fact[k], mod-2)

def combine(n, k):
    return fact[n] * inv[k] % mod * inv[n-k] % mod

ans = 1
for e in f:
    ans *= combine(e+N-1, e) # N_H_e (重複組合せ)
    ans %= mod

print(ans)

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())

mod = 1000000007

f = [] # 素因数分解(指数部のみ)

for p in range(2, M): # 素因数分解
    e = 0
    while M%p == 0:
        e += 1
        M /= p
    
    if e>0:
        f.append(e)
    
    if M == 1:
        break

def pw(a, e):
    if e == 1:
        return a
    p = pw(a, e // 2)
    if e%2 == 1:
        return p * p % mod * a % mod
    else:
        return p * p % mod

# fact, inv の計算
fact = [1] * 100033
inv = [1] * 100033
for k in range(1, 100033):
    fact[k] = fact[k-1] * k % mod
    inv[k] = pw(fact[k], mod-2))

def combine(n, k):
    return fact[n] * inv[k] % mod * inv[n-k] % mod

ans = 1
for e in f:
    ans *= combine(e+N-1, e) # N_H_e (重複組合せ)
    ans %= mod

print(ans)

Submission status: Runtime Error

Solution code:
iptA=list(map(int,input().split()))
X=list(map(int,input().split()))
Y=list(map(int,input().split()))
X.append(iptA[2])
Y.append(iptA[3])
     
xmax,ymin=max(X),min(Y)
if xmax>=ymax:
    print('War')
else:
    print('No War')

Submission status: Runtime Error

Solution code:
iptA=list(map(int,input().split()))
X=list(map(int,input().split())).append(iptA[2])
Y=list(map(int,input().split())).append(iptA[3])

xmax,ymax=max(X),max(Y)
if xmax>=ymax:
    print('War')
 else:
     print('No War')

Submission status: Runtime Error

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

    xs = list(map(int,input().split()))
    ys = list(map(int,input().split()))
    zs = []

    for n in range(X+1,Y+1):
        zs.append(n)

    xMax = max(xs)
    yMin = min(ys)
    tmp = []
    for z in zs:
        if z > xMax:
            tmp.append(z)
        if z <= yMin:
            tmp.append(z)

    flag = False
    for z in zs:
        if tmp.count(z) > 1:
            flag = True


    if len(zs) == 0:
        print("War")
        return 0

    if flag:
        print("No War")
    else:
        print("War")


if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
n = list(map(str, raw_input().split()))
n.append('+')
nc = list(itertools.permutations(n))
ncc = []
vn = []
for _ in nc:
    if _[0] != '+' and _[3] != '+':
        ncc.append(_)
for __ in ncc:
    v = eval(('').join(__))
    vn.append(v)
print(max(vn))

Submission status: Runtime Error

Solution code:
A, B, C = map(int, input().split())
S = sum(A,B,C)
print(max(S+9*A, S+9*B, S+9*C))

Submission status: Runtime Error

Solution code:
n,m,x,y = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a = max(a)
b = min(b)
if (a<b and a+1>x and a+1<=y):
  print("No War")
else:
  print("War")

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())
def factor(n):
    for i in range(2, int(n)):
        if n%i == 0:
            return(i)
            break
    else:
        return(int(n))
M2 = M
dic = {}
flag = True
while flag:
    p = factor(M2)
    dic[p] = dic.get(p, 0) + 1
    M2 = M2/p
    if M2 ==1:
        flag = False

def comb(n, r):
    s = 1
    for i in range(1, r+1):
        s *= (n-r+i)/i
    return(int(s%(10**9+7)))
s = 1
print(dic)
for value in dic.values():
    s *= int(comb(value+N-1, value)%(10**9+7))
print(s%(1e9+7))

Submission status: Runtime Error

Solution code:
import math
import sympy
import numpy as np

def p(n,r):
    return int(math.factorial(n)/math.factorial(n-r))
def c(n,r):
    return int(p(n,r)/math.factorial(r))

n, m = map(int, input().split())
dic = sympy.factorint(m)
print(dic)
ans = [c(i+n-1,i) % (10**9+7) for i in dic.values()]
print(np.prod(ans) % (10**9+7))

Submission status: Runtime Error

Solution code:
one=list(input())
#print(one)
two=list(input())

for num,i in enumerate(one):
    if i not in z:
        z[i]=[num]
    else:
        z[i].append(num)
p={}
for num,i in enumerate(two):
    if i not in p:
        p[i]=[num]
    else:
        p[i].append(num)
w=[]
#print(p)
#print(z)
for k,v in z.items():
    w.append(v)
o=[]
for k,v in p.items():
    o.append(v)
print("Yes") if w==o else print("No")

Submission status: Runtime Error

Solution code:
a=map(int,input().split());print(sum(a)+9*max(a))

Submission status: Runtime Error

Solution code:
L=map(int,raw_input().split())

m = max(L)
i = L.index(L)
score=m*10
for j in range(3):
    if j!=i:
        score+=L[j]
print score

Submission status: Runtime Error

Solution code:
import collections


def run(s, t):
    ss = collections.Counter(s)
    tt = collections.Counter(t)
    if sorted(list(ss.values())) == sorted(list(tt.values())):
        return 'Yes'
    else:
        return 'No'


def main():
    s = input()
    t = input()
    print(run(s, t))


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
def factorial(n):
	fact = 1
	while n > 0:
		fact *= n
		n -= 1
	return fact
	
def combination(n, r):
    return factorial(n) // (factorial(n - r) * factorial(r))

n, m = map(int, input().split())
n_def = n
natural = list(range(2,320))
index = 0
while index < len(natural):
	for number in natural:
		if number % natural[index] == 0 and number / natural[index] != 1:
			natural.remove(number)
	index += 1
prime = natural

prime_division = {}
index = 0
number_prime = 0
while prime[index] <= m:
	if m % prime[index] == 0:
		m /= prime[index]
		number_prime += 1
		continue		
	else:
		prime_division[prime[index]] = number_prime
		number_prime = 0
		index += 1
else:
	prime_division[prime[index]] = number_prime

list_division = list(prime_division.values())
ans = 1
for i in list_division:
	ans *= combination(i+n-1,n-1)
print(int(ans%(10**9 + 7)))

Submission status: Runtime Error

Solution code:
num = list(input())

num = num.sort().reverse()

print(int(num[0] + num[1]) + int(num[2]))

Submission status: Runtime Error

Solution code:
num = list(input())

num.sort().reverse()

print(int(num[0] + num[1]) + int(num[2]))

Submission status: Runtime Error

Solution code:
A,B,C=map(int,input().split())
list=［A,B,C］
M=max(list)
D=9＊M+A+B+C
print(D)

Submission status: Runtime Error

Solution code:
S = input()
T = input()
alphs = "abcdefghijklmnopqrstuvwxyz"
flag = False
for alph in alphs:
    S2 = S
    indlist = []
    while alph in S2:
        i = S.index(alph)
        indlist.append(i)
        S2 = S2[i+1:]
    if indlist != []:
        T2 = T[indlist[0]]
    for ind in indlist:
        if T[ind] != T2:
            print("No")
            flag = True
            break
    if flag:
        break
else:
    for alph in alphs:
        T3 = T
        indlist = []
        while alph in T3:
            i = T.index(alph)
            indlist.append(i)
            T3 = T3[i+1:]
        if indlist != []:
            S3 = S[indlist[0]]
        for ind in indlist:
            if S[ind] != T3:
                print("No")
                flag = True
                break
        if flag:
            break
    else:
        print("Yes")

Submission status: Runtime Error

Solution code:
S = [int(i) for i in input().split()]
N = S[0]
M = S[1]
X = S[2]
Y = S[3]
C = [int(i) for i in range(N)]
D = [int(i) for i in range(M)]
 
x = max(C)
y = min(D)
 
if x < y:
    A = 1
elif x >= y:
    A = 0

if A == 1:
    if X > x:
        if Y >= y:
            B = 1
    if Y < y:
        if X < x:
            B = 1
    if x < X and y > Y:
        B = 1
 
if A == 1 and B == 1:
    print('No War')
else:
    print('War')

Submission status: Runtime Error

Solution code:
s1 = input()
t1 = input()

s = list(s1)
t = list(t1)

flag = 0
for i in range(len(s)):
    for j in range(len(s)):
        if s[i] == s[j]:
            if t[i] == t[j]:
                a = 1
            else:
                print("No")
                flag = 1
                break
        if flag == 1:
            break

        if t[i] == t[j]:
            if s[i] == s[j]:
                a = 1
            else:
                print("No")
                flag = 1
                break
        if flag == 1:
            break
    if flag == 1:
        break
if flag == 0:
    print("Yes")

Submission status: Runtime Error

Solution code:
S = [int(i) for i in input().split()]
N = S[0]
M = S[1]
X = S[2]
Y = S[3]
C = [int(i) for i in range(N)]
D = [int(i) for i in range(M)]

x = max(C)
y = min(D)

if x < y:
    A = 1
elif x >= y:
    A = 0

if X > x:
    if Y >= y > X:
        B = 1
if Y < y:
    if X < x < Y:
        B = 1
if X < (x + y) / 2 <= Y:
    B = 1
if x < X and y > Y:
    B = 1

if A == 1 and B == 1:
    print('No War')
else:
    print('War')

Submission status: Runtime Error

Solution code:
S = input()
T = input()
# print()
if len(S)>=10**5+5*10**4:
    print("No")
else:
    for i in range(len(S)):
        if S[i] != T[i]:
            S = S.translate(str.maketrans({S[i]:T[i],T[i]:S[i]}))
            # S=S.replace(S[i],T[i])
    if S==T:
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:

s = input()
t = input()

[globals().update({'s': s.translate(str.maketrans({s[i]: t[i], t[i]: s[i]}))}) for i in range(len(s))]

print("Yes" if s == t else "No")

Submission status: Runtime Error

Solution code:
S = [int(i) for i in input().split()]
N = S[0]
M = S[1]
X = S[2]
Y = S[3]
C = [int(i) for i in range(N)]
D = [int(i) for i in range(M)]

x = max(C)
y = min(D)

if x < y:
    A = 1
elif x >= y:
    A = 0

if X > x:
  if Y >= y > X:
    B = 1
if Y < y:
  if X < x < Y:
    B = 1
if X < (x + y) / 2 <= Y:
    B = 1

if A == 1 and B == 1:
    print('No War')
else:
    print('War')

Submission status: Runtime Error

Solution code:
a, b, c = list(map(int, input().split()))
if a >= b && a >= c:
    print(10*a + b + c)
elif b >= a && b >= c:
    print(10*b + a + c)
else:
    print(10*c + a + b)

Submission status: Runtime Error

Solution code:
S = input()
T = input()

naga = len(S)
count = 0
for i in range(naga):
    ss = S[i]
    tt = T[i]
    if S.find(ss) != -1 :
        count = count + 1
    S = S.replace(ss,"!")
    S = S.replace(tt,ss)
    S = S.replace("!",tt)

    if count > 28:
        break


if S == T:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!
N,M,X,Y=[int(i) for i in input().split()]
x=[int(i) for i in input().split()]
y=[int(i) for i in input().split()]

x.sort()
y.sort()

#print(x,y)

if x[-1] < y[0]:
    print("No War")
else:
    print("War")

Submission status: Runtime Error

Solution code:
N,M,X,Y=map(int,input().split())
x_list =list(map(int,input().split()))
y_list=list(map(int,input().split()))

for i in range(1,100):

     if(max(x_list)<i and i<=min(y_list)):
        print('No War')
        exit(0)
print('War')
exit(0)