Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
s = input()

posA = 0
posZ = 0

for i in range(len(s)):
  if s[i] == "A":
    posA = i
    break
for j in range(len(s)):
  if s[-j-1] == "Z":
    posZ = N - 1 - j
    break

print(posZ - posA + 1)

Fixed submission:
s = input()
 
posA = 0
posZ = 0
 
for i in range(len(s)):
  if s[i] == "A":
    posA = i
    break
for j in range(len(s)):
  if s[-j-1] == "Z":
    posZ = len(s) - 1 - j
    break
 
print(posZ - posA + 1)
Buggy python submission (verdict: Runtime Error):
print(input().replace(",", " ")

Fixed submission:
print(input().replace(",", " "))
Buggy python submission (verdict: Runtime Error):
import math

N = int(input())
A = [int(a) for a in input().split(" ")]
ave = sum(A) / N
can1 = math.floor(ave)
can2 = math.ceil(ave)

cost1 = sum([(a - can1) ** 2 for a in A])
cost2 = sum([(a - can2) ** 2 for a in A])
print(min[cost1, cost2])

Fixed submission:
import math
 
N = int(input())
A = [int(a) for a in input().split(" ")]
ave = sum(A) / N
can1 = math.floor(ave)
can2 = math.ceil(ave)
 
cost1 = sum([(a - can1) ** 2 for a in A])
cost2 = sum([(a - can2) ** 2 for a in A])
print(min([cost1, cost2]))
Buggy python submission (verdict: Runtime Error):
dicta={'A':10,'B':11,'C':12,'D':13,'E':14,'F':15}
x=input()
y=input()
if dicta[x]<dicta[y]:
  print('<')
elif dicta[x]==dicta[y]:
  print('=')
else:
  print('>')

Fixed submission:
dicta={'A':10,'B':11,'C':12,'D':13,'E':14,'F':15}
x, y = input().split()
if dicta[x]<dicta[y]:
  print('<')
elif dicta[x]==dicta[y]:
  print('=')
else:
  print('>')
Buggy python submission (verdict: Runtime Error):
n=int(input())
m=int(input())
if (n==1 and m==2) or (n==2 and m==1):
  print('3')
elif (n==1 and m==3) or (n==3 and m==1):
  print('2')
elif (n=3and m==2) or (n==2 and m==3):
  print('1')

Fixed submission:
# cook your dish here
n=int(input())
m=int(input())
if (n==1 and m==2) or (n==2 and m==1):
  print('3')
elif (n==1 and m==3) or (n==3 and m==1):
  print('2')
elif (n==3 and m==2) or (n==2 and m==3):
  print('1')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
sum = 0
for i in range(n - 1):
    for j in range(i + 1, n):
        sum += (a[i] * a[j]) % (10**9 + 7)
        sum = sum % (10**9 + 7)
print(sum)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
sum = sum(a)
s = 0
c = 0
for i in range(n - 1):
    s += a[i]
    c = (c + (a[i] * (sum - s)))  % (10**9 + 7)
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
sum = 0
for i in range(n - 1):
    for j in range(i + 1, n):
        sum += a[i] * a[j]
print(sum % (10**9 + 7))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
sum = sum(a)
s = 0
c = 0
for i in range(n - 1):
    s += a[i]
    c = (c + (a[i] * (sum - s)))  % (10**9 + 7)
print(c)
Buggy python submission (verdict: Runtime Error):
t = input()
s = [i for i in t]
if s[0] == "?":
    if s[1] == "D":
        s[0] = "P"
    s[0] = "D"
for i in range(1, len(t) - 1):
    if s[i-1] == "D" and s[i+1] == "D":
        s[i] = "P"
    elif s[i-1] == "D" and s[i+1] == "?":
        s[i] = "P"
    else:
        s[i] = "D"
if s[-1] == "?":
    s[-1] = "D"
print("".join(s))

Fixed submission:
t = input()
s = [i for i in t]
if s[0] == "?":
    s[0] = "D"
for i in range(1, len(t) - 1):
    if s[i] == "?":
        if s[i-1] == "D" and s[i+1] == "D":
            s[i] = "P"
        elif s[i-1] == "p" and s[i+1] == "P":
            s[i] = "D"
        elif s[i-1] == "D" and s[i+1] == "?":
            s[i] = "P"
        elif s[i-1] == "P" and s[i+1] == "?":
            s[i] = "D"
        else:
            s[i] = "D"
if s[-1] == "?":
    s[-1] = "D"
print("".join(s))
Buggy python submission (verdict: Runtime Error):
k = int(input())
s = input()
l = len(s)
if (k >= l):
    print(s)
else:
    print(s[:k] + "...")

Fixed submission:
k = int(input())
s = input()
l = len(s)
if (l <= k):
    print(s)
else:
    print(s[:k] + "...")
Buggy python submission (verdict: Runtime Error):
a, b, c, k = map(int, input().split())
ans = 0
if k <= a:
    print(k)
else:
    k -= a
    ans += a
    if k <= b:
        print(ans)
    else:
        k -= b
        ans += -1 * k
        print(ans)


Fixed submission:
s = input()
t = input()
n = len(s)
a = [i for i in t]
if s == "".join(a[:n]):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
x = int(input())
for a in range(-10000, 10000):
    for b in range(-1000, 1000):
        if a**5 - b**5 == x:
            print(a, b)
            quit()

Fixed submission:
s = input()
print('ABC' if s == 'ARC' else 'ARC')

Buggy python submission (verdict: Runtime Error):
x = int(input())
for a in range(-1000, 1000):
    for b in range(-1000, 1000):
        if a**5 - b**5 == x:
            print(a, b)
            quit()

Fixed submission:
s = input()
print('ABC' if s == 'ARC' else 'ARC')
Buggy python submission (verdict: Time Limit Exceeded):
x = int(input())
for a in range(-10000, 10000):
    for b in range(-10000, 10000):
        if a**5 - b**5 == x:
            print(a, b)
            quit()

Fixed submission:
x = int(input())
for a in range(-1000, 1000):
    for b in range(-1000, 1000):
        if a**5 - b**5 == x:
            print(a, b)
            quit()

Buggy python submission (verdict: Time Limit Exceeded):
x = int(input())
a = int(x**0.2)
b = 0
while a**5 - b**5 != x:
    b -= 1
print(a, b)


Fixed submission:
x = int(input())
for a in range(-1000, 1000):
    for b in range(-1000, 1000):
        if a**5 - b**5 == x:
            print(a, b)
            quit()
Buggy python submission (verdict: Runtime Error):
S, W = map(int, input().split())
if S =< W:
    print("unsafe")
else:
    print("safe")


Fixed submission:
S, W = map(int, input().split())
if S <= W:
    print("unsafe")
else:
    print("safe")
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = input().split()
if sum(A) > N:
  print(-1)
else:
  print(N - sum(A))

Fixed submission:
N, M = map(int, input().split())
A = input().split()
if sum(int(i) for i in A) > N:
    print(-1)
else:
    print(N - sum(int(i) for i in A))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
for i in range(1, N+1):
    print(A.count(i))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
sub = []
for i in range(0, n):
    sub.append(0)
for j in a :
    sub[j - 1] += 1
for i in sub:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = input().split()
for i in range(1, N+1):
    print(A.count(str(i)))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
sub = []
for i in range(0, n):
    sub.append(0)
for j in a :
    sub[j - 1] += 1
for i in sub:
    print(i)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
count = 0
for i in range(1, N+1:
    for j in range(i + 1, N+1):
        for k in range(j + 1, N+1):
            if S[i-1] != S[j-1] and S[j-1] != S[k-1] and S[i-1] != S[k-1] and j - i != k - j:
                count += 1
print(count)

Fixed submission:
N = int(input())
if "7" in str(N):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
count = 0
for i in range(1, len(S)+1):
    for j in range(i + 1, len(S)+1):
        for k in range(j + 1, len(S)+1):
            if S[i-1] != S[j-1] and S[j-1] != S[k-1] and S[i-1] != S[k-1] and j - i != k - j:
                count += 1
print(count)

Fixed submission:
N = int(input())
if "7" in str(N):
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
count = 0
for i in range(1, len(S)+1):
    for j in range(i + 1, len(S)+1):
        for k in range(j + 1, len(S)+1):
            if S[i-1] != S[j-1] and S[j-1] != S[k-1] and S[i-1] != S[k-1] and j - i != k - j:
                count += 1
print(count)

Fixed submission:
N = int(input())
if "7" in str(N):
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
N, X, Y = map(int,input().split())
l = [0]*(N-1)
for i in range(1,N):
    for j in range(i+1,N+1):
        d=min(j-i,abs(X-i)+1+abs(Y-j),abs(Y-i)+1+abs(X-j))
        l[d-1] += 1
for k in range(N-1):
    print(l[k])

Fixed submission:
S = input()
if S[2] != S[3] or S[4] != S[5]:
  print("No")
else:
  print("Yes")

Buggy python submission (verdict: Runtime Error):
n,x,y = map(int,input().split())
m = {}
for i in range(1,n):
    m[i] = 0
for i in range(1,n):
    for j in range(i+1,n+1):
        dif = min(abs(j-i),(abs(x-i)+1+abs(j-y)),(abs(y-i)+1+abs(j-x)))
        m[dif]+=1
[print(m[i]) for i in range(1,n)]


Fixed submission:
S = input()
if S[2] != S[3] or S[4] != S[5]:
  print("No")
else:
  print("Yes")

Buggy python submission (verdict: Runtime Error):
N, X, Y = map(int,input().split())
l = [0]*(N-1)
for i in range(1,N):
    for j in range(i+1,N+1):
        d=min(j-i,abs(X-i)+1+abs(Y-j),abs(Y-i)+1+abs(X-j))
        l[d-1] += 1
for k in range(N-1):
    print(l[k])


Fixed submission:
S = input()
if S[2] != S[3] or S[4] != S[5]:
  print("No")
else:
  print("Yes")

Buggy python submission (verdict: Runtime Error):
N, X, Y = map(int,input().split())
l = [0]*(N-1)
for i in range(1,N):
    for j in range(i+1,N+1):
        d=min(j-i,abs(X-i)+1+abs(Y-j),abs(Y-i)+1+abs(X-j))
        l[d-1] += 1
for a in l:
    print(a)


Fixed submission:
S = input()
if S[2] != S[3] or S[4] != S[5]:
  print("No")
else:
  print("Yes")
Buggy python submission (verdict: Runtime Error):
X = input()
a = X // 500
b = X % 500
c = b // 5
print(a * 1000 + c * 5)

Fixed submission:
X = int(input())
a = X // 500
b = X % 500
c = b // 5
print(a * 1000 + c * 5)
Buggy python submission (verdict: Runtime Error):
S = input()
N = len(S)
if S == S[::-1] and S[:(N - 1)//2][::-1] == S[:(N - 1)//2] and S[(N + 3)//2][::-1] == S[(N + 3)//2]:
    print("Yes")
else:
    print("No")

Fixed submission:
from itertools import combinations
n, m = map(int, input().split())
r = []
i = 0
j = -1
c = 0
for _ in range(n):
    i += 2
    r.append(i)
for _ in range(m):
    j += 2
    r.append(j)
r.sort()
for k in list(combinations(r, 2)):
    if sum(k) % 2 == 0:
        c += 1

print(c)
Buggy python submission (verdict: Runtime Error):
S = input()
N = len(S)
print("Yes" if S == S[::-1] and S[:(N - 1)//2][::-1] == S[:(N - 1)//2] and S[(N + 3)//2][::-1] == S[(N + 3)//2] else "No")

Fixed submission:
s = input()
n = len(s)
if (s == s[::-1]):
    a = s[:(n-1)//2]
    if (a == a[::-1]):
        b = s[(n+3)//2-1:]
        if (b == b[::-1]):
            print("Yes")
            quit()
print("No")
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = list(map(int, input().split()))
if h == 0:
  print(sum(h))
elif h >= n:
  print(0)
else:
  h.sort()
  print(sum(h[:n-k]))


Fixed submission:
n, k = map(int, input().split())
h = list(map(int, input().split()))
if k == 0:
  print(sum(h))
elif k >= n:
  print(0)
else:
  h.sort()
  print(sum(h[:n-k]))
Buggy python submission (verdict: Runtime Error):
import math
a, b = map(int, input().split())
gcd = math.gcd(a, b)
ans = a*b/gcd
print(int(ans))


Fixed submission:
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
a, b = map(int, input().split())
print(int(a * b / gcd(a, b)))

Buggy python submission (verdict: Runtime Error):
import math
a, b = map(int, input().split())
print(int(a*b/math.gcd(a, b)))


Fixed submission:
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
a, b = map(int, input().split())
print(int(a * b / gcd(a, b)))
Buggy python submission (verdict: Runtime Error):
n = int(input())
for i in range(1, 10):
    for j in range(1, 10):
        if i * j == n:
            print('Yes')
            quit()
else:
    print('No')


Fixed submission:
a, b = map(int, input().split())
print(-1 if a not in range(1, 10) or b not in range(1, 10) else a*b)
Buggy python submission (verdict: Runtime Error):
 = int(input())
for i in range(1, 10):
    for j in range(1, 10):
        if i * j == n:
            print('Yes')
            quit()
else:
    print('No')


Fixed submission:
n = int(input())
for i in range(1, 10):
    for j in range(1, 10):
        if i * j == n:
            print('Yes')
            quit()
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
from collections import Counter
n, k, q = map(int, input().split())
a = [int(input()) for _ in range(q)]
ans = ['No'] * n
c = Counter(a)
for i in range(1, n+1):
    if c[i] > q - k:
        ans[i] = 'Yes'
for k in ans:
    print(k)


Fixed submission:
s = input()
if s == 'Sunny':
    print('Cloudy')
elif s ==  'Cloudy':
    print('Rainy')
else:
    print('Sunny')

Buggy python submission (verdict: Runtime Error):
s = input()
if s == 'Sunny':
    print('Cloudy')
elif s ==  'Cloudy':
    print('Rainy'):
else:
    print('Sunny')


Fixed submission:
s = input()
if s == 'Sunny':
    print('Cloudy')
elif s ==  'Cloudy':
    print('Rainy')
else:
    print('Sunny')
Buggy python submission (verdict: Runtime Error):
def tapdance(s):
    for i in range(len(s)):
        if i % 2 == 0:
            if s[i] = 'L':
                return 'No'
        else:
            if s[i] = 'R':
                return 'No'
    return 'Yes'
s = input()
print(tapdance(s))


Fixed submission:
def tapdance(s):
    for i in range(len(s)):
        if i % 2 == 0:
            if s[i] != 'R' and s[i] != 'U' and s[i] != 'D':
                return 'No'
        else:
            if s[i] != 'L' and s[i] != 'U' and s[i] != 'D':
                return 'No'
    return 'Yes'
s = input()
print(tapdance(s))
Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = map(int, input().split())
a = [int(input()) for _ in range(q)]
ans = [k-q] * n
for i in set(a):
    ans[i-1] += a.count(i)
for k in ans:
    if k > 0:
        print('Yes')
    else:
        print('No')
        

Fixed submission:
from collections import Counter
n, k, q = map(int, input().split())
a = [int(input()) for _ in range(q)]
ans = ['No'] * n
c = Counter(a)
for i in range(1, n+1):
    if c[i] > q - k:
        ans[i-1] = 'Yes'
for k in ans:
    print(k)

Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = map(int, input().split())
a = [int(input()) for _ in range(q)]
ans = [k-q] * n
for i in set(a):
    ans[i-1] += a.count(i)
for k in ans:
    if k > 0:
        print('Yes')
    else:
        print('No')
        

Fixed submission:
from collections import Counter
n, k, q = map(int, input().split())
a = [int(input()) for _ in range(q)]
ans = ['No'] * n
c = Counter(a)
for i in range(1, n+1):
    if c[i] > q - k:
        ans[i-1] = 'Yes'
for k in ans:
    print(k)

Buggy python submission (verdict: Time Limit Exceeded):
n, k, q = map(int, input().split())
a = [int(input()) for _ in range(q)]
for i in range(1, n+1):
    if k - q + a.count(i) > 0:
        print('Yes')
    else:
        print('No')


Fixed submission:
from collections import Counter
n, k, q = map(int, input().split())
a = [int(input()) for _ in range(q)]
ans = ['No'] * n
c = Counter(a)
for i in range(1, n+1):
    if c[i] > q - k:
        ans[i-1] = 'Yes'
for k in ans:
    print(k)
Buggy python submission (verdict: Runtime Error):
 = int(input())
b = list(map(int, input().split()))
if n == 2:
    print(b[0] * 2)
else:
    res = [0] * n
    for i in range(n-2):
        if b[i] < b[i+1]:
            res[i] = b[i]
            res[i+1] = b[i]
        else:
            res[i+1] = b[i+1]
    if b[-2] < b[-1]:
        res.append(b[-1])
    else:
        res[-1] = b[-1]
        res.append(b[-1])
    print(sum(res))


Fixed submission:
n = int(input())
b = list(map(int, input().split()))
if n == 2:
    print(b[0] * 2)
else:
    res = [0] * n
    res[0] = b[0]
    for i in range(n-2):
        if b[i] < b[i+1]:
            res[i+1] = b[i]
        else:
            res[i+1] = b[i+1]
    if b[-2] < b[-1]:
        res.append(b[-1])
    else:
        res.append(b[-1])
    print(sum(res))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
s = ["".join(sorted(input())) for _ in range(N)]
ans = 0
for i in set(s):
    n = s.count(i)
    ans += n * (n - 1) // 2
print(ans)


Fixed submission:
import collections
 
N = int(input())
s = ["".join(sorted(input())) for _ in range(N)]
c = collections.Counter(s)
ans = 0
for si in set(s):
    n = c[si]
    ans += n * (n - 1) // 2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = []
for i in range(n):
    s.append(''.join(sorted(input())))
ans = 0
s1 = set(s)
for i in s1:
    n = s.count(i) - 1
    ans += n * (n+1) / 2
print(int(ans))


Fixed submission:
import collections
 
N = int(input())
s = ["".join(sorted(input())) for _ in range(N)]
c = collections.Counter(s)
ans = 0
for si in set(s):
    n = c[si]
    ans += n * (n - 1) // 2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations
n = int(input())
s = []
for i in range(n):
    s.append(''.join(sorted(input())))
ans = 0
s1 = set(s)
for i in s1:
    n = s.count(i) - 1
    ans += n * (n+1) / 2
print(int(ans))


Fixed submission:
import collections
 
N = int(input())
s = ["".join(sorted(input())) for _ in range(N)]
c = collections.Counter(s)
ans = 0
for si in set(s):
    n = c[si]
    ans += n * (n - 1) // 2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations
n = int(input())
s = []
for i in range(n):
    s.append(''.join(sorted(input())))
ans = 0
s1 = set(s)
for i in s1:
    ans += sum([i for i in range(0, s.count(i))])
print(ans)


Fixed submission:
import collections
 
N = int(input())
s = ["".join(sorted(input())) for _ in range(N)]
c = collections.Counter(s)
ans = 0
for si in set(s):
    n = c[si]
    ans += n * (n - 1) // 2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations
n = int(input())
s = []
for i in range(n):
    s.append(''.join(sorted(input())))
ans = 0
s1 = set(s)
for i in s1:
    ans += len(list(combinations([i for i in range(s.count(i))], 2)))
print(ans)


Fixed submission:
import collections
 
N = int(input())
s = ["".join(sorted(input())) for _ in range(N)]
c = collections.Counter(s)
ans = 0
for si in set(s):
    n = c[si]
    ans += n * (n - 1) // 2
print(ans)
Buggy python submission (verdict: Runtime Error):
m = max(l)
ans = [m]*n
if len(set(l)) == 1:
    for i in ans:
        print(i)
else:
    x = sorted(set(l))[-2]
    a = l.index(m)
    ans[a] = x
    for i in ans:
        print(i)


Fixed submission:
n = int(input())
l = []
for i in range(n):
    l.append(int(input()))
m = max(l)
ans = [m]*n
if len(set(l)) == 1 or l.count(m) > 1:
    for i in ans:
        print(i)
else:
    x = sorted(set(l))[-2]
    a = l.index(m)
    ans[a] = x
    for i in ans:
        print(i)

Buggy python submission (verdict: Runtime Error):
n = int(input())
l = []
for i in range(n):
    l.append(int(input()))
m = max(l)
x = sorted(set(l))[-2]
ans = [m]*n
a = [index for index, value in enumerate(l) if value == m]
for i in a:
    ans[i] = x
[print(i) for i in ans]


Fixed submission:
n = int(input())
l = []
for i in range(n):
    l.append(int(input()))
m = max(l)
ans = [m]*n
if len(set(l)) == 1 or l.count(m) > 1:
    for i in ans:
        print(i)
else:
    x = sorted(set(l))[-2]
    a = l.index(m)
    ans[a] = x
    for i in ans:
        print(i)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
l = []
for i in range(N):
    A = int(input())
    l.append(A)
ans = [0]*N
m = max(l)
for i in range(N):
    n = l[i]
    if  n == m:
        l[i] = 0
        ans[i] = max(l)
        ans = ans[:i+1]
        ans.extend([n]*(N-i-1))
        break
    ans[i] = max(l)
[print(i) for i in ans]


Fixed submission:
n = int(input())
l = []
for i in range(n):
    l.append(int(input()))
m = max(l)
ans = [m]*n
if len(set(l)) == 1 or l.count(m) > 1:
    for i in ans:
        print(i)
else:
    x = sorted(set(l))[-2]
    a = l.index(m)
    ans[a] = x
    for i in ans:
        print(i)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
l = []
for i in range(N):
    A = int(input())
    l.append(A)
for i in range(N):
    b = l[i]
    l[i] = 0
    print(max(l))
    l[i] = b


Fixed submission:
n = int(input())
l = []
for i in range(n):
    l.append(int(input()))
m = max(l)
ans = [m]*n
if len(set(l)) == 1 or l.count(m) > 1:
    for i in ans:
        print(i)
else:
    x = sorted(set(l))[-2]
    a = l.index(m)
    ans[a] = x
    for i in ans:
        print(i)
Buggy python submission (verdict: Time Limit Exceeded):
L, R = map(int, input().split())
ans = []
for i in range(L, R):
    for j in range(L+1, R+1):
        ans.append((i*j)%2019)
print(min(ans))


Fixed submission:
L, R = map(int, input().split())
def mod(L, R):
    ans = []
    for i in range(L, R):
        for j in range(L+1, R+1):
            if (i*j)%2019 == 0:
                return 0
            ans.append((i*j)%2019)
    return min(ans)
print(mod(L, R))
Buggy python submission (verdict: Runtime Error):
a = list(map(int, intput().split()))
a.sort()
if a = [5, 5, 7]:
  print("YES")
else:
  print("NO")

Fixed submission:
a = list(map(int, input().split()))
a.sort()
if a == [5, 5, 7]:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
import sys

input = sys.stdin.readline

N, K = map(int, input().split())
p = list(map(int, input().split()))
l = [sum(i) for i in itertools.combinations(p, K)]
print(min(l))

Fixed submission:
N, K = map(int, input().split())
p = sorted(list(map(int, input().split())))
print(sum(p[:K]))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
from operator import mul
from functools import reduce

input = sys.stdin.readline
N = int(input())
a = list(map(int, input().split()))
l = (10 ** 18)
if 0 in a:
    print(0)
    exit()
c = reduce(mul, a)
if c > l:
    print(-1)
else:
    print(reduce(mul, a))

Fixed submission:
import sys

input = sys.stdin.readline

N = int(input())
a = list(map(int, input().split()))
if 0 in a:
    print(0)
    exit()
c = 1
l = 10 ** 18
for i in a:
    c *= i
    if c > l:
        print(-1)
        exit()

print(c)

Buggy python submission (verdict: Time Limit Exceeded):
from operator import mul
from functools import reduce
N = int(input())
a = list(map(int, input().split()))
l = (10**18)
if 0 in a:
    print(0)
    exit()
c = reduce(mul, a)
if c > l:
    print(-1)
else:
    print(reduce(mul, a))

Fixed submission:
import sys

input = sys.stdin.readline

N = int(input())
a = list(map(int, input().split()))
if 0 in a:
    print(0)
    exit()
c = 1
l = 10 ** 18
for i in a:
    c *= i
    if c > l:
        print(-1)
        exit()

print(c)

Buggy python submission (verdict: Time Limit Exceeded):
from operator import mul
from functools import reduce
N = int(input())
a = list(map(int, input().split()))
if 0 in a:
    print(0)
    exit()
c = reduce(mul, a)
if c > (10**18):
    print(-1)
else:
    print(reduce(mul, a))


Fixed submission:
import sys

input = sys.stdin.readline

N = int(input())
a = list(map(int, input().split()))
if 0 in a:
    print(0)
    exit()
c = 1
l = 10 ** 18
for i in a:
    c *= i
    if c > l:
        print(-1)
        exit()

print(c)

Buggy python submission (verdict: Time Limit Exceeded):
from operator import mul
from functools import reduce
N = int(input())
a = list(map(int, input().split()))
c = reduce(mul, a)
if c > (10**18):
    print(-1)
else:
    print(reduce(mul, a))

Fixed submission:
import sys

input = sys.stdin.readline

N = int(input())
a = list(map(int, input().split()))
if 0 in a:
    print(0)
    exit()
c = 1
l = 10 ** 18
for i in a:
    c *= i
    if c > l:
        print(-1)
        exit()

print(c)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = list(map(int, input().split()))
c = 1
for i in a:
    c *= i
if c > (10 ** 18):
    print(-1)
else:
    print(c)

Fixed submission:
import sys

input = sys.stdin.readline

N = int(input())
a = list(map(int, input().split()))
if 0 in a:
    print(0)
    exit()
c = 1
l = 10 ** 18
for i in a:
    c *= i
    if c > l:
        print(-1)
        exit()

print(c)