TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: 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?

Submission attempts (in order):
p,q,r = int(x) for x in input().split()
print(min(p + q,q + r,r+ p))

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

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
import numpy as np
lst = list(input().split())

num = len(lst)

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

print(np.min(np.array(A,B,C)))

import numpy as np
lst = list(input().split())

num = len(lst)

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

print(min(np.array(A,B,C)))

lst = list(input().split())

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

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

import numpy as np
lst = list(input().split())

num = len(lst)

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

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

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

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

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

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
P=int(input())
Q=int(input())
R=int(input())
print("{}".format(min([P+Q,Q+R,R+P])))

P=int(input())
Q=int(input())
R=int(input())

a=[P+Q,Q+R,R+P]

print("{}".format(min(a))



P, Q,R = map(int, input().split())
print("{}".format(min([P+Q,Q+R,R+P])))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
A = int(input())
W = list(map(int,input().split()))
tmp = 0
ans = 0
wa = 0

for i in range (A):
    wa += W[i]
for i in range (A):
    tmp += W[i]
    tmp_r = wa-tmp
    if i == 0:
        ans = tmp
    if ans > abs(tmp-tmp_r):
        ans = abs(tmp-tmp_r)
print(ans)

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

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
H,W=map(int,input().split())
S=[[i=="." for i in input()+"#"] for _ in range(H)]+[[False]*(W+1)]

map_=[[0]*W for _ in range(H)]
for i in range(H):
    cnt=0
    q=[]
    for j in range(W+1):
        if S[i][j]==False and cnt!=0:
            for Q in q:
                map_[Q[0]][Q[1]]=cnt
            cnt=0
            q=[]
        elif S[i][j]:
            cnt+=1
            q.append([i,j])
for j in range(W):
    cnt=0
    q=[]
    for i in range(H+1):
        if S[i][j]==False and cnt!=0:
            for Q in q:
                map_[Q[0]][Q[1]]+=cnt
            cnt=0
            q=[]
        elif S[i][j]:
            cnt+=1
            q.append([i,j])
print(max([max(i) for i in map_])-1)

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

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
N, M = map(int, input().split())
broken_data = [int(input()) for _ in range(M) ]
ans = 0
 
memo = [-1] * (N+1)
def countWays(n):
    if n < 0 or (n in broken_data):
        return 0
    elif n == 0:
        return 1
    else:
        if memo[n] > -1:
            return memo[n]
        else:
            memo[n] = ( countWays(n-1) + countWays(n-2) ) % 1000000007
            return memo[n]
 
print(countWays(N))

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

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


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
p, q, r = map(int, input().split())

total = p + q + r

a = min(p, q, r)

print(total - a)

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

total = p + q + r

a = max(p, q, r)

print(total - a)


Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
result=[]
N = int(input())
W = list(map(int,input().split()))
for i in range(1:N+1):
  a = W[:i]
  b = W[i+1:N]
  c = sum(a)
  d = sum(b)
  e = abs(c-d)
  result.append(e)
 
print(min(result))

i = list(map(int,input().split()))
a = i[0]+i[1]
b = i[0]+i[2]
c = i[1]+i[2]
d = list(a,b,c)
print(min(d))

i = list(map(int,input().split()))
a = i[0]+i[1]
b = i[0]+i[2]
c = i[1]+i[2]
d = list(a,b,c)
print(d.min())

i = list(map(int,input().split()))
a = i[0]+i[1]
b = i[0]+i[2]
c = i[1]+i[2]
d = [a,b,c]
print(min(d))

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
l = map(int,input().split())
print(sum(*l)-max(*l))


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


l* = map(int,input().split())
print(sum(l)-max(l))

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
p, q, r = map(int, input().split())





print("{} {}".format(min(p+q, q+r, r+p), s))


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



 
 
print("{}".format(min(p+q, q+r, r+p)))

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
p,q,r = map(int,input().split())
print(sum(p,q,r)-max(p,q,r))

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

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
N, M = map(int, input().split())
A = []
for _ in range(M):
    A.append(int(input()))

case = [0] * (N + 1)
case[0] = 1
if not 1 in A:
    case[1] = 1
for x in range(2, N + 1):
    if x in A:
        case[x] = 0
    elif x - 1 in A:
        case[x] = case[x - 2]
    else:
        case[x] = case[x - 1] + case[x - 2]

print(case[N] % 1000000007)

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

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
a,b,c = map(input().split())

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

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

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

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
P,Q,R = map(int,input().split())
print(min(R+Q,Q+R,R+P))

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


Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
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)
  

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)
  

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
import sys
 
sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7
 
 
def input():
    return sys.stdin.readline().strip()
 
 
def main():
    N, M = map(int, input().split())
    dp = [0] * (N + 1)
    safe = [True] * (N + 1)
    for _ in range(M):
        a = int(input())
        safe[a] = False
 
    dp[0] = 1
    for i in range(1, N + 1):
        if i == 1 and safe[i]:
            dp[i] = dp[i - 1]
        else:
            if safe[i]:
                dp[i] = dp[i - 1] + dp[i - 2]
                dp[i] %= MOD
 
    print(dp[-1])
 
 
if __name__ == "__main__":
    main()

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

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
p,q,r = map(int,input().split())
print(max(p+q, q+r, r+p))

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

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
a = list(map(int,input().split())
a.sort()
print(a[0]+a[1])

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

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
N=int(input())
inp=list(map(int,input().split(' ')))
su=sum(inp)
ab=su
for i in range(N):
  s1=0
  for j in range(i):
    s1+=inp[j]
  if (ab>abs(2*s1-su)):
    ab=abs(2*s1-su)
print(ab)

inp=list(map(int,input().split(' ')))
print(min(inp)+sorted(inp)[1])

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
p = list(map(int,input().split()))

mn = 200
for i in p[:-2]:
    for j in p[i+1:]:
        if (i+j < mn):
            mn = i+j

print(mn)




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

mn = 200
for i in range(2):
    for j in range(i+1,3):
        if (i+j < mn):
            mn = i+j

print(mn)




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

mn = 200
for i in p[:-2]:
    for j in p[i+1:]
    if (i+j < mn):
        mn = i+j

print(mn)




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

mn = 200
for i in range(2):
    for j in range(i+1,3):
        if (p[i]+p[j] < mn):
            mn = p[i]+p[j]

print(mn)




Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
input()

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

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
p, q, r = map(int, input().split())
print(min([p + q, q + r. r + p]))

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

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
import sys
n,m = map(int,input().split())

if m > 0:
    broken = set(map(int,sys.stdin))
else:
    broken = set()
    
dp = [0]*(n+1)
dp[0] = 1
dp[1] = 1 if 1 not in broken else 0

MOD = 10**9 + 7

for i in range(2,n+1):
    if i in broken:
        continue
    dp[i] =　(dp[i-1]+dp[i-2])% MOD
    
print(dp[-1])

import sys
n,m = map(int,input().split())

if m > 0:
    broken = set(map(int,sys.stdin))
else:
    broken = set()
    
dp = [0]*(n+1)
dp[0] = 1
dp[1] = 1 if 1 not in broken else 0

MOD = 10**9 + 7

for i in range(2,n+1):
    if i in broken:
        continue
    dp[i] =(dp[i-1]+dp[i-2])% MOD
    
print(dp[n])

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

c.remove(max(c))

print(sum(c))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
p,q,r = [int(i) for i in input().split(' ')]

l = list(p,q,r)
l.sort()

ans=l[0]+l[1]

print(ans)

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

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

print(min([x,y,z]))

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

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

print(min([x,y,z]))

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

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

print(min([x,x,z]))

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

l = list(p,q,r)
l.sort()

ans=l[0]+l[1]

print(ans)

p,q,r = [int(x) for x in input().split()]
p,q,r.sort()
answer = p,q,r[0] + p,q,r[1]
print(answer)

l = [int(x) for x in input().split()]
l.sort()
answer = l[0] + l[1]
print(answer)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
N, M = map(int,input().split())
a = [int(input()) for i in range(M)]
dp = [0 for i in range(N+1)]
dp[0] = 1
dp[1] = 1
for i in range(2,N+1):
  if (i-2 in a) and (i-1 in a):
    dp[-1] = 0
    break
  elif i-2 in a:
    dp[i] = dp[i-1]
  elif i-1 in a:
    dp[i] = dp[i-2]
  else:
    dp[i] = dp[i-1] + dp[i-2]

print(dp[-1]%(7+10**9))

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

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
PQR = list(map(int, input().split()))
PQR.sort()
print(int(sum(PQR[:1])))


PQR = list(map(int, input().split()))
PQR.sort()
print(sum(PQR[:1]))


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


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
s = list(map(int,input().split()))
sum(sorted(s, reverse=True)[0:2])

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

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
P, Q, R = map(int, input().split())
print(min(P+Q, Q+R, R+A))


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

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


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
p,q,r = int(input())
print(min(p+q, p+p+r, q+r, q+q+p, r+p, r+r+q))

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

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
a = list(map(int,input().split()))
print(sum(a)-min(a))

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

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
print(sum(sorted(input().split())[:2]))

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

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
is=list(map(int,input().split()))
print(sorted(lis)[0]+sorted(lis)[1])

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

Verdicts: Runtime Error

Accepted
Problem: 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?

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

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

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
p = list(map(int, input()))
print(sum(p)-max(p))

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

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
def main():
    PQR = list(map(int, input().split()))
    newPQR = sorted(PQR)
    print(newPQR)
    arr = newPQR[:2]
    print(arr[0]+arr[1])
main()

def main():
    PQR = list(map(int, input().split()))
    newPQR = sorted(PQR)
    arr = newPQR[:2]
    print(arr[0]+arr[1])
main()

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
l=list(map(int,input().split()))

m=sorted(l)[:2]

n=sum(m)


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)


a=sorted(list)

print(a[0])

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
P, Q, R = map(int ,input().split())
print(max(P+Q, Q+R, R+P))

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

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
list = [int(i) for i in input().split()] 
s = min(list)
list.strip(s)
t = min(list)
Time = s+t
print(Time)

list = [int(i) for i in input().split()] 
s = min(list)
list.remove(s)
t = min(list)
Time = s+t
print(Time)

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
PQR=list(map(int,input().split()))
sorted(PQR)
print(PQR[1]+PQR[2])





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

Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
n,m=map(int,input().split())
a=0
if m!=0:
    a=int(input())
b=1
s=[1]*(n+1)
for i in range(1,n+1):
    if i!=a:
        if i-2>=0:
            s[i]=(s[i-1]+s[i-2])%1000000007
        else:
            s[i]=s[i-1]%1000000007
    elif b!=m:
        s[i]=0
        a=int(input())
        b+=1
    else:
        s[i]=0
print(s[n])
        


li=list(map(int,input().split()))
print(min(li[0]+li[1],li[0]+li[2],li[1]+li[2]))


Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
n=int(input())
w=list(map(int,input().split()))
ans=100000000;
s1=0
s2=0
 
for i in range(n):
    s1 += sum(w[:i+1])
    s2 += sum(w[i+1:])
            
    if abs(s1-s2) < ans:
        ans = abs(s1-s2)
    
print(ans)

p, q, r =(int(i) for i in input().split())
ans1=p+q
ans2=q+r
ans3=p+r

if ans1<=ans2 and ans1<=ans3:
    print(ans1)
elif ans2<= ans1 and ans2 <= ans3:
    print(ans2)
else:
    print(ans3)

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
mod=10**9+7
def f(a,r):
    s=[[0,0],[0,0]]
    s[0][0]=(a[0][0]*r[0][0]+a[0][1]*r[1][0])%mod
    s[0][1]=(a[0][0]*r[0][1]+a[0][1]*r[1][1])%mod
    s[1][0]=(a[1][0]*r[0][0]+a[1][1]*r[1][0])%mod
    s[1][1]=(a[1][0]*r[0][1]+a[1][1]*r[1][1])%mod
    return s
b=[[1,1],[1,0]]
k=[b]
for i in range(20):
    k.append(f(k[-1],k[-1]))
n,m=map(int,input().split())
t=0
ans=1
for i in range(m):
    a=int(input())
    if t==a:
        print(0)
        break
    else:
        s=bin(a-1-t)[2:]
        s="0"*(21-len(s))+s
        s=s[::-1]
        p=[[1,0],[0,1]]
        for j in range(21):
            if s[j]=="1":
                p=f(p,k[j])
        ans=(ans*p[0][0])%mod
        t=a+1
        if i==m-1:
            s=bin(n-t)[2:]
            s="0"*(21-len(s))+s
            s=s[::-1]
            p=[[1,0],[0,1]]
            for j in range(21):
                if s[j]=="1":
                    p=f(p,k[j])
            ans=(ans*p[0][0])%mod
else:
    print(ans)

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

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
num = int(input())
A = list(map(int, input().split()))
H = sum(A) / 2
S = 0
for i in range(num):
  S += A[i]
  if abs(H - (S + A[i+1])) >= abs(H - S):
    print(abs(2 * S - 2 * H))
    break
    


F, S, T = map(int, input().split())
FS = F + S
ST = S + T
TF = T + F
L = [FS, ST, TF]
print(max(L))

F, S, T = map(int, input().split())
FS = F + S
ST = S + T
TF = T + F
L = [FS, ST, TF]
print(min(L))


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
a,b,c=map(int,input().split())
print(max(a+b,b+c,a+c))

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


Verdicts: Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
print(hello)

x = input().split()
sum1 = int(x[0]) + int(x[1])
sum2 = int(x[1]) + int(x[2])
sum3 = int(x[0]) + int(x[2])
print(min(sum1, sum2, sum3))

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
import numpy as np

time=input().split()

timed=sorted(time)

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

import numpy as np

time=input().split()

timed=sorted(time)
print(timed)

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

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

timed=sorted(time)

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
n = int(input())
w = list(map(int,input().split()))
ans = float('inf')
for j in range(n):
  ans = min(ans,abs(sum(w[0:j])-sum(w[j:n])))
print(ans)



def fib(n):
    a, b = 1, 1
    if n == 1:
        return a
    elif n == 2:
        return b
    else:
        for i in range(n-2):
            a, b = b, a + b
        return b

n,m = map(int,input().split())
if m != 0:
  a = [int(input()) for i in range(m)]
  ans = fib(a[0])
  for j in range(1,m):
    if m == 1:
        continue
    elif a[j] == a[j-1]+1:
        ans = 0
    else:
        ans *= fib(a[j]-a[j-1]-1)
  ans *= fib(n-a[m-1])
else:
  ans = fib(n+1)
print(ans%1000000007)


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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
n=[int(i) for i in input().split]
n.sort()
print(n[0]+n[1])

n=[int(i) for i in input().split()]
n.sort()
print(n[0]+n[1])

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
P, Q, R = map(int, input().split())

list = [P, Q, R]
min1 = min(list)
list.pop(min1)
min2 = min(list)
print(min1 + min2)

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

list = [P, Q, R]
min1 = min(list)
list.remove(min1)
min2 = min(list)
print(min1 + min2)

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
P,Q,R=map(int,input().split())
print(min(A+B,B+C,C+A))


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


Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
P,Q,R = map(int.input().split())
 
print(min(P+Q,Q+R,R+P))

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

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

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

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
import sys
input = sys.stdin.readline
p,q,r = map(int,input().split())
print(min[p+q,q+r,r+p])


import sys
input = sys.stdin.readline
p,q,r = map(int,input().split())
print(min(p+q,q+r,r+p))


Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
a = map(int,input().split())
print(sum(a) - max(a))

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


Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
import sys
 
def fibo(n):
    a, b = 0, 1
    if n == 1:
        return 1
    else:
        for i in range(n):
            a0 = a
            a = b
            b = a0 + b
        return b
        
N, M = map(int, input().split())
a = []
 
if M == 0:
    print(fibo(N) % 1000000007)
    sys.exit()
 
for i in range(M):
    a.append(int(input()))
    
for j in range(len(a)-1):
    if a[j+1] - a[j] == 1:
        print(0)
        sys.exit()
    
hole = 0
pattern = 1
 
for i, k in enumerate(a):
    if i == 0:
        pattern *= fibo(k-1)
    else:
        if i > 0:
            pattern *= fibo(a[i]-a[i-1]-2)
        
pattern *= fibo(N-a[-1]-1)
print(pattern % 1000000007)

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

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
A = list(map(int,input().split()))
print(SUM(A) - MAX(A))

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

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
N = int(input())
W = list(map(int, input().split()))

l = W[0]
r = sum(W[1:])
diff = abs(l - r)
for i in range(1, N):
    l += W[i]
    r -= W[i]
    new_diff = abs(l-r)
    if new_diff < diff:
        diff = new_diff
print(diff)

p,q,r = map(int, input().split())
l = [p,q,r]
l = sorted(l, reverse=True)
print(l[1] + l[2])

Verdicts: Runtime Error

Accepted
Problem: 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?

Submission attempts (in order):
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)

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)

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)


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)):
      total = params[i]+pattern[j]
      if total <= minTime:
          minTime = total

print(minTime)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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?

Submission attempts (in order):
A = list(map(int, input().split())).sort()
print(sum[:2])

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

Verdicts: Runtime Error

Accepted