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

Submission status: Accepted

Solution code:
#!/usr/bin/env pypy
from __future__ import division, print_function

import os
import sys
from __builtin__ import xrange as range
from cStringIO import StringIO
from future_builtins import ascii, filter, hex, map, oct, zip
from io import IOBase

import __pypy__


def main():
    p, q, r = [int(s) for s in input().split()]
    if r >= p and r >= q:
        print(p + q)
    elif p >= r and p >= q:
        print(r + q)
    else:
        print(p + r)


# region fastio

BUFSIZE = 8192


class FastI(IOBase):
    def __init__(self, file):
        self._fd = file.fileno()
        self._buffer = StringIO()
        self.newlines = 0

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count("\n") + (not b)
            ptr = self._buffer.tell()
            self._buffer.seek(0, 2), self._buffer.write(b), self._buffer.seek(ptr)
        self.newlines -= 1
        return self._buffer.readline()


class FastO(IOBase):
    def __init__(self, file):
        self._fd = file.fileno()
        self._buffer = __pypy__.builders.StringBuilder()
        self.write = lambda s: self._buffer.append(s)

    def flush(self):
        os.write(self._fd, self._buffer.build())
        self._buffer = __pypy__.builders.StringBuilder()


def print(*args, **kwargs):
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


sys.stdin, sys.stdout = FastI(sys.stdin), FastO(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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 = 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(sum([P, Q, R]) - max([P, Q, R]))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

# S = input()
A, B , C = map(int, input().split())
# A = int(input())

X = A + B
Y = B + C
Z = C + A

print(min(X, Y, Z))

Submission status: Accepted

Solution code:
l = input().split()
p,q,r = int(l[0]), int(l[1]), int(l[2])
k = max([p,q,r])
print(p+q+r-k)

Submission status: Accepted

Solution code:
a=input().split()
a=[int(i) for i in a]
x=max(a)
print(sum(a)-x)

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

Submission status: Accepted

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


def main():
  a, b, c = map(int, input().split())
  m = max(a, b, c)
  
  print(a + b + c - m)


if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:

def read_input():
    x, y, z = map(int, input().split())
    return x, y, z


def submit():
    x, y, z = read_input()

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




if __name__ == '__main__':
    submit()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline


def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(P, Q, R):
    return sum(sorted([P, Q, R])[:2])


def main():
    P, Q, R = read_int_n()
    print(slv(P, Q, R))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
###############################################################################

from sys import stdout
from bisect import bisect_left as binl
from copy import copy, deepcopy
from collections import defaultdict
import math


mod = 1


def intin():
    input_tuple = input().split()
    if len(input_tuple) <= 1:
        return int(input_tuple[0])
    return tuple(map(int, input_tuple))


def intina():
    return [int(i) for i in input().split()]


def intinl(count):
    return [intin() for _ in range(count)]


def modadd(x, y):
    global mod
    return (x + y) % mod


def modmlt(x, y):
    global mod
    return (x * y) % mod


def mod_inv(x):
    # available only when mod is prime
    global mod
    return pow(x, mod - 2, mod)


def gcm(x, y):
    while y != 0:
        z = x % y
        x = y
        y = z
    return x


def combination(x, y):
    assert(x >= y)

    ret = math.factorial(x)
    ret = ret // (math.factorial(x - y) * math.factorial(y))

    return ret


def get_divisors(x):
    retlist = []
    for i in range(1, int(x**0.5) + 3):
        if x % i == 0:
            retlist.append(i)
            retlist.append(x // i)
    return retlist


def get_factors(x):
    retlist = []
    for i in range(2, int(x**0.5) + 3):
        while x % i == 0:
            retlist.append(i)
            x = x // i
    retlist.append(x)
    return retlist


def make_linklist(xylist):
    linklist = {}
    for a, b in xylist:
        linklist.setdefault(a, [])
        linklist.setdefault(b, [])
        linklist[a].append(b)
        linklist[b].append(a)
    return linklist


def calc_longest_distance(linklist, v=1):
    distance_list = {}
    distance_count = 0
    distance = 0
    vlist_previous = []
    vlist = [v]
    nodecount = len(linklist)

    while distance_count < nodecount:
        vlist_next = []
        for v in vlist:
            distance_list[v] = distance
            distance_count += 1
            vlist_next.extend(linklist[v])
        distance += 1
        vlist_to_del = vlist_previous
        vlist_previous = vlist
        vlist = list(set(vlist_next) - set(vlist_to_del))

    max_distance = -1
    max_v = None
    for v, distance in distance_list.items():
        if distance > max_distance:
            max_distance = distance
            max_v = v

    return (max_distance, max_v)


def calc_tree_diameter(linklist, v=1):
    _, u = calc_longest_distance(linklist, v)
    distance, _ = calc_longest_distance(linklist, u)
    return distance


class UnionFind:

    def __init__(self, n):
        self.parent = [i for i in range(n)]

    def root(self, i):
        if self.parent[i] == i:
            return i
        self.parent[i] = self.root(self.parent[i])
        return self.parent[i]

    def unite(self, i, j):
        rooti = self.root(i)
        rootj = self.root(j)
        if rooti == rootj:
            return
        if rooti < rootj:
            self.parent[rootj] = rooti
        else:
            self.parent[rooti] = rootj

    def same(self, i, j):
        return self.root(i) == self.root(j)


###############################################################################


def main():
    p, q, r = intina()

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

time.sort()

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

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

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

Submission status: Accepted

Solution code:
p_arr = [int(x) for x in input().split()]

p_arr.sort()

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

Submission status: Accepted

Solution code:
#!venv/bin/python
 
import math
import numpy as np
import random
import copy
import statistics 
import bisect
import heapq
from collections import defaultdict 
import time

L = [ int(x) for x in input().split() ]

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

Submission status: Accepted

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

Submission status: Accepted

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

a = [int(i) for i in input().split()] 

#P, Q, R = (int(i) for i in input().split())  
a.sort()

print(a[0]+a[1])
# k_list = []

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

print(sum(time)-max(time))

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7)
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return sys.stdin.readline().strip()
INF = 10 ** 18
MOD = 10 ** 9 + 7

def main(): 
    P, Q, R = LI()
    print(P+Q+R-max(P,Q,R))

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:
import numpy as np
words = lambda t : list(map(t, input().split()))
pqr = words(int)

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:
import sys
from collections import Counter, deque, defaultdict
from itertools import accumulate, permutations, combinations, takewhile, compress, cycle
from functools import reduce
from math import ceil, floor, log10, log2, factorial
from pprint import pprint

sys.setrecursionlimit(1000000)
# MOD = 10 ** 9 + 7
# N = int(input())
# A,B,C = [int(x) for x in input().split()]
# V = [[0] * 100 for _ in range(100)]
# A = [int(input()) for _ in range(N)]

P, Q, R = [int(x) for x in input().split()]

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
inn = [int(x) for x in input().split()]

print(sum(inn)-max(inn))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

P, Q, R = nl()

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

Submission status: Accepted

Solution code:
# A

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

max_pqr = max(p,q,r)

print(p+q+r-max_pqr)

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:
#!/usr/bin/env pypy3

import sys
sys.dont_write_bytecode = True
stdin = sys.stdin
input = stdin.readline
#sys.setrecursionlimit(100000)

#import numpy as np
#import scipy as sp

# Python 3 modules: https://docs.python.org/3/library/

import math, itertools, operator
from math import *
from math import factorial as fact
from operator import itemgetter, attrgetter
from itertools import permutations, combinations
from functools import reduce
# Use scipy for stats: https://docs.scipy.org/doc/scipy/reference/stats.html
# Before Python 3.5.  Import from math after it.
from fractions import gcd
from fractions import Fraction as Frac

inf = float('inf')

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

def perm(a, b):
    import scipy.special
    return scipy.special.perm(a, b, exact = True)

def comb(a, b):
    import scipy.special
    return scipy.special.comb(a, b, exact = True)

def dfact(n):
    import scipy.special
    return scipy.special.factorial2(n, exact = True)

def prod(l):
    return reduce(operator.mul, l)

def input_ints(func = input, sep = None, conv = int):
    return list(map(conv, func().split(sep = sep)))

################################################################################

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
list_a=list(map(int, input().split()))  #リスト入力

list_a.sort()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print(res)

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:
import sys
sys.setrecursionlimit(100000)

def intinput(): return map(int,sys.stdin.readline().split())

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

Submission status: Accepted

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

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

Submission status: Accepted

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



"""
import sys


def solve(P, Q, R):
    return min(P+Q, Q+R, R+P)


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


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(2000000000)
input=lambda : sys.stdin.readline().rstrip('\n')
d=list(map(int,input().split()))
print(sum(d)-max(d))

Submission status: Accepted

Solution code:
import sys, math, collections, heapq, itertools
def gcd(a, b):
    a, b = max(a, b), min(a, b)
    while a % b > 0: a, b = b, a % b
    return b
  
def solve():
    file = sys.stdin.readline #single: int(file()), line: map(int, file().split())
    INF = 10 ** 25
    mod = 7 + 10 ** 9
    P, Q, R = map(int, file().split())
    print(P + Q + R - max(P, Q, R))
    return 0
  
if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
from collections import deque
from heapq import heappush,heappop
import re

def int_raw():
    return int(input())
 
def ss_raw():
    return input().split()
 
def ints_raw():
    return tuple(map(int, ss_raw()))


DIV=10**9+7

def mod_invs(n,mod=DIV):
    inv=[0]*(n+1)
    inv[0]=1
    inv[1]=1
    for i in range(2,n+1):
        inv[i] = (-(mod//i)*inv[mod%i]) % mod
    return inv



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

print(main())

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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 solve():
    P, Q, R = [int(_) for _ in raw_input().split()]
    ret = min(P+Q, Q+R, P+R)
    print ret

if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
def gcd_core(a, b):
    if b == 0:
        return a
    else:
        return gcd_core(b, a % b)


def gcd(arr):
    g = gcd_core(arr[0], arr[1])
    for i in range(2, len(arr)):
        g = gcd_core(g, arr[i])
    return g




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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:


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

solve()

Submission status: Accepted

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

Submission status: Accepted

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


def solve(P: int, Q: int, R: int):
    l = [P, Q, R]
    l.sort()
    print(l[0]+l[1])
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
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:
import sys
stdin = sys.stdin

sys.setrecursionlimit(10 ** 7)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x) - 1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())


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

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

m = max(p, q, r)

print(p + q + r - m)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
INF = float("inf")


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


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def main():
    buf = input()
    buflist = buf.split()
    P = int(buflist[0])
    Q = int(buflist[1])
    R = int(buflist[2])
    print(min(P+Q, Q+R, R+P))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

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


def LI(): return [int(x) for x in sys.stdin.readline().split()]


def SI(): return input()


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


main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

from collections import deque
# q = deque(); q.append(x); q.appendleft(x); q.pop() -> x; q.popleft() -> x
from collections import defaultdict
# d = defaultdict(lambda: []); d[key] -> []
import heapq
# hq = []; heapq.heappush(hq, x); heapq.heappop(hq) -> x; heapq.heappushpop(hq, x) -> x
import bisect
# i = bisect.bisect_left([1,2,3,4], 1.5); i = bisect.bisect_right([4,3,2,1], 1.5)

#import numpy as np
#from scipy.misc import comb

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in ss]
ss2nnn = lambda ss: [s2nn(s) for s in ss]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [sys.stdin.readline().rstrip() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    X = i2nn()
    X.sort()
    n = sum(X[:2])
    print(n)

main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
from collections.abc import Iterable
from math import *
from itertools import *
from collections import *
from functools import *
from operator import *
try:
    from math import gcd
except Exception:
    from fractions import gcd


def solve(P: int, Q: int, R: int):
    return sum([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
    result = solve(P, Q, R)
    if isinstance(result, Iterable) and not isinstance(result, str):
        result = '\n'.join([str(v) for v in result])
    print(result)

if __name__ == '__main__':
    main()

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:
#-*- coding:utf-8 -*-

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

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

Submission status: Accepted

Solution code:
#import numpy as np
#from numpy import*
#from scipy.sparse.csgraph import shortest_path #shortest_path(csgraph=graph) # dijkstra# floyd_warshall
#from scipy.sparse import csr_matrix

from collections import* #defaultdict Counter deque appendleft
from fractions import gcd
from functools import* #reduce
from itertools import* #permutations("AB",repeat=2) combinations("AB",2) product("AB",2) groupby accumulate
from operator import mul,itemgetter
from bisect import* #bisect_left bisect_right
from heapq import* #heapify heappop heappushpop
from math import factorial,pi
from copy import deepcopy
import sys
sys.setrecursionlimit(10**8)
#input=sys.stdin.readline  #危険！基本オフにしろ！

def main():
    *a,=map(int,input().split())
    print(sum(sorted(a)[:2]))
if __name__ == '__main__':
    main()

Submission status: Accepted

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


def solve(P: int, Q: int, R: int):
    print(sum([P, Q, R]) - max([P, Q, R]))
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
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:

a = [int(i) for i in input().split()]

a.sort()
print(a[0] + a[1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
P, Q, R = [int(i) for i in 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,a+c))

Submission status: Accepted

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

Submission status: Accepted

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


ps = list(map(int, input().split()))
ps = sorted(ps)
print(ps[0]+ps[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:
import sys
from collections import deque
from operator import itemgetter

input = sys.stdin.readline

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,R]
A.sort()
print(A[0]+A[1])

Submission status: Accepted

Solution code:
def getN():
    return int(input())

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

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

cost = getlist()
print(sum(cost) - max(cost))

Submission status: Accepted

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

print(A+B)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from collections import deque
from collections import defaultdict
import math
sys.setrecursionlimit(20000000)
input = sys.stdin.readline
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 = list(map(int, input().split()))

p.sort()
print(sum(p[:2]))

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:
P, Q, R = [int(x) for x in input().split()]
a = sorted([P, Q, R])
print(sum(a[:2]))

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

Submission status: Accepted

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

Submission status: Accepted

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