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):
pqr = list(map(int, input().split()))
kumi = [(pqr[0], pqr[1]), (pqr[1], pqr[2]), (pqr[0], pqr[2])
seki = []
for c in kumi:
	seki.append(c[0]*c[1])
print(min(seki))

def main():
    p,q,r = map(int, input().split())
    min_time = min([p, q, r])
    print(min_time)

if __name__ == '__main__':
	main()

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

if __name__ == '__main__':
	main()

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

if __name__ == '__main__':
	main()

Verdicts: 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, Q, R = map(int, input().split())
times = [P, Q, R]
from itertools import combinations
 
min_ = 200
for i in combinations(times, r=2):
  j = sum(i)
  if j < max_:
    min_ = j

print(min_)

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

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

print(max)

P, Q, R = map(int, input().split())
times = [P, Q, R]
from itertools import combinations
 
min_ = 200
for i in combinations(times, r=2):
  j = sum(i)
  if j < min_:
    min_ = j
print(min_)

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

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

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


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

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


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


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())
p + q = a
q + r = b
r + p = c
print(min(a,min(b,c)))

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

diff=[]
for i in range(N-1):
    diff.append(abs(sum(W[:i+1])-sum(W[i+1:])))
print(min(diff))

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

A=sorted(A)
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):
S = [ int(x) for x in input().split() ]
print( sum( S ) - min( S ) )

S = [ int(x) for x in input().split() ]
print( sum( S ) - max( 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):
i = list(map(int, input().split()))
print(i)
i.sort()
print(i[0]+i[1])


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


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


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


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):
import heapq
pqr = list(map(int,input().split()))
sum(heapq.nlargest(2,pqr))

import heapq
pqr = list(map(int,input().split()))
print(sum(heapq.nsmallest(2,pqr)))


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 = [int(input()) for i in range(m)]
res_arr = [-1] * n

for i in a:
    res_arr[i] = 0

for i in range(1, n):
    if res_arr[i] == 0:
        next
    elif i == 1:
        res_arr[i] = 1
    elif i == 2:
        res_arr[i] = 1 + res_arr[i-1]
    else:
        res_arr[i] = res_arr[i-1] + res_arr[i-2]

res = res_arr[-1]+res_arr[-2]
if n == 1:
    res = res_arr[1]
elif n == 2:
    res = 1 + res_arr[1]
amari = res % 1000000007
print(amari)


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

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):
N, M = map(int, input().split())
status = [True]*(N+2)
for _ in range(M):
    status[int(input())] = False

dp = [0]*(N+2)
dp[0] = 1
for i in range(N):
    if status[i+1]:
        dp[i+1] += dp[i]
    if status[i+2]:
        dp[i+2] += dp[i]
print(dp[N])


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+s))

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

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

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):
# solution
import io

nim,mike = map(int,input().split())

sets={int(input()) for _ in range(mike)}

modulous=10**9+7

array=[0]*(nim+1)
array[0]=1
array[1]=1
if 1 in sets:
  array[1]=0

for i in range(2,nim+1):
  if i in sets:
    continue
  array[i]=(array[i-1]+array[i-2])%modulous
print(array[nim])

nancy = [int(_) for _ in input().split()]
nancy.sort()
print(nancy[0]+nancy[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())
a = int(p+q)
b = int(q+r)
c = int(r+p)
l = []
l.append(a)
l.append(b)
l.append(c)
print(min(l))

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


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())
lack = []
for _ in range(M):
    lack.append(int(input()))

def fib(n):
    memo=["EMPTY"]*(n+1)
    def inner(n):
        if n in lack:
            return 0
        elif n == 0:
            return 1
        elif n == 1:
            return 1
        elif memo[n] != "EMPTY":
            return memo[n]
        else:
            memo[n] = inner(n-1)+inner(n-2)
            return memo[n]
    return inner(n) %1000000007

print(fib(N)%1000000007)

N, M = map(int, input().split())
lack = []
for _ in range(M):
    lack.append(int(input()))

mod = 1000000007

def fib(n):
    memo=["EMPTY"]*(n+1)
    def inner(n):
        if n in lack:
            return 0
        elif n == 0:
            return 1
        elif n == 1:
            return 1
        elif memo[n] != "EMPTY":
            return memo[n]
        else:
            memo[n] = inner(n-1)+inner(n-2)
            return memo[n] % mod
    return inner(n)

print(fib(N)% mod)

P, Q, R = map(int, input().split())
lst = [P, Q, R]
lst = sorted(lst)
print(lst[0]+lst[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):
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

argv = sys.argv
a = []

P = int(argv[0])
Q = int(argv[1])
R = int(argv[2])

a.append(P)
a.append(Q)
a.append(R)
max = 0
for i in a:
    if max < i:
        max = i

print(sum(a)-max)

import sys

argv = sys.argv
a = []

P = int(argv[1])
Q = int(argv[2])
R = int(argv[3])

a.append(P)
a.append(Q)
a.append(R)
max = 0
for i in a:
    if max < i:
        max = i

print(sum(a)-max)

import sys

a = []


P, Q, R=map(int, input().split())
a.append(P)
a.append(Q)
a.append(R)
max = 0
for i in a:
    if max < i:
        max = i

print(sum(a)-max)

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

print(sum(data[:1]))

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

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


a=list(map(int,input().split()))
a.sort()
print(a[0]+a[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):
def dp(n):
    d=[0]*(n+1)
    if n==1:
        return 1
    else:
         d[0]=1
         if a[1]==0:
            d[1]=1
         else:
            d[1]=0
         for i in range(2,n+1):
            if a[i]==0:
                d[i]=(d[i-1]+d[i-2])%1000000007
            else:
                d[i]=0
         return d[n]

n,m=map(int, input().split())
a=[0]*(n+1)
for i in range(0,m):
    k=int(input())
    a[k]=1
print(dp(n))

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

P = int(STR[0])
Q = int(STR[1])
R = int(STR[2])

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

STR = input().split()

P = int(STR[0])
Q = int(STR[1])
R = int(STR[2])


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

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

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

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

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

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

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

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(A + B + C + max([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):
L = list(map(int, input().split()))
L.sort()
print(sum(L[1:]))

L = list(map(int, input().split()))
L.sort()
print(sum(L[:-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):
p=int(input())
q=int(input())
r=int(input())
if p+q<q+r and p+q<p+r:
    print(p+q)
else:
    print(q+r)



p=int(input())
q=int(input())
r=int(input())
if p+q<q+r and p+q<p+r:
    print(p+q)
if p+r<p+q and p+r<q+r:
    print(p+r)
else:
    print(q+r)



p=int(input())
q=int(input())
r=int(input())
if p+q<q+r and p+q<p+r:
    print(p+q)

else:
    print(q+r)



p=int(input())
q=int(input())
r=int(input())
if p+q<q+r and p+q<p+r:
    print(p+q)
if p+r<p+q and p+r<q+r:
    print(p+r)
if q+r<p+r and q+r<p+q:
    print(q+r)

p=int(input())
q=int(input())
r=int(input())
if p+q<q+r and p+q<p+r:
    print(p+q)
if q+r<p+q and p+r<q+r:
    print(p+r)
else:
    print(q+r)



p,q,r=map(int,input().split())
if p>=q and p>r:
    print(q+r)
if q>=r and q>p:
    print(p+r)
if r>=p and r>q:
    print(q+p)
if r==p and p==q:
    print(q+p)

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

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

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

if m > 0:
  As = set(map(int, sys.stdin))
else:
  As = set()

nums = [0] * (n + 1)
nums[0] = 1
if 1 in As:
  pass
else:
  nums[1] = 1
  
for i in range(2, n + 1):
  if i in As:
    continue
  else:
    nums[i] = (nums[i-1] + nums[i-2]) % 1000000007
    
print(nums[-1])

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):
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,b,c=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 = int(input())
Q = int(input())
R = int(input())

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

print(t1+t2)

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

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

print(t1+t2)

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

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

print(t1+t2)

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

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

print(t1+t2)

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

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

print(min(times))

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

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


l =[int(i) for i in 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):
time = list(map(int, input(),sprit()))
sum = time[0] + time[1]
if sum > time[1] + time[2]:
  sum = time[1] + time[2]
if sum > time[0] + time[2]:
  sum = time[0] + time[2]
print(sum)



time = list(map(int, input(),split()))
sum = time[0] + time[1]
if sum > time[1] + time[2]:
  sum = time[1] + time[2]
if sum > time[0] + time[2]:
  sum = time[0] + time[2]
print(sum)
 

time = list(map(int, input().split()))
sum = time[0] + time[1]
if sum > time[1] + time[2]:
  sum = time[1] + time[2]
if sum > time[0] + time[2]:
  sum = time[0] + time[2]
print(sum)

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):
from operator import mul
from functools import reduce

n, m = [int(i) for i in input().split()]
arr = [int(input()) for i in range(m)]
arr.append(n+1)
arr.insert(0, -1)
div_arr = [arr[i+1]-arr[i]-1 for i in range(len(arr)-1)]


def Fib(n):
    a, b = 0, 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

if 0 in div_arr:
  print(0)
else:
  print(reduce(mul, [Fib(i+1) for i in div_arr])%1000000007)

H,W = [int(i) for i in input().split()]
F = [list(input()) for i in range(H)]

lights_arr = []
for h in range(H):
  for w in range(W):
    if F[h][w] == ".":
      h_cnt = 0
      w_cnt = 0
      
      i = h
      while i < H:
        if F[i][w] == "#":
          break
        h_cnt += 1
        i += 1
        
      i = h
      while i >= 0:
        if F[i][w] == "#":
          break
        h_cnt += 1
        i -= 1
        
      j = w
      while j < W:
        if F[h][j] == "#":
          break
        w_cnt += 1
        j += 1
        
      j = w
      while j < W:
        if F[h][j] == "#":
          break
        w_cnt += 1
        j -= 1
       
      
      lights = h_cnt + w_cnt -3
      
      lights_arr.append(lights)
      
print(max(lights_arr))
 
        

import itertools

arr = [int(i) for i in input().split()]
arrs = list(itertools.combinations(arr,2))
sum_arr = [sum(com) for com in arrs]

print(min(sum_arr))

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):
from math import factorial
from operator import mul
from functools import reduce
from math import sqrt

def c(n,r):
  r = min(n-r,r)
  if r == 0 or r == n:
    return 1
  else:
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under
def num(k): 
  return int((((1+sqrt(5))/2) ** k - ((1-sqrt(5))/2) ** k) / sqrt(5))
  

n,m=map(int,input().split())
mod = 10 ** 9 + 7

if m == 0:
  print(num(n) % mod)
  exit()

a=[int(input()) for i in range(m)] 


a = [-1] + a + [n+1] # len(a)=m+2
sa = [a[i+1]-a[i]-2 for i in range(len(a)-1)]
ans = 1
#print(sa)
for i in sa:
  ans *= num(i)
  ans %= mod
print(ans)


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


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

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


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



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


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


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


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


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


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


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

n=max(p, q, r)


Print(p+q+r-n)




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

n=max(p, q, r)


Print str(p+q+r-n)



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


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


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


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


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


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

Verdicts: Runtime Error

Runtime Error

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 _ in range(m)]
   
s = [0 if n-i in a else -1 for i in range(n+1)] 
s[0] = s[1] = 1

for i in range(2, n+1):
    if s[i] == 0:
        continue
    s[i] = (s[i-1] + s[i-2]) % 1000000007

if s[n] < 0:
    print(0)
else:
    print(s[n])


#include <bits/stdc++.h> 
using namespace std; 
  
int countValues(int n) 
{ 
    int unset_bits=0; 
    while (n) 
    { 
        if ((n & 1) == 0) 
            unset_bits++; 
        n=n>>1; 
    } 
  
    return 1 << unset_bits; 
} 
  
int main() 
{ 
    int n;
  	cin >> n;
    cout << countValues(n) << endl; 
    return 0; 
} 



using namespace std; 
  
int countValues(int n) 
{ 
    int unset_bits=0; 
    while (n) 
    { 
        if ((n & 1) == 0) 
            unset_bits++; 
        n=n>>1; 
    } 
  
    return 1 << unset_bits; 
} 
  
int main() 
{ 
    int n;
  cin >> n;
    cout << countValues(n) << endl; 
    return 0; 
} 


n, m = map(int, input().split())
a = []
for _ in range(m):
    a.append(int(input()))
    
s = [0 if n-i in a else -1 for i in range(n+1)] 
s[0] = s[1] = 1

for i in range(2, n+1):
    if s[i] == 0:
        continue
    s[i] = (s[i-1] + s[i-2]) % 1000000007

print(s[n])

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

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

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

#include<string>
#include<cstdio>

#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>

#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>

#include<utility>

using namespace std;

typedef long long ll;
const ll mod = 1000000007;
const ll INF = mod * mod;
typedef pair<int, int> P;

#define rep(i,a,n) for(int i=a;i<n;i++)
#define rrep(i,a,n) for(int i=a:i<n;i--)

int main() {
	int a, b, c;
	cin >> a >> b >> c;
	cout << min({ a + b,b + c,c + a }) << endl;
}

a,b,c = map(int,input().split())
print(min(a+b,b+c,c+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, M = map(int, input().split())
NG = []
a = 10**9+7
for i in range(M):
  NG.append(int(input()))
ans = [0 for _ in range(N + 2)]
ans[0] = 1
for i in range(N):
  if not i + 1 in NG:
    ans[i + 1] = (ans[i + 1] + ans[i])%a
  if not i + 2 in NG:
    ans[i + 2] = (ans[i + 2] + ans[i])%a
print(ans[N])

P, Q, R = map(int, input().split())
print(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):
a = list(map(int,input().split()))
a.sorted()
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):
import numpy as np
NM = input()
N, M = NM.split(" ")
del NM
N, M = int(N), int(M)
broken_steps = [int(input()) for num in range(M)]
#all_steps = [num for num in range(N+1)]
all_steps = np.ones(N+1, dtype=np.int64)  
all_steps[broken_steps] = 0
ok_steps = list(all_steps)
#ok_steps = [0 if num in broken_steps else 1 for num in range(len(all_steps))]
#for num in range(len(all_steps)):

#    ok_steps.append(0)
#  else:
#  	ok_steps.append(1)

#print(ok_steps)
for num in range(0, len(ok_steps)):
  i = - (num + 1)
  
  if (i==-1 or i==-2):
    pass
  else:
    if ok_steps[i]==0:
      pass
    else:
      ok_steps[i] = ok_steps[i+1] + ok_steps[i+2]
      

#for num in range(0, len(ok_steps)):

#  
#  if (i==-1 or i==-2):

#  else:
#    if ok_steps[i]==0:

#    else:
#      print(i)
#      ok_steps[i] = ok_steps[i+1] + ok_steps[i+2]
#print(ok_steps[-3])        
print(ok_steps[0]%1000000007)

tmp0 = input()
P, Q, R = tmp0.split(" ")
del tmp0
P, Q, R = int(P), int(Q), int(R)
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())
a=[]
a.append(P)
a.append(Q)
a.append(R)
print(a)
a.sort()
print(a[0]+a[1])

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

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

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().split()))
P.sort()
print(P[0]+P[1])

P= list(map(int, input().split()))
P.sort()
print(P[0]+P[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=[int(x) for x in input().split()]
print(max(P+Q,Q+R,R+P))

P,Q,R=[int(x) for x in 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):
import numpy as np
n, m = [int(i) for i in input().split()]
a =[]
d = 1000000007

for i in range(m):
    a1=int(input())
    a.append(a1)

a.append(n+1)
a = np.array(a)
#print(a)

if 1 in a[1:]-a[:-1]:
    print(0)
    
elif m == 0:
    dp = [0] * (n + 1)
    dp[1] = 1
    dp[2] = 1
    for i in range(3, len(dp)):
        dp[i] = dp[i - 1] + dp[i - 2]
    print(dp[m])
    

else:
    dp = [0]*(n+1)
    dp[1]=1
    dp[2]=1
    for i in range(3,len(dp)):
        dp[i]=dp[i-1]+dp[i-2]
        #dp[i]=dp[i]%d

    ans = []
    pre = 0
    for i in range(len(a)):
        if i == 0:
            ans.append(a[i]-pre)
        else:
            ans.append(a[i]-pre-1)
        pre = a[i]

    #print(ans)
    x = 1
    for i in ans:
        x = x*dp[i]%d
    print(x)

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

l=[p,q,r]
print(sum(l)-max(l))

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

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

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

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

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

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

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 = set([int(x) for x in stdin.readline().rstrip().split()])
print(sum(L)-max(L))

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

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


m = 10**10
for i in range(1, N):
  a, b = 0, 0
  for j in range(i):
    a += W[j]
  for j in range(i, N):
    b += W[j]
  m = min(m, abs(a-b))
print(m)

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


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


Verdicts: Runtime Error

Accepted