Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import numpy as np

h, n = map(int, input().split())
ab = np.array([tuple(map(int, input().split())) for _ in range(n)])

a, b = ab[:, 0], ab[:, 1]
dp = np.zeros(h+1, dtype=int)
for i in range(1, h+1):
    dp[i] = np.min(dp[i-a] + b)

print(dp[-1])

Fixed submission:
import numpy as np

h, n = map(int, input().split())
ab = np.array([tuple(map(int, input().split())) for _ in range(n)])

a, b = ab[:, 0], ab[:, 1]
dp = np.zeros(h+1, dtype=np.int)
for i in range(1, h+1):
    dp[i] = np.min(dp[np.maximum(i-a, 0)] + b)

print(dp[h])

Buggy python submission (verdict: Runtime Error):
import numpy as np

h, n = map(int, input().split())
ab = np.array([tuple(map(int, input().split())) for _ in range(n)])

a, b = ab[:, 0], ab[:, 1]
dp = np.zeros(h+1, dtype=int)
for i in range(1, h+1):
    dp[i] = np.min(np.maximum(dp[i-a], 0) + b)

print(dp[h])

Fixed submission:
import numpy as np

h, n = map(int, input().split())
ab = np.array([tuple(map(int, input().split())) for _ in range(n)])

a, b = ab[:, 0], ab[:, 1]
dp = np.zeros(h+1, dtype=np.int)
for i in range(1, h+1):
    dp[i] = np.min(dp[np.maximum(i-a, 0)] + b)

print(dp[h])

Buggy python submission (verdict: Runtime Error):
import numpy as np

h, n = map(int, input().split())
ab = np.array([tuple(map(int, input().split())) for _ in range(n)])

a, b = ab[:, 0], ab[:, 1]
dp = np.zeros(2*h, dtype=int)
for i in range(1, h+1):
    dp[i] = np.min(dp[i-a] + b)

print(dp[h])

Fixed submission:
import numpy as np

h, n = map(int, input().split())
ab = np.array([tuple(map(int, input().split())) for _ in range(n)])

a, b = ab[:, 0], ab[:, 1]
dp = np.zeros(h+1, dtype=np.int)
for i in range(1, h+1):
    dp[i] = np.min(dp[np.maximum(i-a, 0)] + b)

print(dp[h])

Buggy python submission (verdict: Runtime Error):
import numpy as np

h, n = map(int, input().split())
a, b = zip(*[tuple(map(int, input().split())) for _ in range(n)])

npa, npb = np.array(a), np.array(b)
dp = np.zeros(h+1)
for i in range(1, h+1):
    dp[i] = np.min(dp[i-npa] + npb)

print(int(dp[h]))

Fixed submission:
import numpy as np

h, n = map(int, input().split())
ab = np.array([tuple(map(int, input().split())) for _ in range(n)])

a, b = ab[:, 0], ab[:, 1]
dp = np.zeros(h+1, dtype=np.int)
for i in range(1, h+1):
    dp[i] = np.min(dp[np.maximum(i-a, 0)] + b)

print(dp[h])

Buggy python submission (verdict: Runtime Error):
import numpy as np

h, n = map(int, input().split())
ab = list(tuple(map(int, input().split())) for _ in range(n))

sa, sb = 0, 0
for _, a, b in sorted((a/b, a, b) for a, b in ab, reversed=True):
    sa += a
    sb += b
    if sa >= h:
        print(sb)
        break


Fixed submission:
import numpy as np

h, n = map(int, input().split())
ab = np.array([tuple(map(int, input().split())) for _ in range(n)])

a, b = ab[:, 0], ab[:, 1]
dp = np.zeros(h+1, dtype=np.int)
for i in range(1, h+1):
    dp[i] = np.min(dp[np.maximum(i-a, 0)] + b)

print(dp[h])
Buggy python submission (verdict: Runtime Error):
x = input()

prefix = int(x[:-2])
suffix = int(x[-2:])

n = 0
for item in range(5, 0, -1):
    n += suffix // item
    suffix %= item

print(0 if n>prefix else 1)

Fixed submission:
import sys

x = input()

if len(x) < 3:
    print(0)
    sys.exit()

prefix = int(x[:-2])
suffix = int(x[-2:])

n = 0
for item in range(5, 0, -1):
    n += suffix // item
    suffix %= item

print(0 if n>prefix else 1)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
print(a＊b if 0<a<10 & 0<b<10 else -1)

Fixed submission:
a, b = map(int, input().split())
print(a*b if (0<a<10) & (0<b<10) else -1)
Buggy python submission (verdict: Runtime Error):
import bisect

n = int(input())
l = sorted([int(li) for li in input().split()])

sum = 0
for i in range(n-1,-1,-1):
    for j in range(i-1,-1,-1):
        k = bisect.bisect_right(l[j],l[i]-l[j])
        sum += j-k if j>k else 0

print(sum)


Fixed submission:
import bisect

n = int(input())
l = sorted([int(li) for li in input().split()])

sum = 0
for i in range(n-1,-1,-1):
    for j in range(i-1,-1,-1):
        k = bisect.bisect_right(l,l[i]-l[j])
        sum += j-k if j>k else 0

print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
import bisect

n = int(input())
l = sorted([int(li) for li in input().split()])

sum = 0
for i in range(n)[::-1]:
    for j in range(i)[::-1]:
        k = bisect.bisect_right(l[:j],l[i]-l[j])
        sum += j-k

print(sum)


Fixed submission:
import bisect

n = int(input())
l = sorted([int(li) for li in input().split()])

sum = 0
for i in range(n-1,-1,-1):
    for j in range(i-1,-1,-1):
        k = bisect.bisect_right(l,l[i]-l[j])
        sum += j-k if j>k else 0

print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
import bisect

n = int(input())
l = sorted([int(li) for li in input().split()])

sum = 0
for i in range(n)[::-1]:
    for j in range(i)[::-1]:
        k = bisect.bisect_right(l,l[i]-l[j])
        sum += len(l[k:j])

print(sum)


Fixed submission:
import bisect

n = int(input())
l = sorted([int(li) for li in input().split()])

sum = 0
for i in range(n-1,-1,-1):
    for j in range(i-1,-1,-1):
        k = bisect.bisect_right(l,l[i]-l[j])
        sum += j-k if j>k else 0

print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
def trianglable(a:int, b:int, c:int) -> bool:
    return (a < b + c) & (b < a + c) & (c < a + b)

n = int(input())
l = [int(li) for li in input().split()]

print(sum(trianglable(l[i],l[j],l[k]) for i in range(n) for j in range(i+1, n) for k in range(j+1, n)))


Fixed submission:
import bisect

n = int(input())
l = sorted([int(li) for li in input().split()])

sum = 0
for i in range(n-1,-1,-1):
    for j in range(i-1,-1,-1):
        k = bisect.bisect_right(l,l[i]-l[j])
        sum += j-k if j>k else 0

print(sum)
Buggy python submission (verdict: Runtime Error):
import numpy as np

def divisors(n):
    divs = set()
    for i in range(1,int(n**0.5)+1):
        if n % i == 0:
            divs |= {i, n//i}
    return sorted(divs)

def is_disjoint(n,m):
    return np.gcd(n,m) == 1

def appendable(list, n):
    return all(is_disjoint(l, n) for l in list)

#O(n**2)!
def filter_disjoint(divisors):
    list = []
    for d in divisors:
        if appendable(list, d):
            list.append(d) 
    return list


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

filterd = filter_disjoint(divisors(np.gcd(a,b)))
print(len(filterd))

Fixed submission:
def divisors(n):
    divs = set()
    for i in range(1,int(n**0.5)+1):
        if n % i == 0:
            divs |= {i, n//i}
    return sorted(divs)

def gcd(n,m):
    if m == 0:
        return n
    else:
        return gcd(m, n%m)

def is_disjoint(n,m):
    return gcd(n,m) == 1

def appendable(list, n):
    return all(is_disjoint(l, n) for l in list)

#O(n**2)!
def filter_disjoint(divisors):
    list = []
    for d in divisors:
        if appendable(list, d):
            list.append(d) 
    return list


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

filterd = filter_disjoint(divisors(gcd(a,b)))
print(len(filterd))

Buggy python submission (verdict: Runtime Error):
import math

def divisors(n):
    divs = set()
    for i in range(1,int(n**0.5)+1):
        if n % i == 0:
            divs |= {i, n//i}
    return sorted(divs)

def is_disjoint(n,m):
    return math.gcd(n,m) == 1

def appendable(list, n):
    return all(is_disjoint(l, n) for l in list)

#O(n**2)!
def filter_disjoint(divisors):
    list = []
    for d in divisors:
        if appendable(list, d):
            list.append(d) 
    return list


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

filterd = filter_disjoint(divisors(math.gcd(a,b)))
print(len(filterd))

Fixed submission:
def divisors(n):
    divs = set()
    for i in range(1,int(n**0.5)+1):
        if n % i == 0:
            divs |= {i, n//i}
    return sorted(divs)

def gcd(n,m):
    if m == 0:
        return n
    else:
        return gcd(m, n%m)

def is_disjoint(n,m):
    return gcd(n,m) == 1

def appendable(list, n):
    return all(is_disjoint(l, n) for l in list)

#O(n**2)!
def filter_disjoint(divisors):
    list = []
    for d in divisors:
        if appendable(list, d):
            list.append(d) 
    return list


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

filterd = filter_disjoint(divisors(gcd(a,b)))
print(len(filterd))
Buggy python submission (verdict: Runtime Error):
from sys import stdin
import math
inp = lambda : stdin.readline().strip()

t = int(inp())
for _ in range(t):
    s = inp()
    if s[2] == s[3] and s[4] == s[5]:
        print("Yes")
    else:
        print("No")

Fixed submission:
from sys import stdin
import math
inp = lambda : stdin.readline().strip()

s = inp()
if s[2] == s[3] and s[4] == s[5]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
X , K ,D = map(int, input().split())


if X>0:
    for k in range(K):
        bx = X
        X-=D
        if X<=0:
            break
else:
    for k in range(K):
        bx = X
        X+=D
        if X>=0:
            break

if K == k + 1 or (K-k-1)%2==0:
    print(abs(X))
else:
    print(abs(bx))

Fixed submission:
X , K ,D = map(int, input().split())


if X>0:
    S = int(abs(X) / D)
    aX = X -D * S
    if S>=K:
        print(X-D*K)
    elif (K-S)%2==0:
        print(abs(aX))
    else:
        print(abs(aX-D))
else:
    S = int(abs(X) / D)
    aX = X + D * S
    if S>=K:
        print(abs(X+D*K))
    elif (K-S)%2==0:
        print(abs(aX))
    else:
        print(abs(aX+D))
Buggy python submission (verdict: Runtime Error):
N,K = map(int, input().split())

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

sortp = sorted(p)

sum = sortp[0]+sortp[1]+sortp[2]

print(sum)

Fixed submission:
N,K = map(int, input().split())

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

sortp = sorted(p)
sum=0
for k in range(K):
    sum=sum+sortp[k]

print(sum)
Buggy python submission (verdict: Runtime Error):
X,N = map(int, input().split())
P = list(map(int, input().split()))
sortP = sorted(P)
if N==0:
    print(X)
elif sortP[0]>X:
    print(sortP[0]-1)
elif sortP[N-1]<X:
    print(sortP[N-1]+1)
else:
    for n in range(sortP[0],sortP[N-1]+2):
        if n in sortP:
            continue
        if n ==X:
            print(X)
        elif n>X:
            if X-a<=n-X:
                print(a)
                break
            else:
                print(n)
                break
        a = n

Fixed submission:
X,N = map(int, input().split())
P = list(map(int, input().split()))
sortP = sorted(P)
if N==0:
    print(X)
elif sortP[0]>X:
    print(X)
elif sortP[N-1]<X:
    print(X)
else:
    for n in range(sortP[0]-2,sortP[N-1]+2):
        if n in sortP:
            continue
        if n ==X:
            print(X)
            break
        elif n>X:
            if X-a<=n-X:
                print(a)
                break
            else:
                print(n)
                break
        a = n
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)
else:
    sum=reduce(mul,A)
    if sum>1000000000000000000:
        print(-1)
    else:
        print(sum)

Fixed submission:

N = int(input())
A = list(map(int, input().split()))
sum=1

if 0 in A:
    print(0)
else:
    for n in range(N):
        sum = sum * A[n]
        if sum>1000000000000000000:
            print(-1)
            break
    else:
        print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
from operator import mul
N = int(input())
from functools import reduce
A = list(map(int, input().split()))
sum=reduce(mul,A)

if sum>1000000000000000000:
    sum = -1

print(sum)

Fixed submission:

N = int(input())
A = list(map(int, input().split()))
sum=1

if 0 in A:
    print(0)
else:
    for n in range(N):
        sum = sum * A[n]
        if sum>1000000000000000000:
            print(-1)
            break
    else:
        print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

A = list(map(int, input().split()))
sum=1
for n in A:
    sum=sum*n

if sum>1000000000000000000:
    sum = -1

print(sum)




Fixed submission:

N = int(input())
A = list(map(int, input().split()))
sum=1

if 0 in A:
    print(0)
else:
    for n in range(N):
        sum = sum * A[n]
        if sum>1000000000000000000:
            print(-1)
            break
    else:
        print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

A = list(map(int, input().split()))
sum=1
for n in A:
    sum=sum*n

if sum>10**18:
    sum = -1

print(sum)

Fixed submission:

N = int(input())
A = list(map(int, input().split()))
sum=1

if 0 in A:
    print(0)
else:
    for n in range(N):
        sum = sum * A[n]
        if sum>1000000000000000000:
            print(-1)
            break
    else:
        print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

A = list(map(int, input().split()))
sum=1
for n in A:
    sum=sum*n

if sum>pow(10,18):
    sum = -1

print(sum)




Fixed submission:

N = int(input())
A = list(map(int, input().split()))
sum=1

if 0 in A:
    print(0)
else:
    for n in range(N):
        sum = sum * A[n]
        if sum>1000000000000000000:
            print(-1)
            break
    else:
        print(sum)
Buggy python submission (verdict: Runtime Error):
A,B,C,K = map(int, input().split())


if A >= K:
    print(K)
elif A+B >=K:
    print(A)
else:
    print(A-1*(A+B-k))



Fixed submission:
A,B,C,K = map(int, input().split())


if A >= K:
    print(K)
elif A+B >=K:
    print(A)
else:
    print(A+(A+B-K))

Buggy python submission (verdict: Runtime Error):
A,B,C,K = map(int, input().split())

sum = 0
li = [1] * A
Bli = [0] * B
Cli = [-1] * C

li.extend(Bli)
li.extend(Cli)

for k in range(K):
    sum = sum + li[k]

print(sum)


Fixed submission:
A,B,C,K = map(int, input().split())


if A >= K:
    print(K)
elif A+B >=K:
    print(A)
else:
    print(A+(A+B-K))
Buggy python submission (verdict: Runtime Error):
    import math
    R = int(input())
     
    l = 2 * R * math.pi
     
    print(l)

Fixed submission:
import math
R = int(input())

l = 2 * R * math.pi

print(l)
Buggy python submission (verdict: Time Limit Exceeded):

import itertools

K,S = map(int, input().split())
X = list(range(K+1))
count=0

for x,y in list(itertools.product(X, X)):
    if x+y <= S and x+y+K>=S:
        count+=1

print(count)

Fixed submission:
k,s = map(int, input().split())
cnt = 0

for x in range(k+1):
    for y in range(k+1):
        if 0 <= s-(x+y) <= k:
            cnt += 1




print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):

import itertools

K,S = map(int, input().split())
X = list(range(K+1))
count=0

for x,y in list(itertools.product(X, X)):
    if x+y <= S and x+y+K>=S:
        count+=1

print(count)

Fixed submission:
k,s = map(int, input().split())
cnt = 0

for x in range(k+1):
    for y in range(k+1):
        if 0 <= s-(x+y) <= k:
            cnt += 1




print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):

import itertools

K,S = map(int, input().split())
X = list(range(K+1))
count=0

for x,y,z in list(itertools.product(X, X, X)):
    if x+y+z == S:
        count+=1

print(count)

Fixed submission:
k,s = map(int, input().split())
cnt = 0

for x in range(k+1):
    for y in range(k+1):
        if 0 <= s-(x+y) <= k:
            cnt += 1




print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
def digits_of (n):
    digits = []
    while n != 0:
        r = n % 10 
        digits.append(r) 
        n = n // 10 
    return digits

def is_multiple_of_9 (n): 
    r = 0 
    for i in digits_of (n):
        r += i
    return r % 9 == 0 

def main():
  N = int(input())
  print("Yes" if is_multiple_of_9(N) else "No")

main()


Fixed submission:

def main():
  N = list(map(int,input()))
  print("Yes" if sum(N)%9==0 else "No")

main()
Buggy python submission (verdict: Runtime Error):
from numpy import max
from array import array
def main():
  n = int(input())
  As = list(map(int, input().split()))
  r = 0
  max_a = max(array('L', As))
  for i in range(n-1, 0, -1):
    if i == 0:
      break
    if As[i] < As[i-1]:
      if(max_a not in As[0:i-1]):
        max_a = As[i-1]
      r += max_a - As[i]
  print(r)

main()


Fixed submission:
def main():
  n = int(input())
  As = list(map(int, input().split()))
  r = 0
  max_a = 0
  for i in range(n):
    max_a = max(max_a, As[i])
    r += max_a - As[i]
  print(r)

main()
Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
N = int(input())
As = list(map(int,input().split()))
f = True
r = reduce(lambda x, y: x * y, As)

if 1000000000000000001 <= r:
  print("-1")
else:
  print(r)



Fixed submission:
N = int(input())
As = list(map(int,input().split()))
c = int(As[0])
i = 0
f = True
if 0 in As:
  print("0")
else:
  for x in As:
    if i == 0:
      i += 1
      continue
    c = c * x 
    if 1000000000000000001 <= c:
      print("-1")
      f = False
      break
  if f:
    print(c)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
As = list(map(int,input().split()))
c = int(As[0])
f = True
for x in range(N):
  if 0 in As:
    print("0")
    f = False
    break
  if x == 0:
    continue
  c = int(c) * int(As[x])
  if 1000000000000000001 <= c:
    print("-1")
    f = False
    break
if f:
  print(c)


Fixed submission:
N = int(input())
As = list(map(int,input().split()))
c = int(As[0])
i = 0
f = True
if 0 in As:
  print("0")
else:
  for x in As:
    if i == 0:
      i += 1
      continue
    c = c * x 
    if 1000000000000000001 <= c:
      print("-1")
      f = False
      break
  if f:
    print(c)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
As = list(map(int,input().split()))
c = int(As[0])
for x in range(N):
  if x == 0:
    continue
  c = int(c) * int(As[x])

if 1000000000000000001 <= c:
  print("-1")
else:
  print(c)


Fixed submission:
N = int(input())
As = list(map(int,input().split()))
c = int(As[0])
i = 0
f = True
if 0 in As:
  print("0")
else:
  for x in As:
    if i == 0:
      i += 1
      continue
    c = c * x 
    if 1000000000000000001 <= c:
      print("-1")
      f = False
      break
  if f:
    print(c)
Buggy python submission (verdict: Runtime Error):
def check(a):
  if a < 0:
    return a * -1
  else:
    return a

def main():
  K, N = map(int, input().split())
  As = list(map(int, input().split()))
  r = []
  for x in range(N-1, -1, -1):
    if As[x] == 0:
      r.append(check(K - As[x-1]))
      continue
    elif As[x-1] == 0:
      r.append(check(As[x]))
      continue
    solve = As[x] - As[x-1]
    r.append(check(solve))
  ans = sorted(r)
  print(K-ans)

if __name__ == "__main__":
  main()

Fixed submission:
def check(a):
  if a < 0:
    return a * -1
  else:
    return a

def main():
  K, N = map(int, input().split())
  As = list(map(int, input().split()))
  r = []
  r.append(K-As[-1]+As[0])
  for x in range(N-1, -1, -1):
    solve = As[x] - As[x-1]
    r.append(check(solve))
  ans = sorted(r)
  ans.remove(ans[-1])
  print(K-ans[-1])

if __name__ == "__main__":
  main()
Buggy python submission (verdict: Runtime Error):
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
a, b = map(int, input().split())
print(lcm(a, b))

Fixed submission:
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

def lcm(x, y):
    return (x * y)//gcd(x, y)
a, b = map(int, input().split())
print(lcm(a, b))
Buggy python submission (verdict: Runtime Error):
S = list(map(int,input().split()))
T = list(map(int,input().split()))
c = 0
for x in range(S):
  if S[x] == T[x]:
    c += 1
print(c)


Fixed submission:
S = list(input())
T = list(input())
c = 0
for x in range(len(S)):
  if S[x] == T[x]:
    c += 1
print(c)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
As = [int(input()) for _ in range(N)]
result = []
for x in range(N):
  as_tmp = list(As)
  del as_tmp[x]
  result.append(max(as_tmp))
print('\n'.join(map(str, result)))

Fixed submission:
N = int(input())
As = [int(input()) for _ in range(N)]
Bs = sorted(As,reverse=True)
for x in As:
  if x == Bs[0] and x != Bs[1]:
    print(Bs[1])
  else:
    print(Bs[0])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
As = [int(input()) for _ in range(N)]
as_tmp = list(As.copy())
for x in As:
  as_tmp.remove(x)
  print(max(as_tmp))
  as_tmp = list(As.copy())

Fixed submission:
N = int(input())
As = [int(input()) for _ in range(N)]
Bs = sorted(As,reverse=True)
for x in As:
  if x == Bs[0] and x != Bs[1]:
    print(Bs[1])
  else:
    print(Bs[0])
Buggy python submission (verdict: Runtime Error):
n,k = input().split()
s = list(input())
s[int(k)] = s[int(k)].lower()
print(''.join(s))

Fixed submission:
n,k = input().split()
s = list(input())
s[int(k)-1] = s[int(k)-1].lower()
print(''.join(s))
Buggy python submission (verdict: Runtime Error):
N = int(input())
values = list(map(int,input().split()))
costs = list(map(int,input().split()))
dictionary = {}
for v in range(N):
  dictionary.setdefault(values[v], []).append(costs[v])
revarse_keys = sorted(dictionary, reverse=True, key=int)
x,y = 0,0
for i in range(N):
  if revarse_keys[i] > int(dictionary[revarse_keys[i]][0]) and (i+1)<=N:
    x = revarse_keys[i]+revarse_keys[i+1]
    y = dictionary[revarse_keys[i]][0]+dictionary[revarse_keys[i+1]][0]
    break
print(x-y)



Fixed submission:
N = int(input())
values = list(map(int,input().split()))
costs = list(map(int,input().split()))
dictionary = []
for v in range(N):
  dictionary.append([values[v],costs[v]])
x,y=0,0
result = []
for i in range(N):
  if dictionary[i][0] - dictionary[i][1]>0:
    result.append(dictionary[i][0]-dictionary[i][1])
print(sum(result))
Buggy python submission (verdict: Runtime Error):
S = list(input())
acgt = ['A', 'C', 'G', 'T']
lengths = []
l = 0
for x in S:
  if x in acgt:
    l += 1
  else:
    lengths.append(l)
    l = 0
print(max(lengths))


Fixed submission:
S = list(input())
acgt = ['A', 'C', 'G', 'T']
lengths = []
l = 0
for x in S:
  if x in acgt:
    l += 1
  else:
    lengths.append(l)
    l = 0

if len(lengths) == 0 or l > 0:
  lengths.append(l)

print(max(lengths))

Buggy python submission (verdict: Runtime Error):
S = list(input())
acgt = ['A','C','G','T']
lengths = []
length = 0
for s in S:
  if s in acgt:
    length+=1
  else:
    lengths.append(length)
print(max(lengths))

Fixed submission:
S = list(input())
acgt = ['A', 'C', 'G', 'T']
lengths = []
l = 0
for x in S:
  if x in acgt:
    l += 1
  else:
    lengths.append(l)
    l = 0

if len(lengths) == 0 or l > 0:
  lengths.append(l)

print(max(lengths))
Buggy python submission (verdict: Runtime Error):
def main()
  a = input()
  b = input()

  if a/b == 0:
    print(a + b)
  else:
    print(b - a)

Fixed submission:
A, B = map(int, input().split())
print(A+B if B % A == 0 else B-A)

Buggy python submission (verdict: Runtime Error):


a = input()
b = input()

if  a/b == 0:
  print(a + b)
else:
  print(b - a)

Fixed submission:
A, B = map(int, input().split())
print(A+B if B % A == 0 else B-A)
Buggy python submission (verdict: Runtime Error):
N, M = map(int,input().split())
S = [0] * M
for i in range(N):
  A = list(map(int, input().split()))[1:]
  for j in A:
    S[j]=S[j]+1
for y in S:
  if y == N:
    print(y)

Fixed submission:
N, M = map(int,input().split())
S = [0] * M
for i in range(N):
  A = list(map(int, input().split()))[1:]
  for j in A:
    S[j-1]+=1

count = 0
for y in S:
  if y == N:
    count+=1

print(count)