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: Wrong Answer

Solution code:
P,Q,R=(int(x) for x in input().split())
if P >= Q and R:
  print(Q+R)
elif Q >= P and R:
  print(P+R)
else:
  print(P+Q)

Submission status: Wrong Answer

Solution code:
P,Q,R=(int(x) for x in input().split())
if P >= Q and R:
  print(Q+R)
elif Q >= P and R:
  print(P+R)
elif R >= P and Q:
  print(P+Q)

Submission status: Wrong Answer

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

print(p + q)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

LEN = 3
abc_sum = 0
for i in range(len(num_list) - 1):
  abc_sum += num_list[i]

bca_sum = 0
reversed_list = list(reversed(num_list))
for i, num in enumerate(reversed_list, 1):
  if i == LEN:
    break
  bca_sum += num

cab_sum = 0
cab_sum += num_list[-1]
cab_sum += num_list[0]

min = abc_sum
if abc_sum > bca_sum:
  min = bca_sum
elif bca_sum > cab_sum:
  min = cab_sum
print(min)

Submission status: Wrong Answer

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

LEN = 3
abc_sum = 0
for i in range(len(num_list) - 1):
  abc_sum += num_list[i]

bca_sum = 0
reversed_list = list(reversed(num_list))
for i, num in enumerate(reversed_list, 1):
  if i == LEN:
    break
  bca_sum += num

cab_sum = 0
cab_sum += num_list[-1]
cab_sum += num_list[0]

min = abc_sum
if abc_sum > bca_sum:
  min = bca_sum
elif abc_sum > cab_sum:
  min = cab_sum
print(min)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
data = list(map(int, input().split()))
n = len(data)
res = max(data)
for i in range(n-1):
  for j in range(i+1, n):
    if data[i] + data[j] < res:
      res = data[i] + data[j]
print(res)

Submission status: Wrong Answer

Solution code:
data = list(map(int, input().split()))
n = len(data)
res = max(data)
for i in range(n-1):
  for j in range(i, n):
    if data[i] + data[j] < res:
      res = data[i] + data[j]
print(res)

Submission status: Wrong Answer

Solution code:
data = list(map(int, input().split()))
n = len(data)
res = 0
for i in range(n-1):
  for j in range(i, n):
    if data[i] + data[j] < res:
      res = data[i] + data[j]
print(res)

Submission status: Wrong Answer

Solution code:
lst = list(input().split())

A = lst[0] + lst[1]
B = lst[1] + lst[2]
C = lst[0] + lst[2]

print(min([A,B,C]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import itertools
a = list(map(int, input().split()))
b = list(itertools.permutations(a, 2))
ans = 100
for i in b:
    ans = min(ans, (i[0]+i[1]))
print(ans)

Submission status: Wrong Answer

Solution code:
def main17():
    data = input().split()
    num = []
    for i in range(3):
        num.append(int(data[i]))
    num2 = []
    num2.append((num[0]+num[1]))
    num2.append((num[0]+num[2]))
    num2.append((num[2]+num[1]))
    print((max(num2)))

if __name__ == "__main__":
    main17()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
p = list(map(int,input().split()))
l=[p[i]*p[j] for i in range(3) for j in range(i+1,3)]
print(min(l))

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
if a+b<a+c and a+b<b+c:
  print(a+b)
elif a+c<a+b and a+c<b+c:
  print(a+c)
else:
  print(b+c)

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
if a+b>a+c and a+b>b+c:
  print(a+b)
elif a+c>a+b and a+c>b+c:
  print(a+c)
else:
  print(b+c)

Submission status: Wrong Answer

Solution code:
a,b,c = input().split()
if a+b>a+c and a+b>b+c:
  print(a+b)
elif a+c>a+b and a+c>b+c:
  print(a+c)
else:
  print(b+c)

Submission status: Wrong Answer

Solution code:
#A_B=P,B_C=Q,C_A=R

A_B, B_C, C_A = (int(a) for a in input().split())

P = A_B + B_C
Q = B_C + C_A

if P < Q:
    print(P)
else:
    print(Q)

Submission status: Wrong Answer

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

print(num[-1]+num[-2])

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
m = a+b
n=b+c
o=c+a
min =0
if m <= n:
  min =m
else:
  min =n
if m<= o:
  min =m
else:
  min =o
print(min)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
P, Q, R = list(map(int, input().split()))
if P+Q < P+R and P+Q < Q+R:
    print(P+Q)
elif P+R < P+Q and P+R < Q+R:
    print(P+R)
else:
    print(Q+R)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
L=list(input())
L.sort()

ans= L[0]+L[1]

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
""" lis = input().split()
# print(lis)
# print(type(lis[1]))
n_lis = list(map(int, lis))
# print(n_lis)
# print(type(n_lis[1]))
q = max(n_lis)
n_lis.remove(max(n_lis))
print(q + max(n_lis))
 """

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

if l[0] < l[1] and l[0] < l[2]:
    if l[1] > l[2]:
        print(l[0] + l[2])
        exit()
    else:
        print(l[0] + l[1])
        exit()

if l[1] < l[0] and l[1] < l[2]:
    if l[0] > l[2]:
        print(l[1] + l[2])
        exit()
    else:
        print(l[1] + l[0])
        exit()

if l[2] < l[1] and l[2] < l[0]:
    if l[1] > l[0]:
        print(l[2] + l[0])
        exit()
    else:
        print(l[2] + l[1])
        exit()

Submission status: Wrong Answer

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

if l[0] < l[1] and l[0] < l[2]:
    if l[1] > l[2]:
        print(l[0] + l[2])
    else:
        print(l[0] + l[1])

if l[1] < l[0] and l[1] < l[2]:
    if l[0] > l[2]:
        print(l[1] + l[2])
    else:
        print(l[1] + l[0])
if l[2] < l[1] and l[2] < l[0]:
    if l[1] > l[0]:
        print(l[2] + l[0])
    else:
        print(l[2] + l[1])

Submission status: Wrong Answer

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

if l[0] < l[1] and l[0] < l[2]:
    if l[1] > l[2]:
        print(l[0] + l[2])
    else:
        print(l[0] + l[1])

if l[1] < l[0] and l[0] < l[2]:
    if l[0] > l[2]:
        print(l[1] + l[2])
    else:
        print(l[1] + l[0])
if l[2] < l[1] and l[2] < l[0]:
    if l[1] > l[0]:
        print(l[2] + l[0])
    else:
        print(l[2] + l[1])

Submission status: Wrong Answer

Solution code:
lis = input().split()

n_lis = list(map(int, lis))

q = max(n_lis)
n_lis.remove(max(n_lis))
print(q + max(n_lis))

Submission status: Wrong Answer

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

min = p + q
if min > r + q:
    min = r + q

if min > p + r:
    min = p + r

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
AB, BC, AC = [int(_) for _ in input().split(" ")]

M = [[0, AB, AC],
     [AB, 0, BC],
     [AC, BC, 0]]

def A(l):
    t = [0] * l
    def Sub(targetList, n):
        if 1:
            if len(targetList) == 1:
                t[n] = targetList[0]
                yield t
                t[n] = 0
            for i in range(len(targetList)):
                p = targetList[:i] + targetList[i+1:]
                t[n] = targetList[i]
                for j in Sub(p, n+1):
                    yield j
        else:
            pass
    
    for i in (Sub(tuple(range(l)), 0)):
        yield i

_min = 10**100
for i in A(3):
    _sum = 0
    for j in range(1, len(i)):
        _from = i[j-1]
        _to = i[j]        
        _sum += M[_from][_to]
    #print (_sum)
    if _min > _sum:
        _min = _sum
print (_sum)

Submission status: Wrong Answer

Solution code:
#AB, BC, AC = [int(_) for _ in raw_input().split(" ")]
AB = 3
BC = 2
AC = 5

M = [[0, AB, AC],
     [AB, 0, BC],
     [AC, BC, 0]]

def A(l):
    t = [0] * l
    def Sub(targetList, n):
        if 1:
            if len(targetList) == 1:
                t[n] = targetList[0]
                yield t
                t[n] = 0
            for i in range(len(targetList)):
                p = targetList[:i] + targetList[i+1:]
                t[n] = targetList[i]
                for j in Sub(p, n+1):
                    yield j
        else:
            pass
    
    for i in (Sub(tuple(range(l)), 0)):
        yield i

_min = 10**100
for i in A(3):
    _sum = 0
    for j in range(1, len(i)):
        _from = i[j-1]
        _to = i[j]        
        _sum += M[_from][_to]
    #print (_sum)
    if _min > _sum:
        _min = _sum
print (_sum)

Submission status: Wrong Answer

Solution code:
AB, BC, AC = [int(_) for _ in raw_input().split(" ")]

M = [[0, AB, AC],
     [AB, 0, BC],
     [AC, BC, 0]]

def A(l):
    t = [0] * l
    def Sub(targetList, n):
        if 1:
            if len(targetList) == 1:
                t[n] = targetList[0]
                yield t
                t[n] = 0
            for i in range(len(targetList)):
                p = targetList[:i] + targetList[i+1:]
                t[n] = targetList[i]
                for j in Sub(p, n+1):
                    yield j
        else:
            pass
    
    for i in (Sub(tuple(range(l)), 0)):
        yield i

_min = 10**100
for i in A(3):
    _sum = 0
    for j in range(1, len(i)):
        _from = i[j-1]
        _to = i[j]        
        _sum += M[_from][_to]
    #print (_sum)
    if _min > _sum:
        _min = _sum
print (_sum)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, raw_input().split())
x = a
if x > b:
    x = b
if x > c:
    x = c
y = a + b + c
print y - x

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,c = map(int, input().split())
x = a+b
y = b+c
z = c+a
if x >= y and x >= z:
  print(x)
elif y >= x and y >= z:
  print(y)
elif z >= x and z >= y:
  print(z)

Submission status: Wrong Answer

Solution code:
a,b,c = map(int, input().split())
x = a+b
y = b+c
z = c+a
if x >= y :
  if x >= z :
    print(x)
  else : print(z)
elif y >= z:
  print(y)
else: print(z)

Submission status: Wrong Answer

Solution code:
a,b,c = map(int, input().split())
x = a+b
y = b+c
z = c+a
if x > y :
  if x > z :
    print(x)
  else : print(z)
elif y > z:
  print(y)
else: print(z)

Submission status: Wrong Answer

Solution code:
#A問題
time_list = input().split()
time_list = [int(i) for i in time_list]
time_list.sort(reverse = True)
print(time_list[0]+time_list[1])

Submission status: Wrong Answer

Solution code:
def solve(string):
    *pqr, = map(int, string.split())
    return str(sum(sorted((pqr)[:2])))


if __name__ == '__main__':
    print(solve(input()))

Submission status: Wrong Answer

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

a = P + Q
b = Q + R
c = R + P

if b > a and c > a:
  print(a)
elif b > c:
  print(c)
else:
  print(c)

Submission status: Wrong Answer

Solution code:
P = 1
Q = 2
R = 3

A = P+Q
B = Q+R
C = R+P

print (min(A, B, C))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ABC = P + Q
ACB = R + Q
BAC = Q + R

print(min(ABC,ACB,BAC))

Submission status: Wrong Answer

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

A = a + b
B = b + c
C = c + a

if A < B:
  if C < A:
    print(C)
  else:
    print(A)
elif C < B:
  if C < B:
    print(C)
  else:
    print(B)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input().split()
ld = sorted(s, reverse=False)[:2]
print(ld)
sum(int(i) for i in ld)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a2b , b2c, c2a = map(int,input().split())
if b2c <= a2b and c2a <= a2b:
    print(b2c + c2a)
if a2b < b2c and  c2a < b2c:
    print(a2b + c2a)
if b2c < c2a and a2b < c2a:
    print(b2c + a2b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
P,Q,R = list(map(int,input().split()))
if P+Q <= Q+R & P+Q <= P+R :
    print(P+Q)
elif P+R <= P+Q & P+R <= Q+R :
    print(P+R)
else :
    print(Q+R)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
print

Submission status: Wrong Answer

Solution code:
data=input().split()
sum_list=[]
for i in range(len(data)-1):
  for j in range(len(data)-i-1):
    sum=data[i]+data[i+1+j]
    sum_list.append(sum)
print(min(sum_list))

Submission status: Wrong Answer

Solution code:
import numpy

Submission status: Wrong Answer

Solution code:
import numpy as np

Submission status: Wrong Answer

Solution code:

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


B =[A[0]+A[1],A[0]+A[2],A[1]+A[2]]
tmp = B[0]
for i in range(len(B)-1):
    if B[i]>=B[i+1]:
        tmp = B[i+1]


print(tmp)

Submission status: Wrong Answer

Solution code:

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


B =[A[0]+A[1],A[0]+A[2],A[1]+A[2]]
tmp = B[0]
for i in range(len(B)-1):
    if B[i]>B[i+1]:
        tmp = B[i+1]


print(tmp)

Submission status: Wrong Answer

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


B =[A[0]+A[1],A[0]+A[2],A[1]+A[2]]
tmp = 0
for i in range(len(B)-1):
    if B[i]>B[i+1]:
        tmp = B[i+1]


print(tmp)

Submission status: Wrong Answer

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

mintime = p + q
if(mintime > p + r):
    mintime = p + r
elif(mintime > q + r):
    mintime = q + r

print(mintime)

Submission status: Wrong Answer

Solution code:
import numpy as np
xa = input().rstrip().split(" ")
xb = [ int(j) for j in xa ]
print(xb)

min_cost = 999

for i in range(len(xb)):
  x = xb
  cost = sum(x) - x[i]
  if cost < min_cost:
    min_cost = cost
print(min_cost)

Submission status: Wrong Answer

Solution code:
import numpy as np
x = [1, 3, 4]

min_cost = 999

for i in range(len(x)):
  x = [1, 3, 4]
  x.pop(i)
  cost = sum(x)
  if cost < min_cost:
    min_cost = cost
print(min_cost)

Submission status: Wrong Answer

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

import sys
def compare(i,j,k):
    if i>=j:
        if j>=k:
            print(j+k)
        elif j<k:
            if i<=k:
                print(i+j)
            else:
                print(k+j)
    elif i<j:
        if k>=j:
            print(i+j)
        elif k<j:
            print(k+i)
            sys.exit()
            
print(compare(P,Q,R))

Submission status: Wrong Answer

Solution code:
print('test')

Submission status: Wrong Answer

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

if P < Q < R:
    t1 = P
    t2 = Q
elif P < R < Q:
    t1 = P
    t2 = R
else:
    t1 = Q
    t2 = R

print(t1+t2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(sum(data[:1]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np

time=input().split()

timed=sorted(time)
print(timed)

print(int(timed[0])+int(timed[1]))

Submission status: Wrong Answer

Solution code:
import numpy as np

time=input().split()

timed=sorted(time)

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

Submission status: Wrong Answer

Solution code:
L = input()
MOD = 10**9 + 7

if L[-1] == "0":
    OK, NG = 1, 2
else:
    OK, NG = 3, 0

for i in range(len(L)-2, -1, -1):
    if L[i] == "1":
        OK, NG = (3*OK + NG)%MOD, 2*NG%MOD
    else:
        OK, NG = OK%MOD, (2*OK + 3*NG)%MOD

print(OK)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
P, Q, R = map(int, input().split())
times = [P, Q, R]
from itertools import combinations

max = 0
for i in combinations(times, r=2):
  j = sum(i)
  if j > max:
    max = j

print(max)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

m=sorted(l)[:2]

n=sum(m)

Submission status: Wrong Answer

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

#P=AB Q=BC R=AC
#ABC ACB BAC BCA CAB CBA

list=[]
list.append(P+Q)
list.append(R+Q)
list.append(P+R)
list.append(Q+R)
list.append(R+P)
list.append(Q+P)


MIN=101
for i in list:
    if(MIN>i):
        MIN=i

print(MIN)

Submission status: Wrong Answer

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

PQ=a+b
PR=a+c
QR=b+c

list=[]
list.append(PQ)
list.append(PR)
list.append(QR)

MIN=101
for i in list:
    if(MIN>i):
        MIN=i

print(MIN)

Submission status: Wrong Answer

Solution code:
P, Q, R= (int(i) for i in input().split())
 
ABC=P+Q
ACB=R+Q 
BAC=P+R 
 
if ABC >= ACB & BAC>=ACB:
  print(ACB)
elif ABC >= BAC & ACB>=BAC:
    print(BAC)
else:
  print(ABC)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
def solve():
    mod = 10**9+7
    L = input()
    N = len(L) - 2
    dp = [0]*2
    dp[0] = 1
    dp[1] = 2
    for i in range(1, N):
        if L[i]=='0':
            dp[0], dp[1]=dp[0]*3, dp[1]
        else:
            dp[0], dp[1]=dp[0]*3+dp[1], dp[1]*2
    print((dp[0]+dp[1])%mod)
solve()

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
def solve():
    mod = 10**9+7
    L = input()
    N = len(L) - 1
    dp = [0]*2
    dp[0] = 1
    dp[1] = 2
    for i in range(1, N):
        if L[i]=='0':
            dp[0], dp[1]=dp[0]*3, dp[1]
        else:
            dp[0], dp[1]=dp[0]*3+dp[1], dp[1]*2
    print((dp[0]+dp[1])%mod)
solve()

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
def solve():
    mod = 10**9+7
    L = input().strip()
    N = len(L)
    dp = [0]*2
    dp[0] = 1
    dp[1] = 2
    for i in range(1, N):
        if L[i]=='0':
            dp[0], dp[1]=dp[0]*3, dp[1]
        else:
            dp[0], dp[1]=dp[0]*3+dp[1], dp[1]*2
    print((dp[0]+dp[1])%mod)
solve()

Submission status: Wrong Answer

Solution code:
pqr = input().split()
for i in range(3):
     pqr[i] = int(pqr[i])
a = min(pqr[0]*pqr[1], pqr[1]*pqr[2], pqr[2]*pqr[0])
print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

# print(P)
# print(Q)
# print(R)

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

print(min)

Submission status: Wrong Answer

Solution code:
import sys

for line in sys.stdin:
  print line

Submission status: Wrong Answer

Solution code:
import sys
if sys.version[0] == '2':
    range, input = xrange, raw_input
L = input()
N = len(L)
MOD = 10 ** 9 + 7
bits = [1, 2]
acc = [1, 3]
for _ in range(N):
    nex = bits[-1] * 3 % MOD
    bits.append(nex)
    acc.append((acc[-1] + nex) % MOD)
ans = acc[N-1]
cnt = 1
for i, b in enumerate(L):
    if i == 0:
        continue
    now = N-i-1
    if b == '1':
        ans += acc[now] * pow(2, cnt) % MOD
        cnt += 1
    ans %= MOD
ans += pow(2, cnt)
ans %= MOD
print(ans)

Submission status: Wrong Answer

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

dists.pop()
print(dists)

Submission status: Wrong Answer

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

if q + p < r:
    r = p+q
if q + r < p:
    p = q+r
if r + p < q:
    q = r+p
    
if q + p < m:
    m = p+q
if q + r < m:
    m = p+r
if r + p < m:
    m = r+p

print(m)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


if q + p < m:
    m = p+q
if q + r < m:
    m = p+r
if r + p < m:
    m = r+p

print(m)

Submission status: Wrong Answer

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

if q + p < r:
    r = p+q
if q + r < p:
    p = q+r
if r + p < q:
    q = r+p
    
if q + p < m:
    m = p+q
if q + r < m:
    m = p+r
if r + p < m:
    m = r+p

print(m)

Submission status: Wrong Answer

Solution code:
a = input().split()
print(a)
b = int(a[0])+int(a[1])
c = int(a[1])+int(a[2])
d = int(a[2])+int(a[0])

e=list()
e.append(b)
e.append(c)
e.append(d)
print(e)
print(min(e))

Submission status: Wrong Answer

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

if q + p < r:
    r = p+q
if q + r < p:
    p = q+r
if r + p < q:
    q = r+p
    
if q + p < m:
    m = p+q
if q + r < m:
    m = p+r
if r + p < m:
    m = r+p

print(m)

Submission status: Wrong Answer

Solution code:
import sys
data = sys.stdin.readlines()
print(data[0].split())
inputs = [int(x) for x in data[0].split()]
inputs.sort()
print(inputs[0] + inputs[1])

Submission status: Wrong Answer

Solution code:
P=3
Q=2
R=3
if P+Q<=Q+R:
    if P+Q<=R+P:
        print(P+Q)
    else:
        print(R+P)
elif Q+R<P+Q:
    if Q+R<=R+P:
        print(Q+R)
    else:
        print(R+P)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
print("test")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
p,q,r=map(int,input().split())
#print(p,q,r)
d=p+q
e=q+r
f=r+p
if d>e>f:
    print(f)
elif e>f>d:
    print(d)
elif f>d>e:
    print(e)
elif d==e or f==d:
    print(d)
elif e==f:
    print(e)

Submission status: Wrong Answer

Solution code:
import copy

params = list(map(int, input().split()))
count = len(params)

minTime = 500

for i in range(count):
  pattern = copy.copy(params)
  total = 0
  pattern.pop(i)
  for j in range(len(pattern)-1):
      total = params[i]+pattern[j]
      if total <= minTime:
          minTime = total

print(minTime)

Submission status: Wrong Answer

Solution code:
import copy

params = list(map(int, input().split()))
count = len(params)-1

minTime = 500

for i in range(count):
  pattern = copy.copy(params)
  total = 0
  pattern.pop(i)
  for j in range(len(pattern)-1):
      total = params[i]+pattern[j]
      if total <= minTime:
          minTime = total

print(minTime)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import copy

params = [1, 3, 4]
count = len(params)-1

minTime = 500

for i in range(count):
  pattern = copy.copy(params)
  total = 0
  pattern.pop(i)

  print(params)
  for j in range(len(pattern)-1):
      total = params[i]+pattern[j]
      if total <= minTime:
          minTime = total

print(minTime)

Submission status: Wrong Answer

Solution code:
import copy

params = [1, 3, 4]
count = len(params)-1

minTime = 100

for i in range(count):
  pattern = copy.copy(params)
  total = 0
  pattern.pop(i)
  for j in range(len(pattern)-1):
      total = params[i]+pattern[j]
      if total <= minTime:
          minTime = total

print(minTime)

Submission status: Wrong Answer

Solution code:
import copy

params = [1, 3, 4]
count = len(params)-1

minTime = 100

for i in range(count):
  pattern = copy.copy(params)
  total = 0
  pattern.pop(i)

  print(params)
  for j in range(len(pattern)-1):
      total = params[i]+pattern[j]
      if total <= minTime:
          minTime = total

print(minTime)

Submission status: Wrong Answer

Solution code:
s = input().split()

if s[0] >= s[1] and s[0] >= s[2]:
    print(s[1] + s[2])
elif s[1] >= s[0] and s[1] >= s[2]:
    print(s[0] + s[2])
else:
    print(s[0] + s[1])

Submission status: Wrong Answer

Solution code:
P, Q, R= (int(i) for i in input().split())

ABC=P+Q
ACB=R+Q 
BAC=P+R 

if ABC >= ACB & BAC>=ACB:
  print(ACB)
elif ABC >= BAC:
    print(BAC)
elif ABC == ACB & BAC == ACB:
  print(ABC)
else:
  print(ABC)

Submission status: Wrong Answer

Solution code:
P, Q, R= (int(i) for i in input().split())

ABC=P+Q
ACB=R+Q 
BAC=P+R 

if ABC >= ACB & BAC>=ACB:
  print(ACB)
elif ABC >= BAC:
    print(BAC)
else:
  print(ABC)

Submission status: Wrong Answer

Solution code:
params = list(map(int, input().split()))
count = len(params)-1

minTime = 100

for i in range(count):
  pattern = params
  total = 0
  pattern.pop(i)
  for j in range(len(pattern)-1):
    total = params[i] + pattern[j]
    if total <= minTime:
      minTime = total
    
print(minTime)

Submission status: Wrong Answer

Solution code:
p,q,r=map(int,input().split())
n=[p+q,q+r,r+p,2*r+p,2*p+q,2*q+r,2*p+r,2*r+q,2*q+p]
ns=sorted(n)
print(n[0])

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
list=[a, b, c]
list.sort(reverse=True)
print(a+b)

Submission status: Wrong Answer

Solution code:
p,q,r=map(int,input().split())
n=[p+q,q+r,r+p,2*r+p,2*p+q,2*q+r]
ns=sorted(n)
print(n[0])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

import numpy as np
import scipy as sp

def main():
    try:
        li = list(map(int, input().split()))
        min_time = 1e100
        if li[0] + li[1] < min_time:
            min_time = li[0] + li[1]
        elif li[1] + li[2] < min_time:
            min_time = li[1] + li[2]
        elif li[2] + li[0] < min_time:
            min_time = li[2] + li[0]
        print(min_time)
    except:
        pass

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
t_list=[]
is_arg_ok = False
try:
  t_list = [int(n) for n in input().split(' ')]
except:
  print('age,price must be numbers')
  sys.exit(1)

min_1 = 10000
min_2 = 10000
for i in range(len(t_list)):
    t1 = t_list[i]
    if min_1 > t1:
        min_1 = t1
    elif min_2 > t1:
        min_2 = t1
min_t = min_1 + min_2
print(min_t)

Submission status: Wrong Answer

Solution code:
a,b,c=input().split()
a=int(a)
b=int(b)
c=int(c)
if a+b <= a+c and a+b <= b+c:
    print(a+b)
elif a+c <= a+b and a+c <= b+c:
    print(a+b)
else:
    print(a+c)

Submission status: Wrong Answer

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

min = p + q

if (min >= q + r):
    min = q + r
elif (min >= r + p):
    min = r + p

print (int(min))

Submission status: Wrong Answer

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

min1=P
min2=Q

min1=101
min2=101


if min1>P:
    min1=P
    flag="P"
if min1>Q:
    min1=Q
    flag="Q"
if min1>R:
    min1=R
    flag="R"

if(flag!="P"):
    if min2>=P:
        min2=P
if(flag!="Q"):
    if min2>=Q:
        min2=Q
if(flag!="R"):
    if min1>=R:
        min2=R
print(min1+min2)

Submission status: Wrong Answer

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

if p+q<r+q:
    print(p+q)
    
elif p+q>r+q:
    print(r+q)
    
elif p+r>q+r:
    print(q+r)
    
elif p+r<q+r:
    print(p+r)
        
elif r+p>q+p:
    print(q+p)
    
elif r+p<q+p:
    print(r+p)

Submission status: Wrong Answer

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

min = p + q

if (min > q + r):
    min = q + r
elif (min > r + p):
    min = r + p

print (int(min))

Submission status: Wrong Answer

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

mintime = p + q #ABC

if(mintime > r + q): #ACB
    mintime = r + q
    
elif(mintime > p + r): #BAC
    mintime = p + r
elif(mintime > q + r): #BCA
    mintime =  q + r

elif(mintime > r + p):#CAB
     mintime = r + p
elif(mintime > q + p):#CBA
    mintime = q + p

print(mintime)

Submission status: Wrong Answer

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


    
if q + p < m:
    m = p+q
if q + r < m:
    m = p+r
if r + p < m:
    m = r+p

print(m)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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