Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n,q = map(int,input().split())
r = [[] for i in range(n)]
v = [0 for i in range(n)]

for i in range(n-1):
    a,b = map(int,input().split())
    r[a-1].append(b-1)

for i in range(q):
    p,x = map(int,input().split())
    v[p-1] += x


bfs = [0]
visit = [False in range(n)]
while len(bfs) != 0:
    tmp = []
    for i in bfs:
        for y in r[i]:
            if not visit[y]:
                v[y] += v[i]
                tmp.append(y)
        visit[i] = True
    bfs = tmp

#print(" ".join(map(str,v)))
print(*v)

Fixed submission:
n,q = map(int,input().split())
r = [[] for i in range(n+1)]
v = [0 for i in range(n+1)]

for i in range(n-1):
    a,b = map(int,input().split())
    r[a].append(b)

for i in range(q):
    p,x = map(int,input().split())
    v[p] += x


for i in range(1,n+1):

    for y in r[i]:
        v[y] += v[i]

print(" ".join(map(str,v[1:])))
Buggy python submission (verdict: Time Limit Exceeded):
import heapq

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

l = []
for i in range(n):
    ab = list(map(int,input().split()))
    l.append(ab)

l.sort()
q = []
ans = 0
for i in range(1,m+1):
    while len(l) > 0 and l[0][0] == i:
        tmp = l.pop(0)
        heapq.heappush(q,-tmp[1])
    
    if len(q) != 0:
        ans += -heapq.heappop(q)

print(ans)

Fixed submission:
import heapq

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

l = []
for i in range(n):
    ab = list(map(int,input().split()))
    l.append(ab)

l.sort()
q = []
ans = 0
cnt = 0
for i in range(1,m+1):
    while cnt < n and l[cnt][0] == i:
        heapq.heappush(q,-l[cnt][1])
        cnt += 1
    
    if len(q) != 0:
        ans += -heapq.heappop(q)

print(ans)
Buggy python submission (verdict: Runtime Error):
s = input() + "R"
v = [0 for i in range(len(s)-1)]

even = 0
odd = 0
lrpos = 0
lr = "R"

for i in range(len(s)):
    if lr != s[i]:
        if lr == "R":
            if even == odd:
                v[i-1] += even
                v[i] += odd
            else:
                v[i] += even
                v[i-1] += odd
        else:
            if even == odd:
                v[lrpos] += even
                v[lrpos-1] += odd
            else:
                v[lrpos-1] += even
                v[lrpos] += odd
        
        odd = 0
        even = 0
        lr = s[i]
        lrpos = i

    if even < odd:
        even += 1
    else:
        odd += 1
    
ans = " ".join(v)
print(ans)


Fixed submission:
s = input() + "R"
v = [0 for i in range(len(s)-1)]

even = 0
odd = 0
lrpos = 0
lr = "R"

for i in range(len(s)):
    if lr != s[i]:
        if lr == "R":
            if even == odd:
                v[i-1] += even
                v[i] += odd
            else:
                v[i] += even
                v[i-1] += odd
        else:
            if even == odd:
                v[lrpos] += even
                v[lrpos-1] += odd
            else:
                v[lrpos-1] += even
                v[lrpos] += odd
        
        odd = 0
        even = 0
        lr = s[i]
        lrpos = i

    if even < odd:
        even += 1
    else:
        odd += 1
    
ans = " ".join(map(str,v))
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = 10**9
    s = int(input())
    a,b = 0,0
    i = 1
    while True:
        if s % i == 0:
            if s // i <= N:
                a = i
                b = s//i
                break
        if i * i > s:break
        i+= 1
    print("0 0 {0} 0 0 {1}".format(str(a),str(b))) 


if __name__ == '__main__':
    main()

Fixed submission:
def main():
    s = int(input())
    N = 10**9

    y2 = 1
    y3 = s // N + 1
    x3 = N - s % N
    if y3 == N+1:
        y2 = 0
        y3 = N
        x3 = N
    
    print("0 0 1000000000 {} {} {}".format(str(y2),str(x3),str(y3))) 

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):

MOD = 10_0000_0007

def main():
    n,m = map(int,input().split())
    al = [False for _ in range(n+1)]
    for i in range(m):
        a = int(input())
        al[a] = True
    
    dp = [0 for _ in range(n+1)]
    dp[0] = 1
    dp[1] = 1 if al[1] == False else 0

    for i in range(2,n+1):
        if not al[i]:
            dp[i] = dp[i-2] + dp[i-1]

    print(dp[n] % MOD)


if __name__ == "__main__":
    main()

Fixed submission:
MOD = 1000000007

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

a = [0 for i in range(n+1)]
for i in range(m):
    a[int(input())] = 1

count = [0 for i in range(n+1)]
for i in range(1,n+1):
    if a[i] == 1:
        continue
    
    if i == 1:
        count[i] = 1 
    elif i == 2:
        count[i] = count[i-1] + 1
    else:
        count[i] = (count[i-1] + count[i-2]) % MOD

print(count[n])

Buggy python submission (verdict: Runtime Error):
import sys
input = sys.input.readline

MOD = 1000000007

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

count = [-1] * (n+1)
for i in range(m):
    count[int(input())] = 0

for i in range(1,n+1):
    if count[i] == 0:
        continue
    
    if i == 1:
        count[i] = 1 
    elif i == 2:
        count[i] = count[i-1] + 1
    else:
        count[i] = (count[i-1] + count[i-2]) % MOD

print(count[n])


Fixed submission:
MOD = 1000000007

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

a = [0 for i in range(n+1)]
for i in range(m):
    a[int(input())] = 1

count = [0 for i in range(n+1)]
for i in range(1,n+1):
    if a[i] == 1:
        continue
    
    if i == 1:
        count[i] = 1 
    elif i == 2:
        count[i] = count[i-1] + 1
    else:
        count[i] = (count[i-1] + count[i-2]) % MOD

print(count[n])
Buggy python submission (verdict: Runtime Error):

MOD = 1000000007

def main():
    n,m = map(int,input().split())
    al = [False for _ in range(n+1)]
    for i in range(m):
        a = int(input())
        al[a] = True
    
    dp = [0 for _ in range(n+1)]
    dp[0] = 1
    dp[1] = 1 if al[1] == False else 0

    for i in range(2,n+1):
        if not al[i]:
            dp[i] = (dp[i-2] + dp[i-1]) % MOD

    print(dp[n])


if __name__ == "__main__":
    main()

Fixed submission:
from fractions import gcd

def main():
    n = int(input())
    a = list(map(int,input().split()))

    lgcd = [0 for _ in range(n)]
    rgcd = [0 for _ in range(n)]
    for i in range(n):
        if i == 0:
            lgcd[i] = a[i]
            rgcd[-i-1] = a[-i-1]
        else:
            lgcd[i] = gcd(lgcd[i-1],a[i])
            rgcd[-i-1] = gcd(rgcd[-i],a[-i-1]) 
    
    ans = 0
    for i in range(n):
        if i == 0:
            ans = max(ans,rgcd[i+1])
        elif i == n-1:
            ans = max(ans,lgcd[i-1])
        else:
            ans = max(ans,gcd(lgcd[i-1],rgcd[i+1]))

    print(ans)

if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
n,p = map(int,input().split())

ans = 1
x = int(p ** (1/n)) +1

while x > 1:
    y = x ** n
    if p % y == 0:
        p //= y
        ans *= x
    else:
        x -= 1

print(ans)

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

ans = 1
x = int(p ** (1/n))

while x > 1:
    y = x ** n
    if p % y == 0:
        p //= y
        ans *= x
        if p == 1:
            break
    else:
        x -= 1

print(ans)
Buggy python submission (verdict: Runtime Error):
def main():
    n = int(input())
    a = list(map(int,input().split()))
    l = [0] * 8
    for v in a :
        l[v//400] += 1
    cnt = 0
    for v in range(len(l)-1):
        if v != 0: cnt+=1

    mx = cnt + l[-1]
    mn = cnt if cnt != 0 else 1 if l[-1] != 0 else 0
    print("{} {}".format(str(mn),str(mx)))

if __name__ == '__main__':
    main()

Fixed submission:
def main():
    _ = int(input())
    a = list(map(int,input().split()))
    l = [0] * 9
    for v in a :
        if v//400 >=8:
            l[-1] +=1
        else:
            l[v//400] += 1
    cnt = 0
    for i in range(len(l)-1):
        if l[i] != 0: cnt+=1

    mx = cnt + l[-1]
    mn = cnt if cnt != 0 else 1 if l[-1] != 0 else 0
    print("{} {}".format(str(mn),str(mx)))

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
MOD = 1000000007
n = int(input())
l = list(map(int,input().split()))
a = {}
for i in l:
    if i in a:
        a[i] += 1
    else:
        a[i] = 1

cur = 1 if n % 2 == 0 else 0

ok = True
while cur < n:
    x = 1 if cur == 0 else 2
    if a[cur] != x:
        ok = False
        break
    cur += 2

ans = 0
if ok:
    ans = 1
    for _ in range(n // 2):
        ans = ans * 2 % MOD

print(ans)

Fixed submission:
MOD = 1000000007
n = int(input())
l = list(map(int,input().split()))
a = {}
for i in l:
    if i in a:
        a[i] += 1
    else:
        a[i] = 1

cur = 1 if n % 2 == 0 else 0

ok = True
while cur < n:
    x = 1 if cur == 0 else 2
    if cur in a and a[cur] != x:
        ok = False
        break
    cur += 2

ans = 0
if ok:
    ans = 1
    for _ in range(n // 2):
        ans = ans * 2 % MOD

print(ans)
Buggy python submission (verdict: Runtime Error):
print(len(set(input().split()))

Fixed submission:
s = set(input().split())
print(len(s))
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(1000000)
 
def xgcd(a, b):
    x0, y0, x1, y1 = 1, 0, 0, 1
    while b != 0:
        q, a, b = a // b, b, a % b
        x0, x1 = x1, x0 - q * x1
        y0, y1 = y1, y0 - q * y1
    return a, x0, y0
 
def modinv(a, m):
    g, x, y = xgcd(a, m)
    if g != 1:
        raise Exception('modular inverse does not exist')
    else:
        return x % m
 
def combination(n,r,q):
    if r==1:
        return n%q
 
    return ((n*combination(n-1,r-1,q)%q)*modinv(r,q))%q
 
def _input():
    return list(map(int, input().split()))
 
def main():
    i=_input()
    x,y=i[0],i[1]
    if 2*y>=x and 2*x>=y and (2*y-x)%3==0 and (2*x-y)%3==0:
        n=(2*y-x)//3
        m=(2*x-y)//3
        print(int(combination(n+m,min(m,n),1000000007)))
    else:
        print(0)
 
if __name__ == "__main__":
    main()


Fixed submission:
import sys
sys.setrecursionlimit(1000000)
 
def xgcd(a, b):
    x0, y0, x1, y1 = 1, 0, 0, 1
    while b != 0:
        q, a, b = a // b, b, a % b
        x0, x1 = x1, x0 - q * x1
        y0, y1 = y1, y0 - q * y1
    return a, x0, y0
 
def modinv(a, m):
    g, x, y = xgcd(a, m)
    if g != 1:
        raise Exception('modular inverse does not exist')
    else:
        return x % m
 
def combination(n,r,q):
    if r==0:
        return 1
 
    return ((n*combination(n-1,r-1,q)%q)*modinv(r,q))%q
 
def _input():
    return list(map(int, input().split()))
 
def main():
    i=_input()
    x,y=i[0],i[1]
    if 2*y>=x and 2*x>=y and (2*y-x)%3==0 and (2*x-y)%3==0:
        n=(2*y-x)//3
        m=(2*x-y)//3
        print(int(combination(n+m,min(m,n),1000000007)))
    else:
        print(0)
 
if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
A=list(map(int,input().split()))
x=0
for i in range(n-1):
  for j in range(i+1,n):
    x+=A[i]*A[j]%(10**9+7)
print(x%(10**9+7))

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

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

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

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

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

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

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

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
n=int(input())
A=list(map(int,input().split()))
AC=list(itertools.combinations(A,2))
for i in range(len(AC)):
  AC[i]=AC[i][0]*AC[i][1]%(10**9+7)
print(sum(AC)%(10**9+7))

Fixed submission:
n=int(input())
A=list(map(int,input().split()))
sumA=sum(A)
x=0
for i in range(n-1):
  sumA-=A[i]
  x+=A[i]*sumA
print(x%(10**9+7))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
for i in range(1,n+1):
  ans=0
  for x in range(1,round(i**0.5)+1):
    for y in range(1,round(i**0.5)+1):
      for z in range(1,round(i**0.5)+1):
        if x*x+y*y+z*z+x*y+y*z+z*x==i:
          ans+=1
  print(ans)

Fixed submission:
n=int(input())
A=[0]*(n+1)
a=round(n**0.5)+1
for x in range(1,a):
  for y in range(1,a):
    for z in range(1,a):
      b=x*x+y*y+z*z+x*y+y*z+z*x
      if b<n+1:
        A[b]+=1
for i in range(1,n+1):
  print(A[i])
Buggy python submission (verdict: Time Limit Exceeded):
def main():
  N=int(input())
  A=list(map(int,input().split()))
  x=0
  for i in range(N):
    for j in range(N):
      if i==j:
        pass
      elif A[i]%A[j]==0:
        break
    else:
      x+=1
  print(x)
main()

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
AM=max(A)+1
B=[0]*AM
x=0
for i in A:
  for j in range(i,AM,i):
    B[j]+=1
for i in A:
  if B[i]==1:
    x+=1
print(x)

Buggy python submission (verdict: Runtime Error):
def main()
  N=input()
  A=sorted(map(int,input().split()))
  M=A[-1]+1
  B=[0]*M
  for i in A:
    B[i]+=1
    if B[i]==1:
      for j in range(i*2,M,i):
        B[j]=2
  print(B.count(1))
main()

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
AM=max(A)+1
B=[0]*AM
x=0
for i in A:
  for j in range(i,AM,i):
    B[j]+=1
for i in A:
  if B[i]==1:
    x+=1
print(x)

Buggy python submission (verdict: Runtime Error):
def m()
  N=input()
  A=sorted(map(int,input().split()))
  M=A[-1]+1
  B=[0]*M
  for i in A:
    B[i]+=1
    if B[i]==1:
      for j in range(i*2,M,i):
        B[j]=2
  print(B.count(1))
m()

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
AM=max(A)+1
B=[0]*AM
x=0
for i in A:
  for j in range(i,AM,i):
    B[j]+=1
for i in A:
  if B[i]==1:
    x+=1
print(x)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
x=0

for i in range(N):
  for j in range(N):
    if i==j:
      pass
    elif A[i]%A[j]==0:
      break
  else:
    x+=1

print(x)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
AM=max(A)+1
B=[0]*AM
x=0
for i in A:
  for j in range(i,AM,i):
    B[j]+=1
for i in A:
  if B[i]==1:
    x+=1
print(x)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))
x=0

for i in range(N):
  for j in range(N):
    if i==j:
      pass
    elif A[i]%A[j]==0:
      break
  else:
    x+=1

print(x)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
AM=max(A)+1
B=[0]*AM
x=0
for i in A:
  for j in range(i,AM,i):
    B[j]+=1
for i in A:
  if B[i]==1:
    x+=1
print(x)
Buggy python submission (verdict: Runtime Error):
from decimal import Decimal
N=int(input())
A=[*map(str,input().split())]
a=Decimal('1')
while A:
  a=a*Decimal(A.pop())
  if a > Decimal('10'**'18'):
    print(-1)
    break
else:
  print(a)

Fixed submission:
N=int(input())
A=[*map(int,input().split())]
a=1
if 0 in A:
  a=0
else:
  while A:
    a*=A.pop()
    if a>10**18:
      a=-1
      break
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[*map(int,input().split())]
a=1
while A:
  a*=A.pop()
if a > 10**18:
  print(-1)
else:
  print(a)

Fixed submission:
N=int(input())
A=[*map(int,input().split())]
a=1
if 0 in A:
  a=0
else:
  while A:
    a*=A.pop()
    if a>10**18:
      a=-1
      break
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
N=int(input())
A=deque([*map(int,input().split())])
a=1
while A:
  a*=A.popleft()
if a > 10**18:
  print(-1)
else:
  print(a)

Fixed submission:
N=int(input())
A=[*map(int,input().split())]
a=1
if 0 in A:
  a=0
else:
  while A:
    a*=A.pop()
    if a>10**18:
      a=-1
      break
print(a)
Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
path=[[False]*N for i in range(N)]
for i in range(M):
  x,y=map(int,input().split())
  path[x-1][y-1]=True
  path[y-1][x-1]=True

minm=[float('inf')]*N
result=[0]*N
flag=[False]*N
minm[0]=0

while True:
  v=-1
  for i in range(N):
    if (not flag[i]) and (v==-1):
      v=i
    elif (not flag[i]) and minm[i]<minm[v]:
      v=i
  if v==-1:
    break
  flag[v]=True
    
  for j in range(N):
    if path[v][j]==True and minm[j]>minm[v]+1:
      minm[j]=minm[v]+1
      result[j]=v+1
      

print('Yes')
for i in range(N-1):
  print(result[i+1])

Fixed submission:
from collections import deque
N,M=map(int,input().split())
to=[[] for _ in range(N)]
for _ in range(M):
  a,b=map(int,input().split())
  to[a-1].append(b-1)
  to[b-1].append(a-1)

q=deque([0])
r=[None]*N
r[0]=0
while q:
  x=q.popleft()
  for i in to[x]:
    if r[i] is None:
      q.append(i)
      r[i]=x+1
      
print('Yes')
for i in range(N):
  if r[i]!=0:
    print(r[i])

Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
path=[[False]*N for i in range(N)]
for i in range(M):
  x,y=map(int,input().split())
  path[x-1][y-1]=True
  path[y-1][x-1]=True

minm=[float('inf')]*N
result=[0]*N
flag=[False]*N
minm[0]=0

while True:
  v=-1
  for i in range(N):
    if (not flag[i]) and (v==-1):
      v=i
    elif (not flag[i]) and minm[i]<minm[v]:
      v=i
  if v==-1:
    break
  flag[v]=True
    
  for j in range(N):
    if path[v][j]==True and minm[j]>minm[v]+1:
      minm[j]=minm[v]+1
      result[j]=v+1
      
if float('inf') in minm:
  print('No')
else:
  print('Yes')
  for i in range(N-1):
    print(result[i+1])

Fixed submission:
from collections import deque
N,M=map(int,input().split())
to=[[] for _ in range(N)]
for _ in range(M):
  a,b=map(int,input().split())
  to[a-1].append(b-1)
  to[b-1].append(a-1)

q=deque([0])
r=[None]*N
r[0]=0
while q:
  x=q.popleft()
  for i in to[x]:
    if r[i] is None:
      q.append(i)
      r[i]=x+1
      
print('Yes')
for i in range(N):
  if r[i]!=0:
    print(r[i])

Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
path=[[False]*N for i in range(N)]
for i in range(M):
  x,y=map(int,input().split())
  path[x-1][y-1]=True
  path[y-1][x-1]=True

minm=[float('inf')]*N
result=[0]*N
flag=[False]*N
minm[0]=0

while True:
  v=-1
  for i in range(N):
    if (not flag[i]) and (v==-1):
      v=i
    elif (not flag[i]) and minm[i]<minm[v]:
      v=i
  if v==-1:
    break
  flag[v]=True
    
  for j in range(N):
    if path[v][j]==True and minm[j]>minm[v]+1:
      minm[j]=minm[v]+1
      result[j]=v+1
      
if float('inf') in minm:
  print('No')
else:
  print('Yes')
  for i in range(N-1):
    print(result[i+1])

Fixed submission:
from collections import deque
N,M=map(int,input().split())
to=[[] for _ in range(N)]
for _ in range(M):
  a,b=map(int,input().split())
  to[a-1].append(b-1)
  to[b-1].append(a-1)

q=deque([0])
r=[None]*N
r[0]=0
while q:
  x=q.popleft()
  for i in to[x]:
    if r[i] is None:
      q.append(i)
      r[i]=x+1
      
print('Yes')
for i in range(N):
  if r[i]!=0:
    print(r[i])
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
gacha_list = []
output = 0

for i in range(N):
  input_line = input()
  gacha_list.append(input_line)

while len(gacha_list) > 0:
  result = gacha_list[0]
  indexes = [i for i, x in enumerate(gacha_list) if x == result]
  for i in sorted(indexes, reverse=True):
    gacha_list.pop(i)
  output += 1
  
print(output)

Fixed submission:
N = int(input())
gacha_list = set()

for i in range(N):
  input_line = input()
  if input_line not in gacha_list:
    gacha_list.add(input_line)
    
print(len(gacha_list))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
gacha_list = []
output = 0

for i in range(N):
  input_line = input()
  gacha_list.append(input_line)

while len(gacha_list) > 0:
  result = gacha_list[0]
  result_count = gacha_list.count(result)
  for i in range(result_count):
    gacha_list.remove(result)
  output += 1
  
print(output)

Fixed submission:
N = int(input())
gacha_list = set()

for i in range(N):
  input_line = input()
  if input_line not in gacha_list:
    gacha_list.add(input_line)
    
print(len(gacha_list))

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

for i in range(N):
  input_line = input()
  if input_line in gacha_list:
    None
  else:
    gacha_list.append(input_line)
  
print(len(gacha_list))

Fixed submission:
N = int(input())
gacha_list = set()

for i in range(N):
  input_line = input()
  if input_line not in gacha_list:
    gacha_list.add(input_line)
    
print(len(gacha_list))

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

for i in range(N):
  input_line = input()
  if input_line not in gacha_list:
    gacha_list.append(input_line)
    
print(len(gacha_list))

Fixed submission:
N = int(input())
gacha_list = set()

for i in range(N):
  input_line = input()
  if input_line not in gacha_list:
    gacha_list.add(input_line)
    
print(len(gacha_list))
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=[]
for i in range(n):
    l.append(list(map(int,input().split())))
p=sorted(l,key=lambda x: x[0]+x[1])
q=sorted(l,key=lambda x: x[0]-x[1])
print(max(p[-1]-p[0],q[-1]-q[0]))

Fixed submission:
n=int(input())
l=[]
for i in range(n):
    l.append(list(map(int,input().split())))
p=[a+b for a,b in l]
q=[a-b for a,b in l]
p.sort()
q.sort()
print(max(p[-1]-p[0],q[-1]-q[0]))