Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
s = list(input())[::-1]
word = ["dream", "dreamer", "erase", "eraser"]
dream = list("dream")[::-1]
dreamer = list("dreamer")[::-1]
erase = list("erase")[::-1]
eraser = list("eraser")[::-1]
while True:
    if s[:5] == dream or s[:5] == erase:
        s = s[5:]
        continue
    elif s[:6] == eraser:
        s = s[6:]
        continue
    elif s[:7] == dreamer:
        s = s[7:]
        continue
    break
if len(s) == 0:
    print("YES")
else:
    print("NO")

Fixed submission:
s = input()[::-1]
word = ["dream", "dreamer", "erase", "eraser"]
dream = "dream"[::-1]
dreamer = "dreamer"[::-1]
erase = "erase"[::-1]
eraser = "eraser"[::-1]
while True:
    if s[:5] == dream or s[:5] == erase:
        s = s[5:]
        continue
    elif s[:6] == eraser:
        s = s[6:]
        continue
    elif s[:7] == dreamer:
        s = s[7:]
        continue
    break
if len(s) == 0:
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Time Limit Exceeded):
s = list(input())[::-1]
word = ["dream", "dreamer", "erase", "eraser"]
while True:
    if "".join(s[:5][::-1]) == "dream" or "".join(s[:5][::-1]) == "erase":
        s = s[5:]
        continue
    elif "".join(s[:6][::-1]) == "eraser":
        s = s[6:]
        continue
    elif "".join(s[:7][::-1]) == "dreamer":
        s = s[7:]
        continue
    break
if len(s) == 0:
    print("YES")
else:
    print("NO")

Fixed submission:
s = input()[::-1]
word = ["dream", "dreamer", "erase", "eraser"]
dream = "dream"[::-1]
dreamer = "dreamer"[::-1]
erase = "erase"[::-1]
eraser = "eraser"[::-1]
while True:
    if s[:5] == dream or s[:5] == erase:
        s = s[5:]
        continue
    elif s[:6] == eraser:
        s = s[6:]
        continue
    elif s[:7] == dreamer:
        s = s[7:]
        continue
    break
if len(s) == 0:
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Time Limit Exceeded):
s = list(input())[::-1]
word = ["dream", "dreamer", "erase", "eraser"]
while True:
    if "".join(s[:5][::-1]) in word:
        del s[:5]
        continue
    elif "".join(s[:6][::-1]) == "eraser":
        del s[:6]
        continue
    elif "".join(s[:7][::-1]) == "dreamer":
        del s[:7]
        continue
    break
if len(s) == 0:
    print("YES")
else:
    print("NO")

Fixed submission:
s = input()[::-1]
word = ["dream", "dreamer", "erase", "eraser"]
dream = "dream"[::-1]
dreamer = "dreamer"[::-1]
erase = "erase"[::-1]
eraser = "eraser"[::-1]
while True:
    if s[:5] == dream or s[:5] == erase:
        s = s[5:]
        continue
    elif s[:6] == eraser:
        s = s[6:]
        continue
    elif s[:7] == dreamer:
        s = s[7:]
        continue
    break
if len(s) == 0:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
a, b, x = map(int, input().split())
baisu = x
count = 0
while baisu <= b:
    if baisu >= a:
        count += 1
    baisu += x

if a == 0:
    count += 1

print(count)

Fixed submission:
a, b, x = map(int, input().split())
ans_b = 1
ans_a = 1
ans_b += b // x
ans_a += a // x
if a % x == 0:
    print(ans_b-ans_a + 1)
else:
    print(ans_b-ans_a)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
x, y = 1, 1
for _ in range(n):
    t, a = map(int, input().split())
    if x <= t and y <= a:
        x = t
        y = a
    elif x <= t and y > a:
        i = 1
        while y > a:
            a //= i
            i += 1
            a *= i
        x = i*t
        y = a

    elif x > t and y <= a:
        i = 1
        while x > t:
            t //= i
            i +=1
            t *= i
        y = i*a
        x = t

    elif x > t and y > a:
        i = 1
        while x > t or y > a:
            t //= i
            a //= i
            i += 1
            t *= i
            a *= i
        x = t
        y = a

print(x+y)

Fixed submission:
n = int(input())
x, y = 1, 1
for _ in range(n):
    t, a = map(int, input().split())
    if x <= t and y <= a:
        x = t
        y = a
    elif x <= t and y > a:
        if y % a == 0:
            i = y // a
        else:
            i = y // a + 1
        y = i*a
        x = i*t
    elif x > t and y <= a:
        if x % t == 0:
            i = x // t
        else:
            i = x // t + 1
        x = i*t
        y = i*a
    elif x > t and y > a:
        if x % t == 0:
            i_x = x // t
        else:
            i_x = x // t + 1

        if y % a == 0:
            i_y = y // a
        else:
            i_y = y // a + 1
        bigger = max(i_x, i_y)
        x = bigger*t
        y = bigger*a
print(x+y)
Buggy python submission (verdict: Runtime Error):
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())
n, m = map(int, input().split())
uf = UnionFind(n)
 
for i in range(m):
    a, b = map(int, input().split())
    uf.union(a, b)
print(uf.group_count()-1)


Fixed submission:
import sys
sys.setrecursionlimit(10 ** 9)

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.root = [-1]*(n+1)
        self.rank = [0]*(n+1)

    def find(self, x):#親となる要素を探索
        if self.root[x] < 0:
            return x
        else:
            self.root[x] = self.find(self.root[x])#再帰
            return self.root[x]

    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return

        elif self.rank[x] > self.rank[y]:#深い木に連結
            self.root[x] += self.root[y]
            self.root[y] = x#yの親をxとする

        else:
            self.root[y] += self.root[x]
            self.root[x] = y
            if self.rank[x] == self.rank[y]:
                self.rank[y] += 1

    def issame(self, x, y):#x, yが同じ集合か判定
            return self.find(x) == self.find(y)


    def count(self, x):#要素の個数
        return (-1)*self.root[self.find(x)]

n, m = map(int, input().split())
uf = UnionFind(n)

for i in range(m):
    a, b = map(int, input().split())
    uf.unite(a-1, b-1)

ans = set()

for i in range(n):
    ans.add(uf.find(i))

print(len(ans)-1)
Buggy python submission (verdict: Time Limit Exceeded):
n,x,m= list(map(int, input().strip().split()))
a=[0]*(m)
for i in range(m):
    a[i]=i*i%m
a=list(set(a))
t=0
b=[]
b.append(x)
for i in range(m+1):
        b.append(b[-1]**2%m)
        if len(b)>len(list(set(b))):
            break
l=len(b)
for i in range(l-1):
    if b[i]==b[l-1]:
        q=i
w=l-2-q+1
s=0
for i in range(q):
    s+=b[i]
t=0
for i in range(q,l-1):
    t+=b[i]
u=(n-q)//w
v=(n-q)%w
ans=0
for i in range(q,q+v):
    ans+=b[i]
ans+=s+u*t

print(ans)
    


Fixed submission:
n,x,m= list(map(int, input().strip().split()))
t=0
b=[]
b.append(x)
for i in range(m+1):
        if b[-1]**2%m in b:
            b.append(b[-1]**2%m)
            break
        else:
            b.append(b[-1]**2%m)
        
l=len(b) 
for i in range(l-1):
    if b[i]==b[l-1]:
        q=i
w=l-2-q+1
s=0
for i in range(q):
    s+=b[i]
t=0
for i in range(q,l-1):
    t+=b[i]
u=(n-q)//w
v=(n-q)%w
ans=0
for i in range(q,q+v):
    ans+=b[i]
ans+=s+u*t

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,x,m= list(map(int, input().strip().split()))
a=[0]*(m)
for i in range(m):
    a[i]=i*i%m
a=list(set(a))
t=0
b=[]
b.append(x)
for i in range(m+1):
        b.append(b[-1]**2%m)
        if len(b)>len(list(set(b))):
            break
l=len(b)
for i in range(l-1):
    if b[i]==b[l-1]:
        q=i
w=l-2-q+1
s=0
for i in range(q):
    s+=b[i]
t=0
for i in range(q,l-1):
    t+=b[i]
u=(n-q)//w
v=(n-q)%w
ans=0
for i in range(q,q+v):
    ans+=b[i]
ans+=s+u*t

print(ans)
    

Fixed submission:
n,x,m= list(map(int, input().strip().split()))
t=0
b=[]
b.append(x)
for i in range(m+1):
        if b[-1]**2%m in b:
            b.append(b[-1]**2%m)
            break
        else:
            b.append(b[-1]**2%m)
        
l=len(b) 
for i in range(l-1):
    if b[i]==b[l-1]:
        q=i
w=l-2-q+1
s=0
for i in range(q):
    s+=b[i]
t=0
for i in range(q,l-1):
    t+=b[i]
u=(n-q)//w
v=(n-q)%w
ans=0
for i in range(q,q+v):
    ans+=b[i]
ans+=s+u*t

print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
mod=10**9+7
a=[0]*(n)
a[0]=0
a[1]=0
a[2]=1
if n<3:
    print(0)
else:
    for i in range(3,n):
        a[i]=(a[i-3]+a[i-1])%mod
    print(a[n-1])

Fixed submission:
n=int(input())
mod=10**9+7
if n<3:
    print(0)


else:
    a=[0]*(n)
    a[0]=0
    a[1]=0
    a[2]=1
    for i in range(3,n):
        a[i]=(a[i-3]+a[i-1])%mod
    print(a[n-1])

Buggy python submission (verdict: Runtime Error):
n=int(input())
mod=10**9+7
a=[0]*(n)
a[0]=0
a[1]=0
a[2]=1
if n<3:
    print(0)
else:
    for i in range(3,n):
        a[i]=(a[i-3]+a[i-1])%mod
print(a[n-1])

Fixed submission:
n=int(input())
mod=10**9+7
if n<3:
    print(0)


else:
    a=[0]*(n)
    a[0]=0
    a[1]=0
    a[2]=1
    for i in range(3,n):
        a[i]=(a[i-3]+a[i-1])%mod
    print(a[n-1])
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
x=[0]*n
y=[0]*n
z=[0]*n
a=-1
b=-1
for i in range(n):
    x[i],y[i] = list(map(int, input().strip().split()))
for i in range(n):
    z[i]=x[i]**2+y[i]**2
for i in range(n):
    if z[i]==max(z):
        a=i
        break
for i in range(n):
    if z[i]==min(z):
        b=i
        break
print(abs(x[a]-x[b])+abs(y[a]-y[b]))

    
    

Fixed submission:
n=int(input())
x=[0]*n
y=[0]*n
z=[]
w=[]
for i in range(n):
    x[i],y[i]= list(map(int, input().strip().split()))
    z.append(x[i]+y[i])
    w.append(x[i]-y[i])
a=max(z)-min(z)
b=max(w)-min(w)
print(max(a,b))
Buggy python submission (verdict: Runtime Error):
import numpy as np
n=int(input())
a= list(map(int, input().strip().split()))
a.sort()
b=1
for i in range(n):
    b*=a[i]
f=0#pairwise coprime
for i in range(n):
    if b%(a[i])**2==0:
        f=1
        break
b=np.gcd(a[0],a[1])
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
if f==0:
    print("pairwise coprime")

   

Fixed submission:
d,t,s= list(map(int, input().strip().split()))
x=t*s
if x>=d:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
s=input()
t=input()
L=len(s)
l=len(t)
X=[]
for i in range(L-l):
    x=0
    for j in range(l):
        if s[i+j]!=t[j]:
            x+=1
    X.append(x)
print(min(X))

Fixed submission:
s=input()
t=input()
L=len(s)
l=len(t)
X=[]
for i in range(L-l+1):
    x=0
    for j in range(l):
        if s[i+j]!=t[j]:
            x+=1
    X.append(x)
print(min(X))
Buggy python submission (verdict: Time Limit Exceeded):
n= int(input().strip())
a= list(map(int, input().strip().split()))
x=0
for i in range(n-1):
    for j in range(i+1,n):
        x+=(a[i]*a[j])%(10**9+7)
        x=x%(10**9+7)
print(x)

Fixed submission:
n= int(input().strip())
a= list(map(int, input().strip().split()))
x=0
A=0

for i in range(n):
    A+=a[i]
x=0
for i in range(n):
    x+=a[i]*(A-a[i])
x=x//2
x=x%(10**9+7)
print(x)

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

Fixed submission:
n= int(input().strip())
a= list(map(int, input().strip().split()))
x=0
A=0

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

    

for i in range(k,n):
    if b[i-1]<b[i]:
        print("Yes")
    else:
        print("No")

Fixed submission:
n,k= list(map(int, input().strip().split()))
a = list(map(int, input().strip().split()))
b=[1]*n

    
for i in range(k+1,n+1):
    b[i-1]=a[i-1]/a[i-k-1]

    

for i in range(k,n):
    if 1<b[i]:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
n,k= list(map(int, input().strip().split()))
a = list(map(int, input().strip().split()))
b=[1]*n
x=1
for i in range(k,n+1):
    for j in range(i-k,i):
        b[i-1]*=a[j]
    

for i in range(k,n):
    if b[i-1]<b[i]:
        print("Yes")
    else:
        print("No")

Fixed submission:
n,k= list(map(int, input().strip().split()))
a = list(map(int, input().strip().split()))
b=[1]*n

    
for i in range(k+1,n+1):
    b[i-1]=a[i-1]/a[i-k-1]

    

for i in range(k,n):
    if 1<b[i]:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
x=0
for i in range (N):
    n = N // (i+1)
    cnt = (n * (2 * (i+1) + (n - 1) * (i+1))) // 2  
    x += cnt
print(x)

Fixed submission:
N = int(input())
ans = 0
for i in range(1, N + 1):
    n = N // i  # 項数n
    cnt = (n * (2 * i + (n - 1) * i)) // 2  # 初項i, 項数n の等差数列の和の公式
    ans += cnt
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
def num_divisors_table(n):
    table = [0] * (n + 1)
    
    for i in xrange(1, n + 1):
        for j in xrange(i, n + 1, i):
            table[j] += 1
    
    return table
N = input()
x=0
for i in range(N):
    x+=(i+1)*(num_divisors_table(N+1)[i+1])
print(x)

Fixed submission:
N = int(input())
ans = 0
for i in range(1, N + 1):
    n = N // i  # 項数n
    cnt = (n * (2 * i + (n - 1) * i)) // 2  # 初項i, 項数n の等差数列の和の公式
    ans += cnt
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
def make_prime_list_2(num):
    if num < 2:
        return []

  
    prime_list = [i for i in range(num + 1)]
    prime_list[1] = 0 # 1は素数ではない
    num_sqrt = math.sqrt(num)

    for prime in prime_list:
        if prime == 0:
            continue
        if prime > num_sqrt:
            break

        for non_prime in range(2 * prime, num, prime):
            prime_list[non_prime] = 0

    return [prime for prime in prime_list if prime != 0]

def search_divisor_num_1(num):
    if num < 0:
        return None
    elif num == 1:
        return 1
    else:
        num_sqrt = math.floor(math.sqrt(num))
        prime_list = make_prime_list_2(num_sqrt)

        divisor_num = 1
        for prime in prime_list:
            count = 1
            while num % prime == 0:
                num //= prime
                count += 1
            divisor_num *= count

        if num != 1:
            divisor_num *= 2

        return divisor_num
N = int(input().strip())
x=0
for i in range(N):
    x+=search_divisor_num_1(i+1)*(i+1)
print(x)

Fixed submission:
N = int(input())
ans = 0
for i in range(1, N + 1):
    n = N // i  # 項数n
    cnt = (n * (2 * i + (n - 1) * i)) // 2  # 初項i, 項数n の等差数列の和の公式
    ans += cnt
print(ans)

Buggy python submission (verdict: Runtime Error):
import sympy
N = int(input().strip())
x=0
for i in range(N):
    x+=sympy.divisor_count(i+1)*(i+1)
print(x)

Fixed submission:
N = int(input())
ans = 0
for i in range(1, N + 1):
    n = N // i  # 項数n
    cnt = (n * (2 * i + (n - 1) * i)) // 2  # 初項i, 項数n の等差数列の和の公式
    ans += cnt
print(ans)
Buggy python submission (verdict: Runtime Error):
import collections
import math
def wa(n):
    m=int (math.sqrt(2*n))
   
    if m*(m+1)>2*n:
        return m-1
    else:
        return m
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
N = int(input().strip())
n=prime_factorize(N)
l=len(n)
c = collections.Counter(n)
m=n[l-1]
x=0
for i in range (m+1):
    x+=int(wa(c[i]))
    

print(x)


Fixed submission:
import math
n=int(input())
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

f=factorization(n) 
l=len(f)
x=0
for i in range(l):
    x+=int((-1+math.sqrt(1+8*f[i][1]))//2)
if n==1:
    x=0
print(x)

Buggy python submission (verdict: Runtime Error):
import collections
import math
def wa(n):
    m=int (math.sqrt(2*n))
   
    if m*(m+1)>2*n:
        return m-1
    else:
        return m
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
N = int(input().strip())
n=prime_factorize(N)
l=len(n)
c = collections.Counter(n)
m=n[l-1]
x=0
for i in range (m+1):
    x+=int(wa(c[i]))
    

print(x)


Fixed submission:
import math
n=int(input())
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

f=factorization(n) 
l=len(f)
x=0
for i in range(l):
    x+=int((-1+math.sqrt(1+8*f[i][1]))//2)
if n==1:
    x=0
print(x)
Buggy python submission (verdict: Time Limit Exceeded):
import math
N = int(input().strip())
a = list(map(int, input().strip().split()))
A=[0]*N
for i in range (N):
    for j in range (N-1):
        if a[j]==i+1:
            A[i]=A[i]+1
for i in range(N):
    print(A[i])


Fixed submission:
from collections import Counter

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

for i in range(1,N+1):
  print(A[i])

Buggy python submission (verdict: Time Limit Exceeded):
import math
N = int(input().strip())
a = list(map(int, input().strip().split()))
A=[0]*N
for i in range (N):
    for j in range (N-1):
        if a[j]==i+1:
            A[i]=A[i]+1
for i in range(N):
    print(A[i])

Fixed submission:
from collections import Counter

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

for i in range(1,N+1):
  print(A[i])
Buggy python submission (verdict: Time Limit Exceeded):
n=int (input())
a= list(map(int, input().strip().split()))
b=[0]*n
for i in range(n):
    for j in range(1,n+1):
        b[a[i]-1]=i+1
print(*b)

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

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

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

Fixed submission:
n, k, q = map(int, input().split())
b = [k - q] * n

for i in range(q):
    ai = int(input())
    b[ai - 1] += 1

for j in range(n):
    if b[j] > 0:
        print("Yes")
    else:
        print("No")

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

Fixed submission:
n, k, q = map(int, input().split())
b = [k - q] * n

for i in range(q):
    ai = int(input())
    b[ai - 1] += 1

for j in range(n):
    if b[j] > 0:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int, input().strip().split()))
m=max(a)
n=min(a)
b=0
for i in range(n,m+1):
  b=max(b,(a.count(i+1)+a.count(i)+a.count(i-1)))
print(b)

Fixed submission:
n=int(input())
a=list(map(int, input().strip().split()))
b=[0]*(10**5)
for i in range(n):
  b[a[i]]+=1
ma=0
for i in range(1,10**5-1):
    ma=max(b[i-1]+b[i]+b[i+1],ma)
print(ma)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int, input().strip().split()))
m=max(a)
n=min(a)
b=[]
for i in range(n,m+1):
    b.append(a.count(i-1)+a.count(i)+a.count(i+1))
print(max(b))

Fixed submission:
n=int(input())
a=list(map(int, input().strip().split()))
b=[0]*(10**5)
for i in range(n):
  b[a[i]]+=1
ma=0
for i in range(1,10**5-1):
    ma=max(b[i-1]+b[i]+b[i+1],ma)
print(ma)
Buggy python submission (verdict: Runtime Error):
if a%2==1 or b%2==1 or c%2==1:
    print(f)
elif a==b and b==c:
    f=-1
    print(f)
else:
    while a%2==0 and b%2==0 and c%2==0:
        A=a
        B=b
        C=c
        a=B//2+C//2
        b=A//2+C//2
        c=A//2+B//2
        f=f+1
    else:
        print(f)

Fixed submission:
a,b,c = list(map(int, input().strip().split()))
f=0
if a%2==1 or b%2==1 or c%2==1:
    print(f)
elif a==b and b==c:
    f=-1
    print(f)
else:
    while a%2==0 and b%2==0 and c%2==0:
        A=a
        B=b
        C=c
        a=B//2+C//2
        b=A//2+C//2
        c=A//2+B//2
        f=f+1
    else:
        print(f)
Buggy python submission (verdict: Runtime Error):
s= input().strip()
t= input().strip()

ls=len(s)
lt=len(t)
v=''
for i in range(ls):
    v+=s[i]+t[i]
if lt!=ls:
    v+=t[-1]
print(v)

Fixed submission:
s= input().strip()
t= input().strip()

ls=len(s)
lt=len(t)
v=''
for i in range(lt):
    v+=s[i]+t[i]
if lt!=ls:
    v+=s[-1]
print(v)
Buggy python submission (verdict: Runtime Error):
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, M = map(int, readline().split())
m = map(int, read().split())

count = [1] * (N+1)
red = [0] * (N+1)
red[1] = True
for x, y in zip(m, m):
    count[x] -= 1
    count[y] += 1
    if red[x]:
        red[y] = 1
    if not count[x]:
        red[x] = 0

print(sum(red))


Fixed submission:
a,b= list(map(int, input().strip().split()))
if a>0:
    print("Positive")
elif b<0:
    if (b-a)%2==0:
        print("Negative")
    else:
        print("Positive")
else:
    print("Zero")