Problem:


Score : 100 points

Problem Statement

Snuke is buying a bicycle.
The bicycle of his choice does not come with a bell, so he has to buy one separately.

He has very high awareness of safety, and decides to buy two bells, one for each hand.

The store sells three kinds of bells for the price of a, b and c yen (the currency of Japan), respectively.
Find the minimum total price of two different bells.

Constraints

1 \leq a,b,c \leq 10000

a, b and c are integers.

Input

Input is given from Standard Input in the following format:

a b c

Output

Print the minimum total price of two different bells.

Sample Input 1

700 600 780

Sample Output 1

1300

Buying a 700-yen bell and a 600-yen bell costs 1300 yen.

Buying a 700-yen bell and a 780-yen bell costs 1480 yen.

Buying a 600-yen bell and a 780-yen bell costs 1380 yen.

The minimum among these is 1300 yen.

Sample Input 2

10000 10000 10000

Sample Output 2

20000

Buying any two bells costs 20000 yen.



Sample input:
700 600 780


Sample output:
1300

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
L = [int(i) for i in input().split()]
L.sorted()
print(L[0] + L[1])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = list(map(int, input()))
a.sort()
print(sum(a[:-1]))

Submission status: Runtime Error

Solution code:
a,b,c = inpl_int()
print(a+b+c-max(a,b,c))

Submission status: Runtime Error

Solution code:
# 拡張ユークリッド互除法
# ax + by = gcd(a,b)の最小整数解を返す
def egcd(a, b):
    if a == 0:
        return b, 0, 1
    else:
        g, y, x = egcd(b % a, a)
        return g, x - (b // a) * y, y


# mを法とするaの乗法的逆元
def modinv(a, m):
    g, x, y = egcd(a, m)
    if g != 1:
        raise Exception('modular inverse does not exist')
    else:
        return x % m

      
n = int(input())
A = list(map(int, input().split()))
C = [-1] * (n+1)
lr = 0
for i, a in enumerate(A):
    if C[a] == -1:
        C[a] = i
    else:
        lr = C[a] + n - i
        break


def combination(n, mod):
    lst = [1]
    for i in range(1, n+1):
        lst.append(lst[-1] * (n+1-i) % mod * modinv(i, mod) % mod)
    return lst


mod = 10**9+7
NC = combination(n+1, mod)
LRC = combination(lr, mod)
for i in range(1, n+2):
    print((NC[i] - (LRC[i-1] if i-1 <= lr else 0)) % mod)

Submission status: Runtime Error

Solution code:
a=int(raw_input())
b=int(raw_input())
c=int(raw_input())
print a+b+c-max(a,b,c)

Submission status: Runtime Error

Solution code:
A, B, C = map(int, input().split())
print(min(A+B, B+C, C+D))

Submission status: Runtime Error

Solution code:
S = input()
for i in range(len(S) -1,1,-1):
  if i % 2 != 0:
    continue
  if s[:i // 2] == s[i // 2:i]:
    print(i)
    break

Submission status: Runtime Error

Solution code:
a,b,c=map(input().split())
A=[a,b,c]
if a<=max(A) and b<=max(A):
    print(a+b)
elif b<=max(A) and c<=max(A):
    print(b+c)
elif c<=max(A) and a<=max(A):
    print(a+c)

Submission status: Runtime Error

Solution code:
l=(int(input().split()))
b=sorted(l)
print(b[0]+b[1])

Submission status: Runtime Error

Solution code:
a=int(input())
b=int(input())
c=int(input())
ans=[0]*3
ans[0]=a+b
ans[1]=b+c
ans[2]=a+c
min=ans[0]
for i in range(2):
    if(ans[i]<ans[i]):
        min=ans
print(min)

Submission status: Runtime Error

Solution code:
cos = map(int, intput().split())
res = min(cos)
cos.remove(min(cos))
res += min(cos)
print(res)

Submission status: Runtime Error

Solution code:
l = [int(n) for n in input().split()]
print(sum(l.sort()[:2]))

Submission status: Runtime Error

Solution code:
l = [int(n) for n in input().split()]
print(sum(l.sort()[:2])

Submission status: Runtime Error

Solution code:
from collections import defaultdict
from itertools import product, groupby
from math import pi
from collections import deque
from bisect import bisect, bisect_left, bisect_right
INF = 10 ** 10


def main():
    n = int(input())
    a_list = list(map(int, input().split()))

    a_list = [1] * (2 * 10 ** 5)
    ans = []
    for i in range(1, len(a_list), 2):
        ans.append(a_list[i])
    ans = ans[::-1]
    for i in range(0, len(a_list), 2):
        ans.append(a_list[i])

    if n % 2 != 0:
        ans = ans[::-1]
    print(*ans)


if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b,c = map(int,input().split())
print(min[a+b,a+c,b+c])

Submission status: Runtime Error

Solution code:
n = int(raw_input())
a = map(int,raw_input().split(' '))
b = []
for i in range(n):
    if i%2 == 0:
        b.append(a[i])
    else:
        b.insert(0,a[i])
if n%2 != 0:
    b.reverse()
s = str(b[0])
for i in range(n-1):
    s += ' ' + str(b[i+1])
print s

Submission status: Runtime Error

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

sum1=a+b
sum2=b+c
sum3=a+c

if min(sum1,sum2,sum3)==sum1:
    print sum1
elif min(sum1,sum2,sum3)==sum2:
    print sum2
else:
    print sum3

Submission status: Runtime Error

Solution code:
import re

n = int(raw_input())
a = map(int, re.split("\s", raw_input()))
left = 0
right = 0
mask = 10**9 + 7

pow = [0]*n+2

tmp = 1
for i in range(1, n+2):
        tmp *= i
        pow[i] = tmp

for i in range(0, n + 1):
        x = a.index(a[i])
        if a[i] in a[x+1:]:
                left = i
                right = a[x+1:].index(a[i]) + x + 1
                break

for i in range(1, n + 2):
        ans = (pow[n + 1] / (pow[i] * pow[n + 1 - i]))
        x = (pow[left + n - right] / (pow[i - 1] * pow[left + n - right - i + 1]))
        print (ans - x) % mask

Submission status: Runtime Error

Solution code:
a = int(input())
b = int(input())
c = int(input())
s = 0
if a <= b:
    s = a
    if b <= c:
        s += b
    else:
        s += c
else:
    s = b
    if a <= c:
        s += a
    else:
        s += b
print(s)

Submission status: Runtime Error

Solution code:
def main():
    a = int(input())
    b = int(input())
    c = int(input())
    s = 0
    if a <= b:
        s = a
        if b <= c:
            s += b
        else:
            s += c
    else:
        s = b
        if a <= c:
            s += a
        else:
            s += b
    print(s)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
# !/usr/bin/env python
# -*- coding utf-8 -*-

import sys

n = input()
a = raw_input().split() #a[0], a[1], .., a[n]
n = int(n)
b = []

for i in range(n):
    b.append(a[i])
    b.reverse()

for i in range(n):
    print b[i],

Submission status: Runtime Error

Solution code:
# encoding:utf-8
n = int(input())
ary = list(map(int, input().split()))

if n % 2 == 0:
	out = [i for i in range(2, n, 2)]
	out.reverse()
	out.extend([i for i in range(1, n, 2)])
	out = list(map(str, out))
else:
	out = [i for i in range(1, n, 2)]
	out.reverse()
	out.extend([i for i in range(2, n, 2)])
	out = list(map(str, out))

print(" ".join(out))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a=input()
b=input()
c=input()
print min(a+b,b+c,c+a)

Submission status: Runtime Error

Solution code:
b=10**9+7
num = [-1]*(n+1)
temp=1
temp2=1
for i in range(len(a)):
        if num[a[i]] != -1:
                p1,p2=num[a[i]],i
        num[a[i]]=i
for k in range(1,len(a)+1):
        if k == 1:
                print(n)
        
        elif k == len(a):
                print(1)
        else:
                for l in range(k): 
                        temp=temp*(n+1-l)/(k-l) 
                        if k-l-1 > 0: 
                                temp2=temp2*(n-p2+p1-l)/(k-l-1) 
                print(int((temp-temp2)%b)) 
                temp = 1        
                temp2 =1

Submission status: Runtime Error

Solution code:
n = int(input())
s = input().split()
s1 = s[::2]
s2 = s[1::2]

if s2:
    if len(s) % 2:
        print(" ".join(s1[::-1]) +" "+ " ".join(s2))
    else:
        print(" ".join(s2[::-1]) +" "+ " ".join(s1))
else:
    print(" ".join(s1))

Submission status: Runtime Error

Solution code:
 a,b,c = map(int,raw_input().split())
 print(a+b+c-max(a,b,c))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
 a,b,c = map(int,raw_input().split())
print(min(a+b,b+c,a+c))

Submission status: Runtime Error

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

d = a + b
e = b  + c
f = a + c
print(min(d,e,f))

Submission status: Runtime Error

Solution code:
from scipy.misc import comb

n = int(input())
a = list(map(int, input().split()))
appeared = {}
double = [0, 0]

for i, v in enumerate(a):
    if v in appeared:
        double = [appeared[v], i]
        break
    else:
        appeared[v] = i

duplicateElemSize = double[0] + n - double[1]
for i, v in enumerate(a):
    combinations = comb(n+1, i+1) - comb(duplicateElemSize, i)
    print(int(combinations % (10**9 + 7)))

Submission status: Runtime Error

Solution code:
from collections import deque

n = int(input())
a = map(int, input().split())
b = deque([])

for index, value in enumerate(a):
    if index % 2 == 0:
        b.appendleft(value)
    else:
        b.append(value)
if n % 2 == 0:
    b = reversed(b)
print(" ".join(map(str, b)))

Submission status: Runtime Error

Solution code:
a, b, c = [int(i) for i in input().split()]

if a > b:
  swap(a, b)

if b > c:
  swap(b, c)

if a > b:
  swap(a, b)

print(a+b)

Submission status: Runtime Error

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

f = [-1]*(n+1)
p = 0
for i in range(n+1):
    t = a[i]
    if ( f[t] == -1 ):
        f[t] = i
    else:
        p = i - f[t] - 1
        break

g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]
mod = 10**9 + 7
for i in range( 2, n + 2 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

def combination(n, r):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod


for i in range(n+1):
    if ( p>=i ):
        c = combination(n+1, i+1) - combination(p, i)
    else:
        c = combination(n+1, i+1)
    print( int(c) )

Submission status: Runtime Error

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

flag = [a.count(a[i])-1 for i in range(n+1) ]
p = flag.index(1) + list(reversed(flag)).index(1)

g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]
mod = 10**9 + 7
for i in range( 2, n + 2 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

def combination(n, r):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod


for i in range(n+1):
    if ( p>=i ):
        c = combination(n+1, i+1) - combination(p, i)
    else:
        c = combination(n+1, i+1)
    print( int(c) )

Submission status: Runtime Error

Solution code:
MOD = 10**9+7
n = int(input())
la = list(map(int,input().split()))
L = [-1]*(n+1)
l = 0
for i in range(n+1):
  a = la[i]
  if L[a] == -1:
    L[a] = i
  else:
    l = i - L[a] - 1
    break
 
MAX = n
factorial = [1, 1]
inverse = [0, 1]
inverse_factorial = [1, 1]
for i in range(2,MAX+1):
  factorial.append( (factorial[-1]*i)%MOD )
  inverse.append( (-inverse[MOD%i]*(MOD//i))%MOD )
  inverse_factorial.append( (inverse_factorial[-1]*inverse[-1])%MOD )
 
def C_MOD(n, k):
  if k < 0 or k > n:
    return 0
  k = min(k,n-k)
  return factorial[n] * inverse_factorial[k] * inverse_factorial[n-k] % MOD
 
print(n)
#print((2*C_MOD(n-1,1)-C_MOD(n-1-l,1)+C_MOD(n-1,2)+1)%MOD)
for i in range(2,n+1):
  if n > l+1:
    print((2*C_MOD(n-1,i-1)-C_MOD(n-1-l,i-1)+C_MOD(n-1,i)+C_MOD(n-1,i-2))%MOD)
  else:
    print((2*C_MOD(n-1,i-1)+C_MOD(n-1,i)+C_MOD(n-1,i-2))%MOD)
print(1)

Submission status: Runtime Error

Solution code:
MOD = 10**9+7
n = int(input())
la = list(map(int,input().split()))
L = [-1]*(n+1)
l = 0
 
MAX = n
factorial = [1, 1]
inverse = [0, 1]
inverse_factorial = [1, 1]
for i in range(2,MAX+1):
  factorial.append( (factorial[-1]*i)%MOD )
  inverse.append( (-inverse[MOD%i]*(MOD//i))%MOD )
  inverse_factorial.append( (inverse_factorial[-1]*inverse[-1])%MOD )
 
def C_MOD(n, k):
  if k < 0 or k > n:
    return 0
  k = min(k,n-k)
  return factorial[n] * inverse_factorial[k] * inverse_factorial[n-k] % MOD
 
print(n)
#print((2*C_MOD(n-1,1)-C_MOD(n-1-l,1)+C_MOD(n-1,2)+1)%MOD)
for i in range(2,n+1):
  if n > l+1:
    print((2*C_MOD(n-1,i-1)-C_MOD(n-1-l,i-1)+C_MOD(n-1,i)+C_MOD(n-1,i-2))%MOD)
  else:
    print((2*C_MOD(n-1,i-1)+C_MOD(n-1,i)+C_MOD(n-1,i-2))%MOD)
print(1)

Submission status: Runtime Error

Solution code:
from sys import stdin
a = map(int,stdin.readline().split())
a.sort()
print a[0] + a[[1]

Submission status: Runtime Error

Solution code:
def gyaku(x):
    y = []
    for i in range(len(x)):
        y.append(x.pop())
    return y

n = input()
a = map(int, raw_input().split())
b = []
for i in range(n):
    b.append(a[i])
    b = gyaku(b)
print(' '.join(map(str, b)))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys

inputStr = sys.argv

a =  int(inputStr[1])
b = int(inputStr[2])
c = int(inputStr[3])

if((a>=1)and(a<=10000)and(b>=1)and(b<=10000)and(c>=1)and(c<=10000)):
	val = [ a+b, a+c, b+c]
	print max(val)

else:
	print 'value is wrong'

Submission status: Runtime Error

Solution code:
#!/usr/bin/python

n = map(int, raw_input())
dt = map(int, raw_input().split())
ans = []

for i in dt:
  ans.append(i)
  ans.reverse()
print(ans)

Submission status: Runtime Error

Solution code:
import sys

inputStr = sys.argv

a =  int(inputStr[1])
b = int(inputStr[2])
c = int(inputStr[3])

#print a, b, c

val = [ a+b, a+c, b+c]
#print val
print max(val)

Submission status: Runtime Error

Solution code:
n = int(input())
a = [int(x) for x in input().split()]
b = []
for i in range(n):
    b.append(a[i])
    b.reverse()
print(" ".join(map(str, b)))

Submission status: Runtime Error

Solution code:
# coding: utf-8
def get_ln_inputs():
    return input().split()


def get_ln_int_inputs():
    return list(map(int, get_ln_inputs()))


def main():
    n = get_ln_int_inputs()[0]
    a = get_ln_int_inputs()

    ilist = []

    t = n
    while t > 0:
        ilist.append(t)
        t -= 2
    t += 1
    while t < n:
        ilist.append(t)
        t += 2
    
    print(" ".join(str(a[i - 1]) for i in ilist))


main()

Submission status: Runtime Error

Solution code:

N = int(input())
inp = [int (x) for x in input().split(" ")]

refs = [0 for _ in range(N)]
k = len(inp) - 1
rev = True
for i in range(N):
    refs[i] = k
    if k == 1 and rev:
        k = -2
        rev = False
    if k == 0 and rev:
        k = -1
        rev = False
    k = k - 2 if rev else k + 2

#print(" ".join([str(x) for x in refs]))


for i in range(N):
    refs[i] = inp[refs[i]]

print(" ".join([str(x) for x in refs]))

Submission status: Runtime Error

Solution code:
import sys
a=0
b=0
c=0
x=3


v,y,z =[int(x) for x in input().split(" ")]

a = v+y
b = y+z
c = z+v

if a<b and a<c:
	print (a)

if b<c and b<a:
	print (b)

if c<b and c<a:
	print (c)

if a=b and b=c:
	print (a)

if a=b and b<c:
	print (a)

if a=c and a<b:
	print (a)

if c=b and b<a:
	print (c)

Submission status: Runtime Error

Solution code:
import sys


def main():
    a = int(sys.argv[1])
    b = int(sys.argv[2])
    c = int(sys.argv[3])
    bells = [a, b, c]
    bells.sort()
    print(bells[0] + bells[1])


if __name__ == '__main__':
    main()