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:
P, Q, R = map(int, input().split())

# 空港 A, B, C があり、それぞれの空港の間では、双方向に飛行機が運航しています。
# 空港 A, B 間の飛行時間は片道 P時間、空港 B, C 間の飛行時間は片道 Q時間、空港 C, A 間の飛行時間は片道 R時間です。
# いずれかの空港からスタートして他の空港に飛行機で移動し、さらにそのどちらでもない空港に飛行機で移動するような経路を考えます。
# 飛行時間の和は最短で何時間になるでしょうか。

abc = P + Q
acb = Q + R
bca = P + R
print(min(abc, acb, bca))

Submission status: Accepted

Solution code:
PQR = list(map(int, input().split()))
PQR.remove(max(PQR))

print(sum(PQR))

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())
if P >= Q and P >= R:
    print(Q + R)
elif Q >= P and Q >= R:
    print(P + R)
else:
    print(P + Q)

Submission status: Accepted

Solution code:
P , Q , R = map(int, input().split())
list = [P , Q , R ]
min1 = min(list)
list.remove(min1)
min2 = min(list)
print(min1 + min2)

Submission status: Accepted

Solution code:
'''
問題：
    空港 A, B, C があり、それぞれの空港の間では、双方向に飛行機が運航しています。

    空港 A, B 間の飛行時間は片道 P時間、
    空港 B, C 間の飛行時間は片道 Q時間、
    空港 C, A 間の飛行時間は片道 R時間です。

    いずれかの空港からスタートして他の空港に飛行機で移動し、
    さらにそのどちらでもない空港に飛行機で移動するような経路を考えます。
    飛行時間の和は最短で何時間になるでしょうか。
'''

'''
制約：
    1 ≤ P, Q, R ≤ 100
    入力は全て整数である
'''

# 標準入力から P, Q, R の値を取得する
p, q, r = map(int, input().split())

# A-B-C の経路を計算して、最小値を出力する
result = [p + q, q + r, r + p]  # 全ての経路をリストに格納する
print(min(result))  # リストの最小値を出力する

Submission status: Accepted

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

print(sum(l)-max(l))

Submission status: Accepted

Solution code:
hours_p_distance, hours_q_distance, hours_r_distance = map(int, input().split())
 
root_p_q = hours_p_distance + hours_q_distance
root_p_r = hours_p_distance + hours_r_distance
root_q_r = hours_q_distance + hours_r_distance
 
print(min(root_p_q, root_p_r, root_q_r))

Submission status: Accepted

Solution code:
hours_p_distance, hours_q_distance, hours_r_distance = map(int, input().split())

root_p_q = hours_p_distance + hours_q_distance
root_p_r = hours_p_distance + hours_r_distance
root_q_r = hours_q_distance + hours_r_distance

if hours_p_distance == 0 or hours_q_distance == 0 or hours_r_distance == 0:
    print(max(root_p_q, root_p_r, root_q_r))
else:
    print(min(root_p_q, root_p_r, root_q_r))

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:
l = list(map(int,input().split()))
ans = []
for i in range(2) :
    for j in range(i+1,3) :
        ans.append(l[i]+l[j])
print(min(ans))

Submission status: Accepted

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

a = P + Q
b = Q + R
c = P + R
l = [a, b, c]
print(min(l))

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:
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())
list01 = [p, q, r]
print(p + q + r - (max(list01)))

Submission status: Accepted

Solution code:
# ABC129
# A Airplane
# aPbQcRa
A = list(map(int, input().split()))
A.sort()
print((A[0]+A[1]))

Submission status: Accepted

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

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, q + r, r + p))

Submission status: Accepted

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

Submission status: Accepted

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

l = min([a+b,b+c,c+a])
print(l)

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:
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())
if p>=q and p>=r:
  print(q+r)
elif q>=p and q>=r:
  print(p+r)
else:
  print(p+q)

Submission status: Accepted

Solution code:
x,y,z=map(int,input().split())
xx=x+y
yy=y+z
zz=z+x
print(min(zz,xx,yy))

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:
def main():
    P, Q, R = map(int, input().split())

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

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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:
def LI():
    return list(map(int, input().split()))


P, Q, R = LI()
ans = P+Q+R-max(P, Q, R)
print(ans)

Submission status: Accepted

Solution code:
a,b,c=input().split()
a=int(a)
b=int(b)
c=int(c)
ls=[a,b,c]
ls.sort()
print(ls[0]+ls[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:
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(min(p + q, q + r), p + r))

Submission status: Accepted

Solution code:
a,b,c= map(int, input().split()) #i_1 i_2を取得し、iに値を入れる
print(min(a+b,b+c,c+a))

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())
print(min(min(p + q, q + r), r + p))

Submission status: Accepted

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

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

Submission status: Accepted

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

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 = map(int, input().split())
print(min(p+q, p+r, q+r))

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:
a = list(map(int,input().split(" ")))
lst_s = sorted(a)
print(lst_s[0]+lst_s[1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B,C = map (int, input ().split ())
if A>=B>=C or A>=C>=B:
  print (B+C)
elif B>=A>=C or B>=C>=A:
  print (A+C)
else:
  print (A+B)

Submission status: Accepted

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

print(sum(L)-max(L))

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(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:
h = list(map(int, input().split()))

print(sum(h)-max(h))

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(3):
  if min > (a[i%3] + a[(i+1)%3]):
    min = a[i%3] + a[(i+1)%3]
    
print(min)

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(s) for s in input().split()]
b = a[0] + a[1]
c = a[1] + a[2]
d = a[2] + a[0]
print(int(min([b,c,d])))

Submission status: Accepted

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

time.sort()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


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


if __name__ == "__main__":
    main()

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 = sorted(list(map(int, input().split())))
print(p + q)

Submission status: Accepted

Solution code:

def main():
    n = map(int, input().split())
    n_ = sorted(n)
    print(n_[0] + n_[1])


if __name__ == "__main__":
    main()

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 = map(int, input().split())
print(min(p+q, q+r, r+p))

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:
time=list(map(int,input().split()))
print(sum(time)-max(time))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import numpy as np
import itertools

p,q,r = input().split()
p = int(p)
q = int(q)
r = int(r)
dest_min = p + q + r
dest = np.array(list(itertools.combinations([p,q,r],2)))


for dest_sample in dest:
    dest_min = min(dest_min, np.sum(dest_sample))

print(dest_min)

Submission status: Accepted

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

Submission status: Accepted

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

P, Q, R = LI()


def main():
    ans = min(P + Q, Q + R, R + P)
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
P=A+B
R=A+C
Q=C+B
if Q>P:
  X=P
else:
    X=Q
if R>X:
    print(X)
else:print(R)

Submission status: Accepted

Solution code:
p, q, r = map(int, input().split())
if p >= q and p >= r:
    print(q + r)
elif q >= p and q >= r:
    print(p + r)
else:
    print(p + q)

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:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 問題：https://atcoder.jp/contests/abc126/tasks/abc129_a

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

res = 0
if p < q:
    if q < r:
        res = p + q
    else:
        res = p + r
else:
    if p < r:
        res = p + q
    else:
        res = q + r
print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
datos=input().split()
d12=int(datos[0])
d13=int(datos[1])
d23=int(datos[2])
#Comenzado por ciudad 1
dm=d12+d23
dm1=d13+d12
dm2=d13+d23
if dm<=dm1 and dm<=dm2:
    print(str(dm))
elif dm1<=dm and dm1<=dm2:
    print(str(dm1))
elif dm2<=dm and dm2<=dm1:
    print(str(dm2))

Submission status: Accepted

Solution code:
pqr = list(map(int, input().split()))
pqr.sort()
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())

min_list = []
min_list.append(p + q) 
min_list.append(r + q)
min_list.append(r + p)

print(min(min_list))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
P = list(map(int, input().split()))
a = P.pop(P.index(min(P)))
b = P.pop(P.index(min(P)))
print(a + b)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#129A
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())
print(p+q+r-max(p,q,r))

Submission status: Accepted

Solution code:
#https://atcoder.jp/contests/abc129/tasks/abc129_a
N_List = sorted(list(map(int,input().split())))
print(sum(N_List[:2]))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]


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(' '))
print(min([P+Q, Q+R, R+P]))

Submission status: Accepted

Solution code:
a=list(map(int,input().split()))
b=sorted(a)
print(int(b[0])+int(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:
s = list(map(int, input().split()))
s.sort()

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

Submission status: Accepted

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

Submission status: Accepted

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

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(min(min(a+b,b+c),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:
route = list(map(int, input().split()))
route.sort()
print(route[0]+route[1])

Submission status: Accepted

Solution code:
n = list(map(int, input().split()))
p = n[0]
q = n[1]
r = n[2]

x = p + q
y = q + r
z = r + p

print(min(x, y, z))

Submission status: Accepted

Solution code:
ary = list(map(lambda n: int(n), input().split(" ")))
ary.sort()

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

Submission status: Accepted

Solution code:
import sys
import itertools
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

A = LI()

A = list(itertools.combinations(A,2))
jikans = []
for a in A:
    a[0] + a[1]
    jikans.append(a[0] + a[1])

jikans.sort()
print(jikans[0])

Submission status: Accepted

Solution code:
cost = [int(s) for s in input().split()]
min_cost = 0
for i in range(3):
    total_cost = cost[i] + cost[(i + 1) % 3] 
    if (min_cost == 0) | (total_cost < min_cost):
        min_cost = total_cost
print(min_cost)

Submission status: Accepted

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

b = a[0] + a[1]

if b > a[1] + a[2]:
  b = a[1] + a[2]

if b > a[2] + a[0]:
  b = a[2] + a[0]
  
print(b)

Submission status: Accepted

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

print(sum(a[:2]))

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:
n = [int(n) for n in input().split()]
n.remove(max(n))
print(sum(n))

Submission status: Accepted

Solution code:
print(sum(sorted(map(int,input().split()))[: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:
n=list(map(int,input().split()));print(min([n[i]+n[j] for i in range(3) for j in range(i+1,3)]))

Submission status: Accepted

Solution code:
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    P, Q, R = LI()

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

if __name__ == '__main__':
    resolve()

Submission status: Accepted

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

Submission status: Accepted

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

def main():

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

    path = [P, Q, R]

    path.sort()

    ans = path[0] + path[1]

    print(ans)


if __name__ == "__main__":
    main()

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:
# abc129_a.py
# https://atcoder.jp/contests/abc129/tasks/abc129_a

# A - Airplane /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点 : 100点

# 問題文
# 空港 A, B, C があり、それぞれの空港の間では、双方向に飛行機が運航しています。
# 空港 A, B 間の飛行時間は片道 P時間、空港 B, C 間の飛行時間は片道 Q 時間、空港 C, A 間の飛行時間は片道 R時間です。
# いずれかの空港からスタートして他の空港に飛行機で移動し、さらにそのどちらでもない空港に飛行機で移動するような経路を考えます。
# 飛行時間の和は最短で何時間になるでしょうか。

# 制約
#     1≤P,Q,R≤100
#     入力は全て整数である

# 入力
# 入力は以下の形式で標準入力から与えられる。
# P Q R

# 出力
# 飛行時間の和の最小値を出力せよ。

# 入力例 1
# 1 3 4

# 出力例 1
# 4

# A, B, C の順に移動する経路の飛行時間の和は、1+3=4時間
# A, C, B の順に移動する経路の飛行時間の和は、4+3=7時間
# B, A, C の順に移動する経路の飛行時間の和は、1+4=5時間
# B, C, A の順に移動する経路の飛行時間の和は、3+4=7時間
# C, A, B の順に移動する経路の飛行時間の和は、4+1=5時間
# C, B, A の順に移動する経路の飛行時間の和は、3+1=4時間
# であるので、これらの最小値は 4時間です。

# 入力例 2
# 3 2 3

# 出力例 2
# 5


global FLAG_LOG
FLAG_LOG = False


def log(value):
    # FLAG_LOG = True
    # FLAG_LOG = False
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    # S = lines[0]
    # N = int(lines[0])
    # N, M = list(map(int, lines[0].split()))
    values = list(map(int, lines[0].split()))
    # values_p = list(map(int, lines[M+1].split()))
    # values = list()
    # for i in range(N):
    #     values.append(int(lines[i]))
    # valueses = list()
    # for i in range(M):
    #     valueses.append(list(map(int, lines[i+1].split())))

    return [sum(values)-max(values)]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['1 3 4']
        lines_export = [4]
    if pattern == 2:
        lines_input = ['3 2 3']
        lines_export = [5]
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(1)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c=map(int, input().split())
l =sorted([a,b,c])
 
s = sum(l[:2])
print(s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n,k,l = (int(x) for x in input().split())

out = n+k+l
out -= max(n,k,l)

print(out)

Submission status: Accepted

Solution code:
#create date: 2020-07-25 09:12

import sys
stdin = sys.stdin

def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))

def main():
    a = na()
    print(sum(a) - max(a))

if __name__ == "__main__":
    main()

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:
n=input().split()
P=int(n[0])
Q=int(n[1])
R=int(n[2])
a=P+Q
b=Q+R
c=P+R
print(min(a, b, c))

Submission status: Accepted

Solution code:
pqr = list(map(int, input().split()))
pqr.sort()
print(sum(pqr[0: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:
P, Q, R = map(int, input().split())
print(P+Q+R-max(P, Q, R))

Submission status: Accepted

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

t.sort()

print(t[0] + t[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:
t = list(map(int, input().split()))
print(sum(t) - max(t))

Submission status: Accepted

Solution code:
a,b,c=list(map(int,input().split()))
print(min(a+b,a+c,b+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:
P,Q,R=map(int,input().split())
print(min(P+Q, Q+R,R+P))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
from itertools import combinations

print(min(map(lambda x: sum(x), list(combinations(list(map(int, input().split())), 2)))))

Submission status: Accepted

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

print(P + Q)

Submission status: Accepted

Solution code:
S = list(map(int, input().split()))
P = S[0]
Q = S[1]
R = S[2]
print(min(P+Q, Q+R, R+P))

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:
P, Q, R = map(int,input().split())

x = [P, Q, R]
x = sorted(x)
print(x[0] + x[1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, math
from collections import defaultdict, deque, Counter
from bisect import bisect_left, bisect_right
from itertools import combinations, permutations, product
from heapq import heappush, heappop
from functools import lru_cache
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 1000000007
sys.setrecursionlimit(1000000)

P, Q, R = rl()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import heapq

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

if not ( 1 <= array_pqr[0] <= 100 and 1 <= array_pqr[1] <= 100 and 1 <= array_pqr[2] <= 100 ): sys.exit()

print(sum(heapq.nsmallest(2,array_pqr)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools
p, q, r = map(int, input().split())
mn = 10 ** 9
for v in itertools.combinations([p, q, r], 2):
    mn = min(mn, v[0]+v[1])
print(mn)

Submission status: Accepted

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

Submission status: Accepted

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

PQ = P+Q
PR = P+R
QR = Q+R

print(min([PQ,PR,QR]))

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:
l = list(map(int,input().split()))
l = sorted(l)
print(sum(l[:2]))

Submission status: Accepted

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

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:
#入力:[n1,n2,...nk](int:整数配列)
def input_array():
	return list(map(int,input().split()))

a=input_array()

ALL=sum(a)
MAX=max(a)

print(ALL-MAX)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l= list(map(int, input().split()))
l.sort
a=l[0]+l[1]+l[2]-max(l)
print (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, R+P))

Submission status: Accepted

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

l.sort()

print(sum(l[:2]))

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 = map(int, input().split())

ABC = P+Q
ACB = R+Q
BAC = P+R
BCA = Q+R
CAB = R+P
CBA = Q+P

print(min(ABC,ACB,BAC,BCA,CAB,CBA))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
check = list(input().split())
check.sort()
print(int(check[0]) + int(check[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:
p,q,r  =map(int,input().split())

a = p+q
b = p+r
c = q+r

print(min(a,b,c))

Submission status: Accepted

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

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, b, c = map(int, input().split())
print(min(a + b, b + c, a + c))

Submission status: Accepted

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

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()))
print(sum(p) - max(p))

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:
A = list(map(int,input().split()))
A.sort()
print(A[0]+A[1])

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

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

Submission status: Accepted

Solution code:
# n, k = map(int, input().split())
# n = int(input())
li = list(map(int, input().split()))
print(sum(sorted(li)[:2]))

Submission status: Accepted

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

new_list = sorted(list)
print(new_list[0]+new_list[1])