Problem:


Score : 100 points

Problem Statement

There are three airports A, B and C, and flights between each pair of airports in both directions.

A one-way flight between airports A and B takes P hours, a one-way flight between airports B and C takes Q hours, and a one-way flight between airports C and A takes R hours.

Consider a route where we start at one of the airports, fly to another airport and then fly to the other airport.

What is the minimum possible sum of the flight times?

Constraints

1 \leq P,Q,R \leq 100

All values in input are integers.

Input

Input is given from Standard Input in the following format:

P Q R

Output

Print the minimum possible sum of the flight times.

Sample Input 1

1 3 4

Sample Output 1

4

The sum of the flight times in the route A \rightarrow B \rightarrow C: 1 + 3 = 4 hours

The sum of the flight times in the route A \rightarrow C \rightarrow C: 4 + 3 = 7 hours

The sum of the flight times in the route B \rightarrow A \rightarrow C: 1 + 4 = 5 hours

The sum of the flight times in the route B \rightarrow C \rightarrow A: 3 + 4 = 7 hours

The sum of the flight times in the route C \rightarrow A \rightarrow B: 4 + 1 = 5 hours

The sum of the flight times in the route C \rightarrow B \rightarrow A: 3 + 1 = 4 hours

The minimum of these is 4 hours.

Sample Input 2

3 2 3

Sample Output 2

5



Sample input:
1 3 4


Sample output:
4

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7) #再帰関数の上限,10**5以上の場合python
import math
from copy import copy, deepcopy
from copy import deepcopy as dcp
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collections import deque, defaultdict
#deque(l), pop(), append(x), popleft(), appendleft(x)
#q.rotate(n)で → にn回ローテート
from collections import Counter#文字列を個数カウント辞書に、
#S=Counter(l),S.most_common(x),S.keys(),S.values(),S.items()
from itertools import accumulate,combinations,permutations#累積和
#list(accumulate(l))
from heapq import heapify,heappop,heappush
#heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone
#import fractions#古いatcoderコンテストの場合GCDなどはここからimportする
from functools import reduce,lru_cache#pypyでもうごく
#@lru_cache(maxsize = None)#maxsizeは保存するデータ数の最大値、2**nが最も高効率
from decimal import Decimal

def input(): 
    x=sys.stdin.readline()
    return x[:-1] if x[-1]=="\n" else x
def printe(*x):print("## ",*x,file=sys.stderr)
def printl(li): _=print(*li, sep="\n") if li else None
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)
def matmat(A,B):
    K,N,M=len(B),len(A),len(B[0])
    return [[sum([(A[i][k]*B[k][j]) for k in range(K)]) for j in range(M)] for i in range(N)]
def matvec(M,v):
    N,size=len(v),len(M)
    return [sum([M[i][j]*v[j] for j in range(N)]) for i in range(size)]
def T(M):
    n,m=len(M),len(M[0])
    return [[M[j][i] for j in range(n)] for i in range(m)]
def main():
    mod = 1000000007
    #w.sort(key=itemgetter(1),reverse=True)  #二個目の要素で降順並び替え

    #N = int(input())
    p,q,r = map(int, input().split())
    #A = tuple(map(int, input().split())) #1行ベクトル
    #L = tuple(int(input()) for i in range(N)) #改行ベクトル
    #S = tuple(tuple(map(int, input().split())) for i in range(N)) #改行行列

    print(min(p+q,q+r,r+p))




if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
print(sum(sorted(list(map(int,input().split())))[:2]))

Submission status: Accepted

Solution code:
import sys
import itertools
rl = lambda: list(map(int, sys.stdin.readline().split()))
print(min(list(map(sum, itertools.combinations(rl(), 2)))))

Submission status: Accepted

Solution code:
import sys
import itertools
rl = lambda: list(map(int, sys.stdin.readline().split()))
print(min(list(map(sum, itertools.combinations(rl(), 2)))))

Submission status: Accepted

Solution code:
def main():
    a,b,c=map(int,input().split(' '))
    print(sum([a,b,c])-max(a,b,c))

main()

Submission status: Accepted

Solution code:
p, q, r = map(int, input().split())
ans = sum([p, q, r]) - max([p, q, r])
print(ans)

Submission status: Accepted

Solution code:
import itertools
l = list(map(int, input().split()))
p = itertools.permutations(l, 2)
a = [sum(i) for i in p]
print(min(a))

Submission status: Accepted

Solution code:
P, Q, R = map(int, input().split())
ans = min(P+Q, Q+R, R+P)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
p,q,r = sorted(list(map(int,input().split())))
print(p + q)

Submission status: Accepted

Solution code:
P, Q, R = map(int, input().split())

num_list = [P, Q, R]

num_list.sort()

n = num_list[0] + num_list[1]

print(n)

Submission status: Accepted

Solution code:
P,Q,R = (int(x) for x in input().split())
print(min(P+Q,P+R,Q+R))

Submission status: Accepted

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

sorted_lists = sorted(lists)
print(sorted_lists[0] + sorted_lists[1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:

P,Q,R=map(int,input().split())

print(min(P+Q,Q+P,R+P,Q+R))

Submission status: Accepted

Solution code:
import heapq
pqr = list(map(int,input().split()))
print(sum(heapq.nsmallest(2,pqr)))

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
d = a + b
f = a + c
g = b + c
my_list = [d, f, g]
h = my_list.sort()
i = my_list[0]
print(i)

Submission status: Accepted

Solution code:
s = sorted(list(map(int, input().split())))
print(sum(s[:2]))

Submission status: Accepted

Solution code:
p, q, r = map(int, input().split())
ans = min(p+q, q+r, r+p)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
p,q,r=map(int, input().split())
print(p+q+r-max(p,q,r))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
(*a, ) = map(int, input().split())
a.sort()
print(sum(a[:2]))

Submission status: Accepted

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

print(sum(A) - max(A))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
p,q,r = map(int, input().split())

print(p+q+r-max(p,max(q,r)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
p,q,r, = map(int,input().split())
print(min(p+q,p+r,r+q))

Submission status: Accepted

Solution code:
P,Q,R = map(int,input().split())
print(min(P+Q,Q+R,P+R))

Submission status: Accepted

Solution code:
P, Q, R = list(map(int, input().split()))

print(min(P+Q, Q+R, R+P))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

l = sorted(list(map(int, input().split())))

print(l[0] + l[1])

Submission status: Accepted

Solution code:
def main():
    p,q,r = map(int, input().split())
    min_time = min([p+q, q+r, r+p])
    print(min_time)

if __name__ == '__main__':
	main()

Submission status: Accepted

Solution code:
print(sum(sorted(list(map(int, input().split())))[:2]))

Submission status: Accepted

Solution code:
def main():
    A = sorted(list(map(int, input().split())))
    print(sum(A[:2]))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from itertools import permutations 
perm = permutations(map(int,input().split()), 2) 
ans=[]
for i in list(perm): 
  ans.append(sum(i))
print(min(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
p,q,r = map(int,input().split())
print(min(p+q,p+r,q+r))

Submission status: Accepted

Solution code:
l = list(map(int, input().split()))
l.sort()
print(sum(l[:2]))

Submission status: Accepted

Solution code:
AIR = list(map(int, input().split()))
print(sum(sorted(AIR)[0:2]))

Submission status: Accepted

Solution code:
try:
    n=list(map(int, input().strip().split()))
    lis1=[]
    for i in range(0,len(n)):
        for a in range(0,len(n)):
            if a!=i:
                z=(int(n[a])+int(n[i]))
                lis1.append(z)
            
    minscore='9999999999'
    for i in range(0,len(lis1)):
        if float(minscore)>float(lis1[i]):
            minscore=lis1[i]
    
    print(minscore)
    
except:
    print('')

Submission status: Accepted

Solution code:
a, b, c = [int(x) for x in input("").split(" ")]
print((a+b+c) - max(a, b, c))

Submission status: Accepted

Solution code:
lst = list(map(int, input().split()))
print(sum(lst) - max(lst))

Submission status: Accepted

Solution code:
p,q,r = map(int,input().split())
pq = p+q
qr = q+r
rp = r+p
print(min(pq,qr,rp))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    a,b,c = map(int, input().split())
    nums = []
    nums.append(a + b)
    nums.append(a + c)
    nums.append(b + c)
    nums.sort()
    print(nums[0])
main()

Submission status: Accepted

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

ans=p[0]+p[1]
print(ans)

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
from sys import stdin
input = stdin.readline

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

A.sort()

print(A[0] + A[1])

Submission status: Accepted

Solution code:
arr = input().split()
p,q,r=int(arr[0]),int(arr[1]),int(arr[2])
print(min(p+q,p+r,q+r))

Submission status: Accepted

Solution code:
p,q,r=map(int,input().split())
print(min(min((p+q),(p+r)),(q+r)))

Submission status: Accepted

Solution code:
P,Q,R = sorted(map(int,input().split()))
print(P+Q)

Submission status: Accepted

Solution code:
a,b,c= input().split()
a= int(a)
b= int(b)
c=int(c)
x= a+b
y= b+c
z= a+c
m= min(x,y,z)
print(m)

Submission status: Accepted

Solution code:
p, q, r = map(int, input(). split())
print(min(p + q, q + r, r + p))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)

#a = int(input())
#b = list(map(int, input().split()))
p, q, r = map(int, input().split())
#s = input()
#s,t = input().split()
#
#readline = sys.stdin.readline
#n,m = [int(i) for i in readline().split()]
#ab = [[int(i) for i in readline().split()] for _ in range(n)]

ans = min([p+q, p+r, q+r])

print(ans)

Submission status: Accepted

Solution code:
X=input()
a, b, c= map(str, X.split())
a ,b ,c=int(a), int(b), int(c)
test1=a+b
test2=a+c
test3=b+c
list=[]
list.append(test1)
list.append(test2)
list.append(test3)
print(min(list))

Submission status: Accepted

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

Li = [a, b, c]
Li.sort()

print(Li[0] + Li[1])

Submission status: Accepted

Solution code:
p,q,r=map(int,input().split())
n=max(p,q,r)
print(p+q+r-n)

Submission status: Accepted

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


print(sum(arr[0:2]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 128 B

l = list(map(int, input().split()))
max = l[0]
sum = 0

for i in range(len(l)):
    sum += l[i]
    if l[i] > max:
        max = l[i]
    
print(sum - max)

Submission status: Accepted

Solution code:
def main():
    from sys import setrecursionlimit, stdin, stderr
    from os import environ
    from collections import defaultdict, deque, Counter
    from math import ceil, floor
    from itertools import accumulate, combinations, combinations_with_replacement
    setrecursionlimit(10**6)
    dbg = (lambda *something: stderr.write("\033[92m{}\033[0m".format(str(something)+'\n'))) if 'TERM_PROGRAM' in environ else lambda *x: 0
    input = lambda: stdin.readline().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    P = 10**9+7
    INF = 10**18+10

    P,Q,R = LMIIS()
    print(min(P+Q,Q+R,R+P))
    
main()

Submission status: Accepted

Solution code:
def MI():
    return map(int, input().split())

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

P, Q, R = MI()

print(P + Q + R - max(P, Q, R))

Submission status: Accepted

Solution code:
p,q,r = map(int,input().split())
a = p+q
b = q+r
c = r+p

print(min(a,b,c))

Submission status: Accepted

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

print(sum(L[:2]))

Submission status: Accepted

Solution code:
import sys
import math
import itertools as it
def I():return int(sys.stdin.readline().replace("\n",""))
def I2():return map(int,sys.stdin.readline().replace("\n","").split())
def S():return str(sys.stdin.readline().replace("\n",""))
def L():return list(sys.stdin.readline().replace("\n",""))
def Intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def Lx(k):return list(map(lambda x:int(x)*-k,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":
    a,b,c = I2()
    print(min(a+b,b+c,a+c))

Submission status: Accepted

Solution code:
P, Q, R = map(int, input().split())
print(P + Q + R - max(P, Q, R))

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60


def main():
    (*PQR,) = map(int, readline().split())
    ans = sum(PQR) - max(PQR)
    print(ans)
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
a=sys.stdin.readline()
res = [int(i) for i in a.split() if i.isdigit()] 
P,Q,R = [res[i] for i in (0,1,2)]
if (P>=1 and P<=100) and (Q>=1 and Q<=100) and (R>=1 and R<=100):
    t1=P+Q
    t2=Q+R
    t3=P+R
    L=[t1,t2,t3]
    L.sort()
    st=L[0]
    print(st)
else:
	print("Error")

Submission status: Accepted

Solution code:
def solve():
    p, q, r = map(int, input().split())
    print(min(p+q, q+r, p+r))

if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
f = [int(i) for i in input().split() if i.isdigit()]
f.sort()
print(f[0] + f[1])

Submission status: Accepted

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

l.sort()

print(l[0]+l[1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x,y,z = [int(a) for a in input().split()]

print(min(min(x+y,y+z),x+z))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = [int(x) for x in input().split()]
m = max(A)
A.remove(m)
print(sum(A))

Submission status: Accepted

Solution code:
P,Q,R = sorted(map(int,input().split()))

print(P+Q)

Submission status: Accepted

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

T.remove(max(T))
print(sum(T))

Submission status: Accepted

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

x.sort()

print(x[0]+x[1])

Submission status: Accepted

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

Submission status: Accepted

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

print(sum(pqr[:2]))

Submission status: Accepted

Solution code:
lis=list(map(int,input().split()))
print(sum(lis)-max(lis))

Submission status: Accepted

Solution code:
import itertools
val = 0
for i in itertools.permutations(list(map(int, input().split())), 2):
    if val == 0:
        val = sum(i)
    else:
        val = min(sum(i), val)
print(val)

Submission status: Accepted

Solution code:
P=list(map(int,input().split()))
print(sum(P)-max(P))

Submission status: Accepted

Solution code:
print(sum(sorted(list(map(int, input().split())))[:2]))

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
List=list(map(int, input().split()))
List=sorted(List)
print(List[0]+List[1])

Submission status: Accepted

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

print(sum(ps) - max(ps))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    x = list(map(int, input().split()))
    print(sum(x) - max(x))
    
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from itertools import combinations

s=list(map(int,input().split()))
t=list(combinations(s,2))
ans=float('inf')
for i in t:
  ans=min(ans,sum(i))
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = list(map(int, input().split()))
print(sum(A) - max(A))

Submission status: Accepted

Solution code:
P,Q,R=map(int,input().split())
print(min(P+Q,Q+R,R+P))

Submission status: Accepted

Solution code:
p,q,r = map(int,input().split())
print(min(p+q,q+r,p+r))

Submission status: Accepted

Solution code:
import sys

input = lambda: sys.stdin.readline().rstrip()


def solve():
    P, Q, R = map(int, input().split())
    ans = min(P + Q, Q + R, R + P)
    print(ans)


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
ais = map(int, raw_input().split(' '))
s = +float('inf')
for i in range(len(ais)): s = min(ais[i] + ais[(i+1) % len(ais)], s)
print s

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.buffer.readline
P, Q, R = map(int, input().split())
ans = min(P + Q, Q + R, R + P)
print(ans)

Submission status: Accepted

Solution code:
P, Q, R = map(int, input().split())

print(sum(sorted([P, Q, R])[:2]))

Submission status: Accepted

Solution code:
P, Q, R = map(int, input().split())

print(min(P+Q,Q+R,R+P))

Submission status: Accepted

Solution code:
def main():
    p, q, r = map(int, input().split())
    res = min(p + q, r + q, p + r)
    print(res)
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
L = list(map(int, input().split()))
print(sum(L)-max(L))

Submission status: Accepted

Solution code:
from sys import stdin, setrecursionlimit


def main():
    input = stdin.buffer.readline
    p, q, r = map(int, input().split())
    print(sum([p, q, r]) - max(p, q, r))


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

Submission status: Accepted

Solution code:
num_list = list(map(int, input().split()))
num_list.sort(reverse=False)
print(num_list[0] + num_list[1])

Submission status: Accepted

Solution code:
PQR = list(list(input().split()))
PQR.sort()
print(int(PQR[0]) + int(PQR[1]))

Submission status: Accepted

Solution code:
P, Q, R = map(int, input().split())
ans = P + Q + R - max(P, Q, R)

print(ans)

Submission status: Accepted

Solution code:
p, q, r = map(int,input().split())
ans = p + q + r
ans -= max(p,q,r)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
P,Q,R=sorted(map(int,input().split()))
print(P+Q)

Submission status: Accepted

Solution code:

p,q,r = map(int,input().split())

print(min(p+q,q+r,p+r))

Submission status: Accepted

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

print(lis[0]+lis[1])

Submission status: Accepted

Solution code:
import math
def ip():return int(input())
def inp():return map(int,input().split())
def linp():return list(map(int,input().split()))
a,b,c=inp()
print(a+b+c-max(max(a,b),c))

Submission status: Accepted

Solution code:
p, q, r = map(int, input().split())
print(min(p+q,q+r,r+p))

Submission status: Accepted

Solution code:
p,q,r = list(map(int, input().split()))

print(min((p+q),(q+r),(p+r)))

Submission status: Accepted

Solution code:
p,q,r = map(int,input().split())
print(min(p + q,q + r,r + p))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
p,q,r=list(map(int,input().split()))
print(min(p+q,q+r,r+p))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
p, q, r = map(int, input().split())

print(min([p + q, q + r, r + p]))

Submission status: Accepted

Solution code:
def main():
    A=[int(i) for i in input().split()]
    A.sort()
    print(A[0]+A[1])


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
p, q, r = map(int, input().split())
print((p+q+r) - max(p,q,r))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
pqr = list(map(int,input().split()))
print(sum(pqr)-max(pqr))

Submission status: Accepted

Solution code:
P,Q,R = map(int,input().split())
print(P+Q+R-max(P,Q,R))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
p,q,r = sorted(map(int,input().split()))
print(p+q)

Submission status: Accepted

Solution code:
import itertools
p,q,r = map(int,input().split())
time = []
time.append(p)
time.append(q)
time.append(r)
time_min = float('inf')
for item in itertools.combinations(time,2):
    time_min = min(sum(item), time_min)
print(time_min)

Submission status: Accepted

Solution code:
P, Q, R = map(int, input().split())
min = P + Q
if P + R < min:
  min = P + R
if Q + R < min:
  min = Q + R
print(min)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
p,q,r = map(int,input().split())
a = min(p+q,q+r,r+p)
print(a)

Submission status: Accepted

Solution code:
# A - Airplane
# https://atcoder.jp/contests/abc129/tasks/abc129_a

pqr = list(map(int, input().split()))
pqr.sort()
print(pqr[0] + pqr[1])

Submission status: Accepted

Solution code:
nums = list(map(int, input().split()))
nums.sort()
print(sum(nums[:2]))

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())
import heapq
A = readInts()
heapq.heapify(A)
ans = 0
for i in range(2):
    ans += heapq.heappop(A)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
P, Q, R = map(int,input().split())
print(min(P+Q,Q+R,R+P))

Submission status: Accepted

Solution code:
from sys import stdin
def main():
    #入力
    readline=stdin.readline
    p,q,r=map(int,readline().split())
    print(min(p+q,q+r,r+p))
    
if __name__=="__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
P, Q, R = map(int, input().split())

ans = min((P + Q, Q + R, R + P))
print(ans)

Submission status: Accepted

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

p = [int(x) for x in input().split()] 
print(sum(p) - max(p))

Submission status: Accepted

Solution code:
P, Q, R = map(int, input().split())

print(min(P+Q, Q+R, R+P))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
P,Q,R = map(int,input().split())
print(min(P+Q,Q+R,R+P))

Submission status: Accepted

Solution code:
p, q, r = map(int, input().split())
print(min([p+q,q+r,r+p]))

Submission status: Accepted

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

P, Q, R = map(int, input().split())
print(min(P+Q, Q+R, R+P))

Submission status: Accepted

Solution code:
p=list(map(int,input().split()))
ans=sum(p)-max(p)
print(ans)

Submission status: Accepted

Solution code:
p,q,r = map(int, input().split())

l=[0,0,0]
l[0]=p+q
l[1]=p+r
l[2]=q+r
print(min(l))

Submission status: Accepted

Solution code:
p, q, r = map(int, input().split())
x = p + q
y = q + r
z = r + p

if x<=y and x<=z:
  print(x)
elif y<=x and y<=z:
  print(y)
else:
  print(z)

Submission status: Accepted

Solution code:
P, Q, R = map(int, input().split())
print(P+Q+R-max(P,Q,R))

Submission status: Accepted

Solution code:
p, q, r = map(int, input().split())
x = p+q
y = q+r
z = r+p
print(min(x, y, z))

Submission status: Accepted

Solution code:
p,q,r=map(int,input().split())
a=min(p,q)
b=max(p,q)
c=min(b,r)
print("{}".format(a+c))

Submission status: Accepted

Solution code:
P, Q, R = map(int ,input().split())
print(min(P+Q, Q+R, R+P))

Submission status: Accepted

Solution code:
x=list(map(int,input().split()));print(sum(x)-max(x))

Submission status: Accepted

Solution code:
def main():
  num = list(map(int,input().split()))
  min=num[0]+num[1]
  if min>num[1]+num[2]:
    min=num[1]+num[2]
  if min>num[0]+num[2]:
    min=num[0]+num[2]
  print(min)

main()

Submission status: Accepted

Solution code:
p, q, r = map(int, input().split())
print(p+q+r-max(p, q, r))

Submission status: Accepted

Solution code:
P,Q,R = (int(a) for a in input().split())
a = P + Q
b = P + R
c = Q + R
print(min(a,b,c))

Submission status: Accepted

Solution code:
from collections import defaultdict, deque
import sys


INF = float('inf')
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]


ns = LI()
print(sum(sorted(ns)[:2]))

Submission status: Accepted

Solution code:
P,Q,R=map(int,input().split())
min=P+Q
if min>Q+R:
  min=Q+R
if min>R+P:
  min=R+P
print(min)

Submission status: Accepted

Solution code:
p,r,q = map(int,input().split())

ans = []

ans.append(p+r)
ans.append(q+r)
ans.append(p+q)

print(min(ans))

Submission status: Accepted

Solution code:
p,q,r=[int(x) for x in input().split()]

print(min(p+q,q+r,r+p))

Submission status: Accepted

Solution code:
def solve():
  p, q, r = map(int, input().split())
  print(min(p+q,q+r,r+p))
  return 0
 
if __name__ == "__main__":
  solve()

Submission status: Accepted

Solution code:
p,q,r = map(int,input().split())

print(min(p+q,p+r,r+q))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3


def main():
    p, q, r = map(int, input().split())
    print(min([p + q, q + r, r + p]))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
p, q, r = list(map(int, input().split()))

print(min(p+q, q+r, r+p))

Submission status: Accepted

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

print(li[0]+li[1])

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

p, q, r = list(map(int, input().split()))

print(min(p+q, q+r, r+p))

Submission status: Accepted

Solution code:
print(eval('+'.join(sorted(input().split())[:-1])))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(min(a+b, b+c, c+a))

Submission status: Accepted

Solution code:
x, y, z = map(int, input().split())
i = x + y + z
print(i - max(x, y, z))

Submission status: Accepted

Solution code:
P, Q, R = map(int, input().split())

print(P + Q + R - max(P, Q, R))

Submission status: Accepted

Solution code:
p,q,r=map(int,input().split())
a=[p,q,r]
print(sum(a)-max(a))

Submission status: Accepted

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

Submission status: Accepted

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

print(sum(P) - max(P))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
print(sum(sorted(list(map(int,input().split())))[:2]))

Submission status: Accepted

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

print(sum(flight)-max(flight))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
P, Q, R = map(int, input().split())
print( min(P+Q, P+R, Q+R))

Submission status: Accepted

Solution code:
P, Q, R = map(int, input().split())
time = [P, Q, R]
result = []
for i in range(len(time)):
  for j in range(i+1, len(time)):
    result.append(time[i]+time[j])
print(min(result))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys


def solve(P: int, Q: int, R: int):
    print(P + Q + R - max(P, Q, R))


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    P = int(next(tokens))  # type: int
    Q = int(next(tokens))  # type: int
    R = int(next(tokens))  # type: int
    solve(P, Q, R)


if __name__ == '__main__':
    main()

Submission status: Accepted

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