Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
s = sum(A)
flag = False
for x in range(s, 0, -1):
    if flag:
        break
    sortedA = sorted([a%x for a in A])
    sumA = sum(sortedA)
    index_len = len(sortedA)
    sump = 0
    for i, a in enumerate(sortedA):
        sump += a
        summ = x*(index_len - (i+1)) - (sumA - sump)
        if sump == summ and sump <= K:
            print(x)
            flag = True
            break


Fixed submission:
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
s = sum(A)
flag = False
def make_divisors(n):
    divisors = []
    for i in range(int(n**0.5), 0, -1):
        if n%i == 0:
            divisors.append(i)
            if i != n//i:
                divisors.append(n//i)
    return sorted(divisors, reverse=True)
divs = make_divisors(s)
for x in divs:
    if flag:
        break
    sortedA = sorted([a%x for a in A])
    sumA = sum(sortedA)
    index_len = len(sortedA)
    sump = 0
    for i, a in enumerate(sortedA):
        sump += a
        summ = x*(index_len - (i+1)) - (sumA - sump)
        if sump == summ and sump <= K:
            print(x)
            flag = True
            break
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
B = [0]*N
n = N
for a in (reversed(A)):
    if n*2 > N:
        B[n-1] = a
        n -= 1
        continue
    total = 0
    for i in range(2,N+2):
        if n*i <= N:
            total += B[n*i-1]
        else:
            if a == total % 2:
                B[n-1] = 0
            else:
                B[n-1] = 1
    n -= 1

M = sum(B)
print(M)
C = [str(n+1) for n, v in enumerate(B) if v == 1]

print(' '.join(C))


Fixed submission:
N = int(input())
A = list(map(int, input().split()))
B = [0]*N
n = N
for a in (reversed(A)):
    if n*2 > N:
        B[n-1] = a
        n -= 1
        continue
    total = 0
    for i in range(2,N+2):
        if n*i <= N:
            total += B[n*i-1]
        else:
            if a == total % 2:
                B[n-1] = 0
            else:
                B[n-1] = 1
            break
    n -= 1

M = sum(B)
print(M)
C = [str(n+1) for n, v in enumerate(B) if v == 1]
print(' '.join(C))

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
B = [0]*N
n = N
for a in (reversed(A)):
    if n*2 > N:
        B[n-1] = a
        n -= 1
        continue
    total = 0
    for i in range(2,N+2):
        if n*i <= N:
            total += B[n*i-1]
        else:
            if a == total % 2:
                B[n-1] = 0
            else:
                B[n-1] = 1
    n -= 1

print(tmp)


Fixed submission:
N = int(input())
A = list(map(int, input().split()))
B = [0]*N
n = N
for a in (reversed(A)):
    if n*2 > N:
        B[n-1] = a
        n -= 1
        continue
    total = 0
    for i in range(2,N+2):
        if n*i <= N:
            total += B[n*i-1]
        else:
            if a == total % 2:
                B[n-1] = 0
            else:
                B[n-1] = 1
            break
    n -= 1

M = sum(B)
print(M)
C = [str(n+1) for n, v in enumerate(B) if v == 1]
print(' '.join(C))
Buggy python submission (verdict: Runtime Error):
N = int(input())
c = 0
tail_A = 0
head_B = 0
B_A = 0
def count(S):
    if len(S) == 1:
        return 0
    c = 0
    for i in range(len(S)-1):
        if S[i] == 'A' and S[i+1] == 'B':
            c += 1
    return c

for _ in range(N):
    s = input()
    c += count(s)
    if s[-1] == 'A':
        if s[0] == 'B':
            B_A += 1
        else:
            tail_A += 1
    else:
        if s[0] == 'B':
            head_B += 1

if tail_A > 0 and head_B > 0:
    c = c + B_A + 1
    tail_A -= 1
    head_B -= 1
elif tail_A == 0 and head_B > 0:
    c = c + B_A
    head_B -= 1
elif tail_A > 0 and head_B == 0:
    c = c + B_A
    tail_A -= 1
else:
    c = c + B_A - 1

c += min(tail_A, head_B)
print(c)


Fixed submission:
N, K = list(map(int, input().split()))
print(N-K+1)

Buggy python submission (verdict: Runtime Error):
N = int(input())
count = 0
tail_A = 0
head_B = 0
B_A = 0
for _ in range(N):
    s = input()
    count += s.count('AB')
    if s[-1] == 'A':
        if s[0] == 'B':
            B_A += 1
        else:
            tail_A += 1
    else:
        if s[0] == 'B':
            head_B += 1

if tail_A > 0 and head_B > 0:
    count = count + B_A + 1
    tail_A -= 1
    head_B -= 1
elif tail_A == 0 and head_B > 0:
    count = count + B_A
    head_B -= 1
elif tail_A > 0 and head_B == 0:
    count = count + B_A
    tail_A -= 1

count += min(tail_A, head_B)
print(count)


Fixed submission:
N, K = list(map(int, input().split()))
print(N-K+1)
Buggy python submission (verdict: Runtime Error):
from functools import reduce
def xor(i, k):
    return i^k
A, B = list(map(int, input().split()))
AB = list(range(A, B+1))
print(reduce(xor, AB))



Fixed submission:
def f(a):
    if a%4 == 0:
        return a
    elif a%4 == 1:
        return 1
    elif a%4 == 2:
        return a^1
    elif a%4 == 3:
        return 0
A, B = list(map(int, input().split()))
print(f(A-1)^f(B))
Buggy python submission (verdict: Runtime Error):
class Union_find(object):
    def __init__(self, N):
        #親の番号を格納する。親だった場合は-(その集合のサイズ)
        self.parent = [-1]*(N)
    #Aがどのグループに属するか
    def root(self, A):
        if self.parent[A] < 0:
            return A
        else:
            #親を繋ぎ変えて高速化
            self.parent[A] = self.root(self.parent[A])
            return self.parent[A]
    def size(self, A):
        return -self.parent[self.root(A)]
    # A,Bをくっつける
    def connect(self, A, B):
        # A,Bを直接つなぐのでなく、root(A),root(B)をつなぐ
        A = self.root(A)
        B = self.root(B)
        if A == B:
            return False
        # 大きい方に小さい方をくっつける
        if self.size(A) < self.size(B):
            A, B = B, A
        self.parent[A] += self.parent[B]
        self.parent[B] = A
        return True

N, M = list(map(int, input().split()))
A = []
B = []
for _ in range(M):
    a, b = list(map(int, input().split()))
    A.append(a-1)
    B.append(b-1)
uni = Union_find(N)
result = []
unconv = int(N*(N-1)/2)
for a, b in zip(reversed(A), reversed(B)):
    result.append(unconv)
    size_a = uni.size(a)
    size_b = uni.size(b)
    if uni.connect(a, b):
        unconv -= size_a*size_b
for r in reversed(result):
    print(r)


Fixed submission:
A, B, C = list(map(int, input().split()))
max_i = B//A
print(min(max_i, C))
Buggy python submission (verdict: Runtime Error):

def check(cx, cy, H, x, y, h):
    if (h == 0) and (abs(cx-x)+abs(cy-y) > H):
        return True
    if H-h == abs(cx-x)+abs(cy-y):
        return True
    else:
        return False

def a():
    N = int(input())
    xs = []
    ys = []
    hs = []
    for _ in range(N):
        i = input().split(' ')
        xs.append(int(i[0]))
        ys.append(int(i[1]))
        hs.append(int(i[2]))
    
    for i, h in enumerate(hs):
        if h==0:
            continue
        else:
            init_x = xs[i]
            init_y = ys[i]
            init_h = h
            break
    for cx in range(101):
        for cy in range(101):
                H = abs(cx-init_x)+abs(cy-init_y)+init_h
            flag_stop = False
            for x, y, h in zip(xs, ys, hs):
                if not check(cx, cy, H, x, y, h):
                    flag_stop = True
                    break
            if flag_stop:
                continue
            else:
                print('{} {} {}'.format(cx, cy, H))
                return
a()



Fixed submission:

def check(cx, cy, H, x, y, h):
    if (h == 0) and (abs(cx-x)+abs(cy-y) > H):
        return True
    if H-h == abs(cx-x)+abs(cy-y):
        return True
    else:
        return False

def a():
    N = int(input())
    xs = []
    ys = []
    hs = []
    for _ in range(N):
        i = input().split(' ')
        xs.append(int(i[0]))
        ys.append(int(i[1]))
        hs.append(int(i[2]))
    
    for i, h in enumerate(hs):
        if h==0:
            continue
        else:
            init_x = xs[i]
            init_y = ys[i]
            init_h = h
            break
    for cx in range(101):
        for cy in range(101):
            H = abs(cx-init_x)+abs(cy-init_y)+init_h
            flag_stop = False
            for x, y, h in zip(xs, ys, hs):
                if not check(cx, cy, H, x, y, h):
                    flag_stop = True
                    break
            if flag_stop:
                continue
            else:
                print('{} {} {}'.format(cx, cy, H))
                return
a()
Buggy python submission (verdict: Runtime Error):
from fractions import gcd
def fun():
    nx = input()
    N, X = nx.split(' ')
    N = int(N)
    X = int(X)
    cities = [int(c) for c in input().split(' ')]
    cities.append(X)
    x = sorted(cities)
    nx = x[1:]
    dist = [nn - x[i] for i, nn in enumerate(nx)]
    if N==1:
        print(dist[0])
        return
    min_gcd = 10000000000
    for i, d in enumerate(dist[:-1]):
        dp = dist[i+1]
        gc = gcd(d, dp)
        if gc < min_gcd:
            min_gcd = gc
    print(min_gcd)

fun()


Fixed submission:
s = input()
a,b = s.split(' ')
a = int(a)
b = int(b)
if (a%2 == 0) or (b%2 == 0):
    print('No')
else:
    print('Yes')

Buggy python submission (verdict: Runtime Error):
def main():
    N = int(input())
    W = []
    for n in range(N):
        W.append(input())
    for i, w in enumerate(W):
        if i==0:
            prev_w = w
            continue
        for wn in W[:i]:
            if w == wn:
                print('No')
                return 
        if prev_w[-1] != w[0]:
            print('No')
            return
        prev_w = w
    print('Yes')
    return

main()


Fixed submission:
s = input()
a,b = s.split(' ')
a = int(a)
b = int(b)
if (a%2 == 0) or (b%2 == 0):
    print('No')
else:
    print('Yes')

Buggy python submission (verdict: Runtime Error):
def main():
    N = int(input())
    W = []
    for n in range(N):
        W.append(input())
    for i, w in enumerate(W):
        prev_w = w
        if i==0:
            continue
        for wn in W[:i]:
            if w == wn:
                print('No')
                return 
        if prev_w[-1] != w[0]:
            print('No')
            return
    print('Yes')
    return

main()


Fixed submission:
s = input()
a,b = s.split(' ')
a = int(a)
b = int(b)
if (a%2 == 0) or (b%2 == 0):
    print('No')
else:
    print('Yes')

Buggy python submission (verdict: Runtime Error):
def main():
    N = int(input())
    W = []
    for n in range(N):
        W.append(input())
    for i, w in enumerate(W):
        prev_w = w
        if i==0:
            continue
        for wn in W[:i-1]:
            if w == wn:
                print('No')
                return 
        if prev_w[-1] != w[0]:
            print('No')
            return
    print('Yes')
    return

main()


Fixed submission:
s = input()
a,b = s.split(' ')
a = int(a)
b = int(b)
if (a%2 == 0) or (b%2 == 0):
    print('No')
else:
    print('Yes')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
arr = list(map(int, input().split()))
res = 0
for i in range(n):
    msum = 0
    if arr[i] != 0:
        for j in range(i+1, n):
            msum += arr[j]
        res += arr[i] * msum
res = res % (10**9 + 7)
print(res)
    


Fixed submission:
def findProductSum(A, n): 
    array_sum = sum(A)
    array_sum_square = array_sum ** 2
    individual_square_sum = 0
    for i in range(0, n, 1): 
        individual_square_sum += A[i] * A[i] 
    return (array_sum_square -
            individual_square_sum) // 2

n = input()
arr = list(map(int, input().split()))
res = findProductSum(arr, len(arr)) % (10**9 + 7)
print(res)
Buggy python submission (verdict: Runtime Error):
k = int(input())
if k % 2 == 0 or k % 5 == 0:
  print(-1)
else:
  myconst = 7 % k
  cnt = 1
  while True:
    if not myconst:
      print(cnt)
      break
	  else:
      myconst = ((10 * myconst) + 7) % k
    cnt += 1
 
      


Fixed submission:
k = int(input())
if k % 2 == 0 or k % 5 == 0:
  print(-1)
else:
  myconst = 7 % k
  cnt = 1
  while True:
    if not myconst:
      print(cnt)
      break
    else:
      myconst = ((10 * myconst) + 7) % k
    cnt += 1

Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())
if k % 2 == 0 or k % 5 == 0:
  print(-1)
else:
  myconst = 7
  cnt = 1
  while True:
    if myconst % k == 0:
      print(cnt)
      break
    else:
      myconst = (10 * myconst) + 7
    cnt += 1
 
      


Fixed submission:
k = int(input())
if k % 2 == 0 or k % 5 == 0:
  print(-1)
else:
  myconst = 7 % k
  cnt = 1
  while True:
    if not myconst:
      print(cnt)
      break
    else:
      myconst = ((10 * myconst) + 7) % k
    cnt += 1

Buggy python submission (verdict: Runtime Error):
k = int(input())
if k % 2 == 0 or k % 5 == 0:
  print(-1)
else:
  mystr = '7'
  while True:
    if int(mystr, 10) % k == 0:
      print(len(mystr))
      break
	else:
      mystr += '7'
 
      

Fixed submission:
k = int(input())
if k % 2 == 0 or k % 5 == 0:
  print(-1)
else:
  myconst = 7 % k
  cnt = 1
  while True:
    if not myconst:
      print(cnt)
      break
    else:
      myconst = ((10 * myconst) + 7) % k
    cnt += 1
Buggy python submission (verdict: Runtime Error):
n = int(input())
c = list(map(int, input().split()))
left = 0
cnt = 0
right = len(c) - 1
while left < n and right >=0 and left < right:
	while left < n and c[left] != 'W':
		left += 1
	while right >= 0 and c[right] != 'R':
		right -= 1
	if left< n and right >= 0 and left<right:
		c[left], c[right] = c[right], c[left]
		cnt += 1
		left += 1
		right -=1 
print(cnt)



Fixed submission:
n = int(input())
c = list(input())
left = 0
cnt = 0
right = len(c) - 1
while left < n and right >=0 and left < right:
    while left < n and c[left] != 'W':
        left += 1
    while right >= 0 and c[right] != 'R':
        right -= 1
    if left< n and right >= 0 and left<right:
        c[left], c[right] = c[right], c[left]
        cnt += 1
        left += 1
        right -=1 
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
s = [input() for i in range(2)] 
li = list(map(int, s[1].split()))
s0 = int(s[0])
f1 = 1
for i in range(s0):
    f1 = f1 * li[i]
if f1 > 1000000000000000000:
    print(-1)
if f1 <= 1000000000000000000:
    print(f1)

Fixed submission:
s = [input() for i in range(2)] 
li = list(map(int, s[1].split()))
s0 = int(s[0])
f1 = 1
if 0 in li:
    print(0)
if 0 not in li:
    for i in range(s0):
        f1 = f1 * li[i]
        if f1 > 1000000000000000000:
            print(-1)
            break
    if f1 <= 1000000000000000000:
        print(f1)

Buggy python submission (verdict: Time Limit Exceeded):
s = [input() for i in range(2)] 
li = list(map(int, s[1].split()))
s0 = int(s[0])
f1 = 1
for i in range(s0):
    f1 = f1 * li[i]
if f1 <= 1000000000000000000:
    print(f1)
if f1 > 1000000000000000000:
    print(-1)

Fixed submission:
s = [input() for i in range(2)] 
li = list(map(int, s[1].split()))
s0 = int(s[0])
f1 = 1
if 0 in li:
    print(0)
if 0 not in li:
    for i in range(s0):
        f1 = f1 * li[i]
        if f1 > 1000000000000000000:
            print(-1)
            break
    if f1 <= 1000000000000000000:
        print(f1)
Buggy python submission (verdict: Runtime Error):
a = [int(input()) for i in range(3)]
b = a[1]
c = a[1]
d = a[2]
if b == 7 or c == 7 or d == 7:
    print("Yes")
else:
    print("No")

Fixed submission:
a = str(input())
b = a[0]
c = a[1]
d = a[2]
if b == "7" or c == "7" or d == "7":
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
a = long(input())
j = 0
for i in range(a):
    if i%3==0:
        continue
    if i%5==0:
        continue
    else:
        j+=i
print(j)

Fixed submission:
a = int(input())
j = 0
for i in range(a + 1):
    if i%3!=0 and i%5!=0:
        j+=i
print(j)

Buggy python submission (verdict: Runtime Error):
a = input()
j = 0
for i in range(a):
    if i%3==0:
        continue
    if i%5==0:
        continue
    else:
        j+=i
print(j)

Fixed submission:
a = int(input())
j = 0
for i in range(a + 1):
    if i%3!=0 and i%5!=0:
        j+=i
print(j)

Buggy python submission (verdict: Runtime Error):
a = input()
j = 0
for i in range(a):
    if i%3==0:
        continue
    if i%5==0:
        continue
    else:
        j+=i
print(j)



Fixed submission:
a = int(input())
j = 0
for i in range(a + 1):
    if i%3!=0 and i%5!=0:
        j+=i
print(j)
Buggy python submission (verdict: Runtime Error):
N=int(int(input))
A=list(map(int,input().split()))
sum=sum[A]
b=0
c=0
for i in range(N-1):
    b+=A[i]
    c=(c+(A[i]*(sum-b))) %(10**9+7)
print(c)

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

Buggy python submission (verdict: Runtime Error):
N=int(int(input))
A=list(map(int,input().split()))
sum=sum[A]
b=0
c=0
for i in range(N-1):
    b+=A[i]
    c=(c+(A[i]*(sum-b))) %(10**9+7)
print(c)

Fixed submission:
N=int(input())
a=list(map(int, input().split()))
sum=sum(a)
b=0
c=0
for i in range(N-1):
    b+=a[i]
    c=(c+(a[i]*(sum-b))) %(10**9+7)
print(c)
Buggy python submission (verdict: Runtime Error):
str=input()
a=str.count("RRR")
b=str.count("RR")
if a==1:
  print(3)
elif b==1:
  print(2)
else:
  if s.count("R")>0:
    print(1)
  else:
    print(0)

Fixed submission:
s = input()
a = s.count("RRR")
b = s.count("RR")
if a == 1:
    print(3)
elif b == 1:
    print(2)
else:
    if s.count("R") > 0:
        print(1)
    else:
        print(0)
Buggy python submission (verdict: Runtime Error):
S , T = input().split(' ')
if S in T:
    print("Yes")
else:
    print("No")

Fixed submission:
S = input()
T = input()
if T[:-1] == S:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
S, T = input().split()
if S in T:
    print("Yes")
else:
    print("No")

Fixed submission:
S = input()
T = input()
if T[:-1] == S:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
G = int(input())
A, B = map(int,input().split())
Total = 'OK'
for i in range(A,B+1):
    if i% G != 0:
        Total = 'NG'
print(Total)

Fixed submission:
X = int(input())
Amount = 100
Year = 0
while Amount < X:
    P = Amount * 0.01
    if P >= 1:
        Amount+= int(P)
        Year+=1
print(Year)
Buggy python submission (verdict: Runtime Error):
from fractions import gcd

N = int(input())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7
l = 1
res = 0
for x in a:
  l = x * l // gcd(x, l)
for x in a:
  res += l//x
  res %= mod
print(res)

Fixed submission:
n,m = map(int,input().split())

if n==m:
    print("Yes")
else: print("No")
Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd

N = int(input())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7
l = 1
res = 0
for x in a:
  l = x * l // gcd(x, l)
for x in a:
  res += l//x
  res %= mod
print(res)

Fixed submission:
from fractions import gcd

N = int(input())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7
l = 1
res = 0
for x in a:
  l = x * l // gcd(x, l)
l %= mod
for x in a:
  res += l * pow(x, mod - 2, mod)
  res %= mod
print(res)

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd

N = int(input())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7
l = 1
res = 0
for x in a:
  l = x * l // gcd(x, l)
for x in a:
  res += l//x
  res %= mod
print(res)

Fixed submission:
from fractions import gcd

N = int(input())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7
l = 1
res = 0
for x in a:
  l = x * l // gcd(x, l)
l %= mod
for x in a:
  res += l * pow(x, mod - 2, mod)
  res %= mod
print(res)

Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
m = 1000000007
l = list(map(int,input().split()))
a,v=1,1
for i in l:
    b = math.gcd(a,i)
    a = ((a*i)%m)*(pow(b,m-2,m))%m

ans=0
for i in range(n):
    ans+=a*pow(l[i],m-2,m)
    ans=ans%m
print(ans)

Fixed submission:
from fractions import gcd

N = int(input())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7
l = 1
res = 0
for x in a:
  l = x * l // gcd(x, l)
l %= mod
for x in a:
  res += l * pow(x, mod - 2, mod)
  res %= mod
print(res)

Buggy python submission (verdict: Runtime Error):
import math
n = int(input())

l = list(map(int,input().split()))
a=1
for i in range(n):
    a = a*l[i]//int(math.gcd(a,i))
ans=0
for i in range(n):
    ans=(ans+a//l[i])%1000000007
print(ans)

Fixed submission:
from fractions import gcd

N = int(input())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7
l = 1
res = 0
for x in a:
  l = x * l // gcd(x, l)
l %= mod
for x in a:
  res += l * pow(x, mod - 2, mod)
  res %= mod
print(res)

Buggy python submission (verdict: Runtime Error):
import math
n = int(input())

l = list(map(int,input().split()))
a=1
for i in l:
    a = a*i//math.gcd(a,i)
ans=0
for i in range(n):
    ans=(ans+a//l[i])%1000000007
print(ans)

Fixed submission:
from fractions import gcd

N = int(input())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7
l = 1
res = 0
for x in a:
  l = x * l // gcd(x, l)
l %= mod
for x in a:
  res += l * pow(x, mod - 2, mod)
  res %= mod
print(res)
Buggy python submission (verdict: Runtime Error):
import math
n,m = map(int,input().split())
print(n*m//math.gcd(n,m))

Fixed submission:
import fractions
n,m = map(int,input().split())
print(n*m//fractions.gcd(n,m))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = [input() for _ in range(n)]


tmp = []
for i in s:
  if (i in tmp):
    continue
  else:
  	tmp.append(i)
    
print(len(tmp))

Fixed submission:
n = int(input())
s = [input() for _ in range(n)]
print(len(set(s)))

Buggy python submission (verdict: Time Limit Exceeded):
def judge(item,tmp):
  for i in tmp:
    if i == item:
      return False
  return True

n = int(input())
s = [input() for _ in range(n)]


tmp = []
for i in s:
  if judge(i,tmp):
  	tmp.append(i)
    
print(len(tmp))

Fixed submission:
n = int(input())
s = [input() for _ in range(n)]
print(len(set(s)))
Buggy python submission (verdict: Runtime Error):
s = input() #efabdd
t = input() #abcd
sl = len(s) #6
tl = input(t) #4
ans = tl #4
for i in range(sl-tl+1): #6-4+1 => 0, 1, 2
    c = 0
    for j in range(min(tl, sl): #min(4, 6) => 4
        if (s[i+j] != t[j]: #s[0] != t[0]..t[3]
            c += 1
    ans = min(c, ans) #min(0..4, 4)
print(ans)


Fixed submission:
s = input() #efabdd
t = input() #abcd
sl = len(s) #6
tl = len(t) #4
ans = tl #4
for i in range(sl-tl+1): #6-4+1 => 0, 1, 2
    c = 0
    for j in range(min(tl, sl)): #min(4, 6) => 4
        if (s[i+j] != t[j]): #s[0] != t[0]..t[3]
            c += 1
    ans = min(c, ans) #min(0..4, 4)
print(ans)
Buggy python submission (verdict: Runtime Error):
x, y = map(int, input().split())

ans = 'No'

for i in range(x + 1):
    j = x - a
    if (j*2 + i*4 == y):
        ans = "Yes"
print(ans)


Fixed submission:
x, y = map(int, input().split())

ans = 'No'

for i in range(x + 1):
    j = x - i
    if (j*2 + i*4 == y):
        ans = "Yes"
print(ans)

Buggy python submission (verdict: Runtime Error):
x, y = map(int, input().split())

ans = 'No'

for i in range(x + 1):
    j = x - a
    if (j*2 + i*4 == y):
        ans = "Yes"):
print(ans)


Fixed submission:
x, y = map(int, input().split())

ans = 'No'

for i in range(x + 1):
    j = x - i
    if (j*2 + i*4 == y):
        ans = "Yes"
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys

S = input()

s = []
for i in S:
    s.append(int(i))
count = 0

if (len(s) < 4 ):
    print(0)
    sys.exit()

for i in range(len(s)):
    j = i
    target = s[i]
    for k in range(len(s)-i):
        j += 1
        if(j >= len(s)):
            break
        target = target*10
        target += s[j]
        if ( target%2019 == 0):
            count += 1
print(count)


Fixed submission:
s, w = map(int, input().split())

if (s > w):
    print("safe")
else:
    print("unsafe")