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())

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

Submission status: Accepted

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

print(sum(inp) - max(inp))

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:
import itertools
l=list(map(int,input().split()))
L=[]
p=itertools.permutations(l,2)
for a,b in p:
  L.append(a+b)
print(min(L))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from itertools import permutations

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

t = {
    "A": {
        "B": P,
        "C": R
    },
    "B": {
        "A": P,
        "C": Q
    },
    "C": {
        "A": R,
        "B": Q
    }
}
# check
P = list(permutations(["A", "B", "C"], 3))
T = [sum([t[p[i]][p[i + 1]]for i in range(0, 2)]) for p in P]

print(min(T))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools


def resolve():
    P, Q, R = map(int, input().split())
    groups = itertools.combinations([P, Q, R], 2)

    ans = sum([P, Q, R])
    for group in groups:
        ans = min(sum(group), ans)

    print(ans)


resolve()

Submission status: Accepted

Solution code:
from collections import Counter 
from collections import defaultdict
from collections import deque
import math
import itertools
import heapq
import sys
sys.setrecursionlimit(10**6)

#n=int(input())
#n,m=list(map(int,input().split()))
#a=list(map(int,input().split()))
input_list = lambda : list(map(int,input().split()))

a=input_list()
ans=float("inf")
for i in range(3):
    for j in range(i+1,3):
        ans=min(ans,a[i]+a[j])

print(ans)

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())
ans = []

ans.append(P+Q)
ans.append(Q+R)
ans.append(R+P)

print(min(ans))

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 itertools
import math
import fractions
import functools
import copy

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

Submission status: Accepted

Solution code:
n=3
a=[0]*n
a[:]=map(int,input().split())
a.sort()
print(sum(a)-a[len(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 = list(map(int, input().split()))

A = P + Q
B = P + R
C = Q + R
ans = min(A, B, C)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Wed May 13 15:38:57 2020

@author: shinba
"""

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

A.sort()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
P,Q,R = list(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(P+Q,Q+R,P+R))

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
import math
import bisect

def main():
    p, q, r = map(int, input().split())
    ans = []
    ans.append(p + q)
    ans.append(q + r)
    ans.append(r + p)
    print(min(ans))
    
if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=lambda:input()
I=lambda:int(input())
L=lambda:list(map(int,input().split()))
LS=lambda:list(map(str,input().split()))

def main():
    p,q,r=L()
    print(min(p+q,q+r,r+p))

if __name__=='__main__':
    main()

Submission status: Accepted

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

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

import sys
input = sys.stdin.readline

import math
from collections import deque
from fractions import gcd
from functools import lru_cache


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

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

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

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

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

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

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

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

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

    if arr==[]:
        arr.append([n, 1])
    return arr

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

#############
# Main Code #
#############

P,Q,R = inputIL()

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

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
l = LI()
l.sort()
print(l[0]+l[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:
pqr = list(map(int, input().split()))
pqr.sort()
print(pqr[0]+pqr[1])

Submission status: Accepted

Solution code:
values = tuple(map(int, input().split(' ')))

print(sum(values) - max(values))

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 = [int(x) for x in input().split()]
dist = sorted(l)
print(sum(dist[0:2]))

Submission status: Accepted

Solution code:
#A
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:
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())

from itertools import combinations

c = list(combinations([p,q,r],2))

hour =10**18

for i in c:
    hour = min(hour,i[0]+i[1])

print(hour)

Submission status: Accepted

Solution code:
def airplane(p, q, r):

    return p+q+r-max(p,q,r)
def main():
    p, q, r = map(int, input().split())
    print(airplane(p, q, r))

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

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

Submission status: Accepted

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


if __name__ == '__main__':

    ABC_129_A()

Submission status: Accepted

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
import sys
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = float('inf')


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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# ABC129A

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

Submission status: Accepted

Solution code:
# A - Airplane

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
distances = list(map(int, input().split()))
distances.sort()
ans = 0
for i in range(2):
  ans += distances[i]
print(ans)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
def main():
    P, Q, R = map(int, input().split())
    TIME = P+Q+R - max(P, max(Q, R))
    print(TIME)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
li = input().split()
for i in range(len(li)):
    li[i] = int(li[i])

li.remove(max(li))

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
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()))

li.remove(max(li))

print(sum(li))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# N = int(input())
# S = input()
P, Q, R = map(int, input().split())
# A = list(map(int, input().split()))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(min([p+q,r+q,p+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:
a=sorted([int(i) for i in input().split()])
print(a[0]+a[1])

Submission status: Accepted

Solution code:
print(sum(sorted([int(time) for time in input().split()])[:2]))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
array = sorted(list(map(int, input().split())))
print(array[0]+array[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:
L=sorted(list(map(int,input().split())))
print(L[0]+L[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:
P,Q,R=[int(s) for s in input().split(" ")]

List=[P,Q,R,P]
Ans=[]
SUM=0

for i in range(3):
    SUM=List[i]+List[i+1]
    Ans.append(SUM)
    
print(min(Ans))

Submission status: Accepted

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

import heapq

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

_list = heapq.nsmallest(2, P)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools
p, q, r = map(int, input().split())
ans = 10**18
for v in itertools.permutations([p, q, r], 2):
    ans = min(ans, sum(v))
print(ans)

Submission status: Accepted

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

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:
time = sorted([int(i) for i in input().split()])
print(time[0] + time[1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#A
a,b,c = map(int,input().split())
tmp = [a,b,c]
tmp.sort()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

S=sorted(S)

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

Submission status: Accepted

Solution code:
import sys
from math import ceil, floor, sqrt, sin, cos, pi
from itertools import accumulate, permutations, combinations
from fractions import gcd # 最大公約数
from collections import deque, Counter
from operator import itemgetter
from heapq import heappop,heappush
sys.setrecursionlimit(10**7)
def lcm(x, y): return ((x * y) // gcd(x, y)) # 最小公倍数
# list(map(int, input().split()))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

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:
[P,Q,R] = list(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())
result=min(min(P+Q,Q+R),R+P)
print(result)

Submission status: Accepted

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

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()))
P = [p,q,r]
P = sorted(P)
print(P[0]+P[1])

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
#---Airplane

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

time = P+Q, P+R, Q+R

print(min(time))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
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())
ans = P + Q + R - max(P, Q, R)
print(ans)

Submission status: Accepted

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

saitan = min(p+r,p+q,q+r)

print(saitan)

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

Submission status: Accepted

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

import sys
# import math
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product                # product(iter, repeat=n)
# from itertools import accumulate             # accumulate(iter[, f])
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from copy import deepcopy                    # to copy multi-dimentional matrix without reference
# from fractions import gcd                    # for Python 3.4


def main():
    mod = 1000000007                  # 10^9+7
    inf = float('inf')
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():  return int(input())
    def mi():  return map(int, input().split())
    def mi_0(): return map(lambda x: int(x)-1, input().split())
    def lmi(): return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():  return list(input())
    
    
    L = sorted(lmi())
    print(L[0]+L[1])

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import itertools

t = list(map(int, input().split()))
L = itertools.permutations(t, 2)

ans = 500

for l in L:
    ans = min(ans, sum(list(l)))

print(ans)

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(p + q + r - max(p, 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:
import sys
import os
import math
import string

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

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


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    A = sorted(il())
    print(A[0]+A[1])


if __name__ == '__main__':
    main()

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:
# A - Airplane

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

Submission status: Accepted

Solution code:
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:

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

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

Submission status: Accepted

Solution code:
p,q,r=[int(i)for i in 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, p+r))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline
from itertools import permutations,  combinations, accumulate
from functools import *
from collections import deque, defaultdict, Counter
from heapq import heapify, heappop, heappush, heappushpop

INF = float('inf')
NIL = - 1

""" Input
S = input().rstrip()
N = int(input())
A = list(map(int, input().split()))
A = np.array(input().split(), dtype=np.float64)
D = [int(input()) for _ in range(N)]
AB = [[int(x) for x in input().split()] for _ in range(N)]
PX = [[int(x) for x in input().split()] for _ in range(Q)]
"""

# P, Q, R = map(int, input().split())
#
# heap = []
# heappush(heap, P * (-1))
# heappush(heap, Q * (-1))
# heappush(heap, R * (-1))
#
# heappop(heap)
#
# heap = list(map(lambda x: x * -1, heap))
# print(sum(heap))

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline
from itertools import permutations,  combinations, accumulate
from functools import *
from collections import deque, defaultdict, Counter
from heapq import heapify, heappop, heappush, heappushpop

INF = float('inf')
NIL = - 1

""" Input
S = input().rstrip()
N = int(input())
A = list(map(int, input().split()))
A = np.array(input().split(), dtype=np.float64)
D = [int(input()) for _ in range(N)]
AB = [[int(x) for x in input().split()] for _ in range(N)]
PX = [[int(x) for x in input().split()] for _ in range(Q)]
"""

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

heap = []
heappush(heap, P * (-1))
heappush(heap, Q * (-1))
heappush(heap, R * (-1))

heappop(heap)

heap = list(map(lambda x: x * -1, heap))
print(sum(heap))






# def main():

# if __name__ == '__main__':
#     main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

PQRs.sort()

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

Submission status: Accepted

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

ans = []
ans.append(p+q)
ans.append(q+r)
ans.append(p+r)
print(min(ans))

Submission status: Accepted

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

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

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())

print(min(R+P, P+Q, 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())
a = P+Q
b = Q+R
c = P+R
if a<=b<=c or a<=c<=b:
    print(a)
elif b<=a<=c or b<=c<=a:
    print(b)
else:
    print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if P <= Q:
    if Q <= R:
        print(P+Q)
    else:
        print(P+R)
elif P <= R:
    print(Q+P)
else:
    print(Q+R)

Submission status: Accepted

Solution code:
cost = [int(i) for i in input().split()]
cost.sort()

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 初期入力
P,Q,R = (int(x) for x in input().split())

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

Submission status: Accepted

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