TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: There is a rectangle in a coordinate plane. The coordinates of the four vertices are (0,0), (W,0), (W,H), and (0,H). You are given a point (x,y) which is within the rectangle or on its border. We will draw a straight line passing through (x,y) to cut the rectangle into two parts. Find the maximum possible area of the part whose area is not larger than that of the other. Additionally, determine if there are multiple ways to cut the rectangle and achieve that maximum.

Submission attempts (in order):
W , H ,x , y = map(int,input().split())
horizon = min(W * y , W * (H - y))
vertical = min(H * x , H * (W - x))
print(max(horizon , vertical) , end = ' ')
if horizon == vertical:
    print("1")
else:
    print('0')

W , H ,x , y = map(int,input().split())
horizon = min(W * y , W * (H - y))
vertical = min(H * x , H * (W - x))
flag = False

if x == W or y == H or x == 0 or y == 0:
    print("{:.6f}".format((W * H) / 2) , end = ' ')
    print("0")

else:
    print('{:.6f}'.format(max(horizon , vertical)) , end = ' ')
    
    if x == W//2 and y == H //2
        print("1")
    else:
        print('0')

W , H ,x , y = map(int,input().split())


print("{:.6f}".format(W * H /2) , end = ' ')
if x + x  == W and y + y == H:
    print('1')
else:
    print("0")

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: There is a rectangle in a coordinate plane. The coordinates of the four vertices are (0,0), (W,0), (W,H), and (0,H). You are given a point (x,y) which is within the rectangle or on its border. We will draw a straight line passing through (x,y) to cut the rectangle into two parts. Find the maximum possible area of the part whose area is not larger than that of the other. Additionally, determine if there are multiple ways to cut the rectangle and achieve that maximum.

Submission attempts (in order):
W, H, x, y = map(int, input().split())

ans = (W * H) / 2
div = 1 if (x == W // 2 and y == H // 2) else 0

print("{0:.9f} {1}".format(ans, div))


W, H, x, y = map(int, input().split())

ans = (W * H) / 2
div = 1 if (x == W / 2 and y == H / 2) else 0

print("{0:.6f} {1}".format(ans, div))


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

a = P + Q
b = P + R
c = Q + R
d = Q + P
e = R + Q
f = R + P

mn_list = list[a,b,c,d,e,f]
mn = min(mn_list)

print(mn)

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

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

a = P + Q
b = P + R
c = Q + R
d = Q + P
e = R + Q
f = R + P

mn_list = list[a,b,c,d,e,f]
mn = min(mn_list)

print(mn)

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

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

a = P + Q
b = P + R
c = Q + R
d = Q + P
e = R + Q
f = R + P

list[a,b,c,d,e,f]
mn = min(list)

print(mn)

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

a = P + Q
b = P + R
c = Q + R
d = Q + P
e = R + Q
f = R + P

list[a,b,c,d,e,f]

print(min(list))

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

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):
l = [map(int, input())]

l.sort()

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

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

l = [p, q, r]

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

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

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


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

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

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

print(min)


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):
import math

N = int(input())
W = list(map(int, input().split()))


def search(start, end, i, W):
    S1 = sum(W[0:i + 1])
    S2 = sum(W[i + 1:len(W)])

    next_i = math.floor(i / 2) if S1 >= S2 else math.floor((i + end) / 2)

    if S1 == S2: return i
    if S1 > S2:
        next_start = start
        next_end = i
    else:
        next_start = i + 1
        next_end = end
    
    # print(start, next_start, end, next_end, i, next_i, S1, S2)
    if next_start == end: return next_start
    if next_end == start: return next_end
    
    return search(next_start, next_end, next_i, W)


i = search(0, len(W) - 1, math.floor((len(W) - 1) / 2), W)

S1 = sum(W[0:i + 1])
S2 = sum(W[i + 1:len(W)])
diff = abs(S2 - S1)

print(diff)


inputted = list(map(int, input().split()))
AB = BA = inputted[0]
BC = CB = inputted[1]
AC = CA = inputted[2]

answer = min([
    AB + BC,
    AC + CB,
    BA + AC,
    BC + CA,
    CA + AB,
    CB + BA,
])

print(answer)


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

i = input().split()

p = int(i[0])
q = int(i[1])
r = int(i[2])

v1 = p + q
v2 = q + r
v3 = p + r

if v1 < v2 and v1 < v3:
    print(v1)
elif v2 < v3:
    print(v2)
else:
    print(v3)


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 = list(map(int, input().split(" ")))
A = [1] * (N+1)
for i in range(M):
    A[int(input())] = -1
for i in range(2, N + 1):
    if(A[i] == -1):
        A[i] = 0
    else:
        A[i] = A[i-1] + A[i-2]
print(A[-1] % 1000000007)


import itertools
pqr = list(map(int,input().split(" ")))
print(sum(min(list(itertools.combinations(pqr, 2)), key=lambda x:sum(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):
list = input().split()
list = sort(list)
print(list[0] + list[1])

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

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

a,b,c=map(int,input().split())
print(a+b+c-max(a,b,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):
H, W = map(int, input().split())
S = [int(input()) for _ in range(W)]
    
floor = list(range(0,H+1))

if S.count(1) >0:
	floor[1]=0
	floor[2]=1
if S.count(2) >0:
    floor[2]=0

for i in range (3, H+1):
		floor[i]=floor[i-2]*(1-S.count(i-2))+floor[i-1]*(1-S.count(i-1))
print(floor[H]%(10**9+7))

a, b, c = map(int, input().split())
print(a+b+c-max(a,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(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):
P,Q,R = map(int,input().split(' '))
List = [P,Q,R].sort()
print(List[0]+List[1])

List = list(map(int,input().split(' ')))
List.sort()
print(sum(List[0: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):
p = int(input())
q = int(input())
r = int(input())
a = p + q
b = q + r
c = p + r
print(max(a,b,c))

p = int(input())
q = int(input())
r = int(input())
a = p + q
b = q + r
c = p + r
print(min(a,b,c))

p,q,r = list(map(int,input().split()))
a = p + q
b = q + r
c = p + r
print(min(a,b,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):
A = [map(int,input().split()) for i in range(1)]

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

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

time = time.sort()

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

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

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 = list(map(int, input().split()))
b = [-1]
ans = 1

def dfs(top, bot):
    if top == bot:
        return 1
    elif top < bot:
        return 0
    else:
        return dfs(top - 1, bot) + dfs(top - 2, bot)
    
for i in range(m):
    broken = int(input())
    b.append(broken)

b.append(n + 1)
##print (b)

for i in range(len(b) - 1):
    if b[i] + 1 in b:
        ans = 0
        break
    else:
##        print (b[i + 1] - 1, b[i] + 1)
        ans *= dfs(b[i + 1] - 1, b[i] + 1)
        ans %= 1000000007

print (ans)


import sys
sys.setrecursionlimit(200000)

n, m = list(map(int, input().split()))
b = [-1]
ans = 1

def dfs(top, bot, dp):
    if top == bot:
        return 1
    elif top < bot:
        return 0
    else:
        if (top,bot) in dp:
            return dp[(top,bot)]
        dp[(top,bot)] = dfs(top - 1, bot, dp) + dfs(top - 2, bot, dp)
    
for i in range(m):
    broken = int(input())
    b.append(broken)

b.append(n + 1)
##print (b)

dp = dict()

for i in range(len(b) - 1):
    if b[i + 1] == b[i] + 1:
        ans = 0
        break
    else:
##        print (b[i + 1] - 1, b[i] + 1)
        ans *= dfs(b[i + 1] - 1, b[i] + 1, dp)
        ans %= 1000000007

print (ans)


x = input()
x2 = x.split(" ")

x2.sort()

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


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


a,b,c=map(int,input().split())
x=max(a,max(b,c))
input(a+b+c-x)

a,b,c=map(int,input().split())
x=max(a,max(b,c))
print(a+b+c-x)

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,b,c =input().split(",")
mylist = [int(a),int(b),int(c)]
mylist.sort()
print(sum(mylist[0:2]))

a,b,c =input().split(" ")
mylist = [int(a),int(b),int(c)]
mylist.sort()
print(sum(mylist[0: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 statistics
lis = []
for i in range(3):
    a = int(input())
    a = [a]
    lis += a
x = min(lis)
y = statistics.median(lis)
print(x+y)


import statistics
lis = []
for i in range(3):
  a = int(input())
  a = [a]
  lis += a
x = min(lis)
y = statistics.median(lis)
print(x+y)

a, b, c = [int(i) for i in input().split()]
d = a + b
e = b + c
f = c + a
print(min(d, e, f))

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 = map(int,input().split())
a = p+q
b = q+r
c = r+p
l=[a,b,c]
l.sort()
print(l[0]+l[1])

p,q,r = map(int,input().split())
a = p+q
b = q+r
c = r+p
l=[a,b,c]
if max(l) == a:
  print(b+c)
elif max(l) == b:
  print(c+a)
else:
  print(a+b)

p,q,r = map(int,input().split())
a = p+q
b = q+r
c = r+p
l=[a,b,c]

print(min(l))

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):
distances = list(map(int, input().split()))
distances.sort()
ans = 0
for i in range(2):
  ans += distances
print(ans)

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

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):
from sys import stdin

P,Q,R = int(stdin.readline().rstrip().split())
print(min(P+Q,Q+R,P+R))

from sys import stdin

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

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)):
    if tmp>=B[i]:
        tmp = B[i]


print(tmp)

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 = int(input())
Q = int(input())
R = int(input())

Ans1 = P + Q
Ans2 = Q + R
Ans3 = R + P

if(Ans1 > Ans2):
	Ans1 = Ans2

if(Ans1 > Ans3):
	Ans1 = Ans3

print (Ans1)


P = int(input())
Q = int(input())
R = int(input())
 
Ans1 = P + Q
Ans2 = Q + R
Ans3 = R + P
 
if(Ans1 > Ans2):
	Ans1 = Ans2
 
if(Ans1 > Ans3):
	Ans1 = Ans3
 
print (Ans1)

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

Ans1 = P + Q
Ans2 = Q + R
Ans3 = R + P

if(Ans1 > Ans2):
	Ans1 = Ans2

if(Ans1 > Ans3):
	Ans1 = Ans3

print Ans1

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

Ans1 = P + Q
Ans2 = Q + R
Ans3 = R + P

if(Ans1 > Ans2):
	Ans1 = Ans2

if(Ans1 > Ans3):
	Ans1 = Ans3

print (Ans1)


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

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)

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)

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)

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


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

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)
    

data = list(map(int, input().split()))
n = len(data)
res = 300
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)
    

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 math
 
def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
 
def count_combinations(min_val, max_val):
    path_len = max_val - min_val - 2
    if path_len < 2:
        return 1
    twos = path_len // 2
    min_amount = twos + (path_len % 2)
    count = 0
    for i in range(min_amount, path_len + 1):
        count += comb(i, twos)
        twos -= 1
    return count
 
def conut_paths(a):
    paths = 1
    for i in range(len(a) - 1):
        paths *= count_combinations(a[i], a[i + 1])
    return paths % 1000000007
 
N, M = map(int, input().split())
A = [int(input()) for i in range(M)]
A.sort()
 
for i in range(1, M):
    if A[i - 1] + 1 == A[i]:
        print(0)
        exit()
 
A.insert(0, -1)
A.append(N + 1)
print(conut_paths(A))

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


line = input()
a, b, c = [int(n) for n in line.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)

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

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

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

subs = []
s = 0
for i in range(n):
    s += w[i]
    subs.append(s)

ans = 1000
for i in range(n-1):
    a = abs(subs[-1] - 2*subs[i])
    ans = min(ans, a)

print(ans)

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

print(min(min(p+q, q+r), p+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):
l = []
for i in range(3):
    l.append(int(input()))
l.sort()
print(l[0]+l[1])

l = input().split()
l.sort()
print(int(l[0])+int(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):
p = input('P:')
q = input('Q:')
r = input('R:')

ABC = p + q
BCA = q + r
CAB = r + p

min = ABC
if min > BCA:
  min = BCA
  
if min > CAB:
  min = CAB

print(min)

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


ABC = p + q
BCA = q + r
CAB = r + p

min = ABC
if min > BCA:
  min = BCA
  
if min > CAB:
  min = CAB

print(min)

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 = 1000000000
for t in range(1, n):
    left = sum(w[:t])
    right = sum(w[t:])
    ans = min(ans , abs(left - right))
print(ans)
        

n = int(input())
w = list(map(int,input().split()))
ans = 1000000000
for t in range(1, n):
    left = sum(w[:t])
    right = sum(w[t:])
    ans = min(ans , abs(left - right))
print(ans)
        

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

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, m = map(int, input().split())
a = []
for i in range(m):
  a.append(int(input()))
ans = 0
flag = 0
a = set(a)


dp = [0] * (n+1)
dp[0] = 1
if 1 in a:
  dp[1] = 0
else:
  dp[1] = 1
  
for i in range(2, n+1):
  if dp[i-2] == 0 and dp[i-1] == 0:
    ans = 0
    flag = 1
    break
  elif i in a:
    continue
  else:
    dp[i] = dp[i-1] + dp[i-2]
if flag == 0:
  ans = dp[n]
print(ans%(10**9+7))

num = [int(i) for i in input().split()]
print(min([num[0] + num[1], num[1] + num[2], num[2] + num[0]]))

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

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

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):
# -*- coding: utf-8 -*-
# abc129/abc129_a
import sys

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

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

main()


# -*- coding: utf-8 -*-
# abc129/abc129_a
import sys

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

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

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

#23:39
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):
a=list(map(int,input().split()))
a.sort
print(a[0:2])

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

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=[]
for i in range(m):
  a.append(int(input()))
a=set(a)
dp=[0]*(n+1)
dp[0]=1
if 1 in a:
  dp[1]=0
else:
  dp[1]=1
for i in range(2,n+1):
  if i in a:
    dp[i]=0
  else:
    dp[i]=dp[i-1]+dp[i-2]
print(dp[n]%1000000007)


n,m=map(int,input().split())
a=[int(input()) for i in range(m)]
mod=1000000007
dp=[1,1]
if 1 in a:
  dp[1]=0
for i in range(2,n+1):
  if i in a:
    dp.append(0)
  else:
    dp.append((dp[-1]+dp[-2])%mod)
print(dp[-1]%mod)

a=list(map(int,input().split()))
print(sum(a)-max(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):
a,b,c=map(int,input().split())
n=[a,b,c]
d=[]
for i in range(1,len(n)):
  d.append(n[i]+n[i])
print(min(d))

a,b,c=map(int,input(),.split())
n=[a,b,c]
d=[]
for i in range(1,len(n)):
  d.append(n[i]+n[i])
print(min(d))

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


Verdicts: 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):
n,m=map(int,input().split())
a=[]
b=[0]*(n+1)
b[0]=1
MOD=(10**9)+7

a.append(int(input()) for i in range(m))
  
if 1 not in a:
  b[1]=1
else:
  b[1]=0
  
for j in range(2,n+1):
  if j in a:
    continue
  else:
    b[j]=(b[j-1]+b[j-2])%MOD
    
print(b[n]%MOD)    
    
  
  
  



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

p,q,r=map(int,input().split())
print(sum([p,q,r])-max([p,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):
#nn
N,M=map(int,input().split())
a = [int(input()) for _ in range(M)]
dp = [0]*(N+1)
j = 0
dp[0] = 1
mod = 10**9+7
for i in range(1, N+1):
    if j < M and i == a[j]:
        j += 1
    elif i == 1:
        dp[i] = 1
    else:
        dp[i] = (dp[i-1]+dp[i-2]) % mod
print(dp[N])

times = list(map(int, input().strip().split()))

times.sort()
print(times[0] + times[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, M = map(int, input().split())
bre = []
flag = 0
A = []
for i in range(M):
    bre.append(int(input()))
#print(bre)
A.append(bre[0] - 1)
count = 0
if len(bre) >= 2:
    for i in range(len(bre) - 1):
        a = bre[i + 1] - bre[i]
        A.append(a - 2)
        if a == 1:
            #print(0)
            flag = 1
A.append(N - bre[len(bre) - 1] - 1)

if flag == 0:
    suu = [0, 1, 2]
    for i in range(2, max(A)+1):
        suu.append(suu[i] + suu[i-1] )
    
    for i in A:
        if count == 0:
            count = suu[i]
        else :
            count *= suu[i]
            count = count % 1000000007
    print(count)


N, M = map(int, input().split())
bre = []
flag = 0
A = []
for i in range(M):
    bre.append(int(input()))
#print(bre)
A.append(bre[0] - 1)
count = 0
if len(bre) >= 2:
    for i in range(len(bre) - 1):
        a = bre[i + 1] - bre[i]
        A.append(a - 2)
        if a == 1:
            #print(0)
            flag = 1
A.append(N - bre[len(bre) - 1] - 1)

if flag == 0:
    suu = [0, 1, 2]
    for i in range(2, max(A)):
        suu.append(suu[i] + suu[i-1] )
    
    for i in A:
        if count == 0:
            count = suu[i]
        else :
            count *= suu[i]
            count = count % 1000000007
    print(count % 1000000007)


N, M = map(int, input().split())
A = [0 for i in range(N + 2)]
A[0] = 0
A[1] = 1
for i in range(M):
    a = int(input()) + 1
    A[a] = -1
for i in range(2, N+2):
    if A[i] ==  -1:
        A[i] = 0
    else:
        A[i] = A[i-1]+ A[i-2]
        A[i] = A[i] % 1000000007
    #print(A)
print(A[N + 1])





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


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

a=list(map(int,input().split()))
a.remove(max(a))
print(sum(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()))
 
sum_W = sum(W)
add_W = 0
 
for i in range(N):
   add_W += W[i]
   if add_W >= sum_W - add_W:
       print(min(abs(add_W - sum_W + add_W), abs(add_W - W[i] - sum_W + add_W - W[i])))
       break

N = int(input())
W = list(map(int, input().split()))
 
sum_W = sum(W)
add_W = 0
 
for i in range(N):
   add_W += W[i]
   if add_W >= sum_W - add_W:
       print(min(abs(add_W - sum_W + add_W), abs(add_W - W[i] - sum_W + add_W - W[i])))
       break

i = list(map(int,input().split()));

i.sort();

print(i[0]+i[1]);

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

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