Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03090 (python)

Fixed submission:
#import sys
#import numpy as np
import math
#import itertools
#from fractions import Fraction
#import itertools
from collections import deque
#import heapq
#from fractions  import gcd
#input=sys.stdin.readline
#import bisect
n=int(input())
node=[]
if n%2==0:
    for i in range(n):
        for j in range(i,n):
            if j==i or j==n-1-i:
                continue
            node.append((i+1,j+1))
else:
    for i in range(n):
        for j in range(i,n):
            if j==i or j==n-2-i:
                continue
            node.append((i+1,j+1))
    
print(len(node))
for i in node:
    print(*i)

Buggy submission (verdict: Runtime Error):
#import sys
#import numpy as np
import math
#import itertools
#from fractions import Fraction
#import itertools
from collections import deque
#import heapq
#from fractions  import gcd
#input=sys.stdin.readline
#import bisect
n=int(input())
node=[]
if n%2==0:
    for i in range(n):
        for j in range(i,n):
            if j==i or j==n-1-i:
                continue
            node.append((i+1,j+1))
else:
    for i in range(n):
        for j in range(i,n):
            if j==i or j==n-2-i:
                continue
            node.append((ix+1,j+1))
    
print(len(node))
for i in node:
    print(*i)
Problem p03102 (python)

Fixed submission:
#import sys
#import numpy as np
#import math
#import itertools
#from fractions import Fraction
#import itertools
from collections import deque
#import heapq
#from fractions  import gcd
#input=sys.stdin.readline
n,m,c=map(int,input().split())
b=list(map(int,input().split()))
ans=0
for i in range(n):
    a=list(map(int,input().split()))
    res=[a[i]*b[i] for i in range(m)]
    if sum(res)+c>0:
        ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
#import sys
#import numpy as np
#import math
#import itertools
#from fractions import Fraction
#import itertools
from collections import deque
#import heapq
#from fractions  import gcd
#input=sys.stdin.readline
n,m,c=map(int,input().split())
b=list(map(int,input().split()))
ans=0c
for i in range(n):
    a=list(map(int,input().split()))
    res=[a[i]*b[i] for i in range(m)]
    if sum(res)+c>0:
        ans+=1
print(ans)
Problem p03103 (python)

Fixed submission:
#import sys
#import numpy as np
#import math
#import itertools
#from fractions import Fraction
#import itertools
from collections import deque
#import heapq
#from fractions  import gcd
#input=sys.stdin.readline
n,m=map(int,input().split())
b=[list(map(int,input().split())) for _ in range(n)]
res=0
ans=0
b.sort(key=lambda x: x[0])
for i in range(n):
    if res+b[i][1]<=m:
        ans+=b[i][0]*b[i][1]
        res+=b[i][1]
    else:
        ans+=b[i][0]*(m-res)
        break
print(ans)

Buggy submission (verdict: Runtime Error):
#python 2.7
n,m=map(int,input().split())
ab=[list(map(int,input().split()))]
ab=sorted(ab,key=lambda x:x[0])
res=ans=0
for i in range(n):
  if res+ab[i][1]>=m:
    ans+=(ab[i][0])*(m-res)
    break
  else:
    ans+=(ab[i][0])*ab[i][1]
    res+=ab[i][1]
print(ans)
Problem p03273 (python)

Fixed submission:
h,w=map(int,input().split())
a=[input() for _ in range(h)]
res=[]
for i in range(h):
    if "#" not in a[i]:
      res.append(i)

resh=[]
h=len(a)
for i in range(w):
    for j in range(len(a)):
      if a[j][i]=="#":
        break
    else:
      resh.append(i)
for i in range(h):
  for j in range(w):
    if i not in res and j not in resh:
      print(a[i][j],end="")
  if i not in res:
    print("")

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split())
a=[input() for _ in range(h)]

res=[]
for i in range(h):
    if "#" not in a[i]:
      res.append(i)
for i in res:
  a.pop(i)
res=[]
h=len(a)
for i in range(w):
    for j in range(len(a)):
      if a[j][i]=="#":
        break
    else:
      res.append(j)
for i in res:
  for j in range(len(a)):
    a[j]=a[j][:i]+a[j][i+1:]
for i in a:
  print(*i)
Problem p03353 (python)

Fixed submission:
#import sys
#import numpy as np
import math
#import itertools
#from fractions import Fraction
#import itertools
from collections import deque
from collections import Counter
#import heapq
#from fractions  import gcd
#input=sys.stdin.readline
#import bisect
s=input()
k=int(input())
n=len(s)
a=[chr(i) for i in range(ord('a'),ord('z')+1)]
ans=set()
for i in a:
    if i not in s:
        continue
    if len(ans)>=5:
        break
    for c in range(n):
      if s[c]==i:
          l=c
          r=c
          while True:
            if  r>n or r-l>6:
                break
            ans.add(s[l:r+1])
            r+=1
ans=list(ans)
ans.sort()
print(ans[k-1])

Buggy submission (verdict: Runtime Error):
#import sys
#import numpy as np
import math
#import itertools
#from fractions import Fraction
#import itertools
from collections import deque
from collections import Counter
#import heapq
#from fractions  import gcd
#input=sys.stdin.readline
#import bisect
s=input()
k=int(input())
n=len(s)
a=[chr(i) for i in range(ord('a'),ord('z')+1)]
ans=set()
for i in a:
    if i not in s:
        continue
    if len(ans)>=5:
        break
    for c in range(n):
      if s[c]==i:
          l=c
          r=c
          ans.add(s[l])
          while True:
            if  r>n or s[r]==i:
                break
            ans.add(s[l:r+1])
            r+=1
ans=list(ans)
ans.sort()
print(ans[k-1])
Problem p02630 (python)

Fixed submission:
import collections
n = int(input())
a = list(map(int, input().split()))
count = collections.Counter(a)
q = int(input())
s = sum(a)

for i in range(q):
  b, c = map(int, input().split())
  s = s - (b - c) * count[b]
  
  count[c] += count[b]
  count[b] = 0
  print(s)

Buggy submission (verdict: Runtime Error):
n=int(input())
dict={}
a=list(map(int,input().split()))
for i in a:
  if i not in dict:
    dict[i]=1
  else:
    dict[i]+=1
q=int(input())
for i in range(q):
  b,c=map(int,input().split())
  ans=0
  if c in dict:
    dict[c]+=dict[b]
  else:
    dict[c]=dict[b]
  dict[b]=0
  ans=0
  for j in dict:
    ans+=dict[j]*j
  print(ans)
Problem p02641 (python)

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

if n == 0:
  print(x)
else:
  p = list(map(int, input().split()))
  for j in range(0, int(n/2)+ 2):
    #print(j)
    if x-j not in p:
      print(x-j)
      break
    else:
      if x+j not in p:
        print(x+j)
        break

Buggy submission (verdict: Runtime Error):
x, n = map(int, input().split())
if n == 0:
  print(x)
else:
  p = list(map(int, input().split()))
  ans = []

  for i in range(n-2):
    if x-i not in p:
      ans.append(-i)
      break
    elif x+i not in p:
      ans.append(i)
      break
    else:
      ans.append(-3)
  print(x+ans[0])

Buggy submission (verdict: Runtime Error):
x, n = map(int, input().split())
if n == 0:
  print(x)
else:
  p = list(map(int, input().split()))
  ans = []

  for i in range(n-2):
    if x-i not in p:
      ans.append(-i)
      break
    elif x+i not in p:
      ans.append(i)
      break
  print(x+ans[0])

Buggy submission (verdict: Runtime Error):
x, n = map(int, input().split())
p = list(map(int, input().split()))
ans = []
if n == 0:
  print(x)
else:
  for i in range(n-2):
    if x-i not in p:
      ans.append(-i)
      break
    elif x+i not in p:
      ans.append(i)
      break
  print(x+min(ans))
Problem p02684 (python)

Fixed submission:
n,k=map(int,input().split())
a=list(map(int,input().split()))
data=[0]*(n+1)
data[1]=1
ans=[1]
res=0
for i in range(n):
  p=a[res]
  if data[p]==0:
    data[p]=1
    ans.append(p)
    res=p-1
  else:
    res=ans.index(p)
    break
if len(ans)>k:
  print(ans[k])
else:
  m=len(ans)-res
  k-=res
  d=k%m
  print(ans[res+d])

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(map(int,input().split()))
data=[0]*(n+1)
data[1]=1
ans=[1]
res=0
for i in range(n):
  p=a[res]
  if data[p]==0:
    data[p]=1
    ans.append(p)
    res=p-1
  else:
    res=ans.index(p)
    break
if len(ans)>=k:
  print(ans[k])
else:
  m=len(ans)-res
  k-=res
  d=k%m
  print(ans[res+d])
Problem p02690 (python)

Fixed submission:
x=int(input())
for i in range(-118,120):
  for j in range(-119,1119):
    if i**5-j**5==x:
      print(i,j)
      exit()

Buggy submission (verdict: Runtime Error):
x=int(input())
y=0
while True:
  z=x+y**5
  if z**(1/5)==int(z**(1/5)):
    print(int(z**(1/5)), y)
    exit()
  w=x-y**5
  if w**(1/5)==int(w**(1/5)):
    print(int(w**(1/5)), -y)
    exit()
  y+=1

Buggy submission (verdict: Runtime Error):
x=int(input())
y=0
while True:
  z=x+y**5
  if z**(1/5)==int(z**(1/5)):
    print(int(z**(1/5)), y)
    exit()
  z=x-y**5
  if z**(1/5)==int(z**(1/5)):
    print(int(z**(1/5)), -y)
    exit()
  y+=1
Problem p02761 (python)

Fixed submission:
n,m=map(int,input().split())
data=[-1]*n
for i in range(m):
  s,c=map(int,input().split())
  if (s==1 and c==0) and n>=2:
    print(-1)
    exit()
  if data[s-1]==-1 or data[s-1]==c:
    data[s-1]=c
  elif data[s-1]!=-1 and data[s-1]!=c:
    print(-1)
    exit()
  
if data[0]==-1 and n!=1:
  data[0]=1
elif data[0]==-1 and n==1:
  data[0]=0
for i in range(1,n):
  if data[i]==-1:
    data[i]=0
print(*data,sep='')

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
S = []
C = []
for i in range(m):
  s,c = map(int, input().split())
  S.append(s)
  C.append(c)
  
for j in range(m):
  if S[j] == 1 and C[j] == 0:
    print('-1')
    break
  elif S[j] in S:
    l = S.index(S[j])
    if C[l] != C[j]:
      print('-1')
      break
  else:
    continue

h1 = C[S.index(1)]
h2 = 0
h3 = 0
if int(2) in S:
  h2 = C[S.index(2)]

if int(3) in S: 
  h3 = C[S.index(3)]
  
print(100*h1 + 10*h2 + h3)
Problem p02802 (python)

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

ac = 0
wa = 0
res1 = [0]*n
res2 = [0]*n
for i in range(m):
  p, s = list(map(str, input().split()))
  if s == 'AC' and res1[int(p)-1] == 0:
    ac += 1
    res1[int(p)-1] = 1
    wa += res2[int(p)-1]
  elif s == 'WA' and res1[int(p)-1] == 0:
    res2[int(p)-1] += 1
print(ac, wa)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
ac=[0]*(n+1)
wa=0
for i in range(m+1):
  p,c=input().split()
  if c=='AC' and ac[int(p)]==0:
    ac[int(p)]=1
  elif c=='WA' and ac[int(p)]==0:
    wa+=1
print(ac.count(1),wa)
Problem p02842 (python)

Fixed submission:
n=int(input())
m=round(n/1.08)
if int(m*1.08)==n:
  print(m)
  exit()
else:
  if int((m-1)*1.08)==n:
    print(m-1)
    exit()
  elif int((m+1)*1.08)==n:
    print(m+1)
    exit()
  else:
    print(':(')
    exit()

Buggy submission (verdict: Runtime Error):
n=int(input())
m=rond(n/1.08)
if int(m*1.08)==n:
  print(m)
else:
  if int((m-1)*1.08)==n:
    print(m-1)
  elif int((m+1)*1.08)==n:
    print(m+1)
  else:
    print(':(')
Problem p02923 (python)

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

d=[0]*(n-1)
k=0
if n==1:
  print(0)
  exit()
for i in range(n-1):
  if h[i]-h[i+1]>=0:
    d[k]+=1
  else:
    k+=1
print(max(d))

Buggy submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))

d=[0]*(n-1)
k=0
for i in range(n-1):
  if h[i]-h[i+1]>=0:
    d[k]+=1
  else:
    k+=1
print(max(d))

Buggy submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))

d=[0]*(n-1)
k=0
for i in range(n-1):
  if h[i]-h[i+1]>=0:
    d[k]+=1
  else:
    k+=1
print(max(d))
Problem p02983 (python)

Fixed submission:
l, r = map(int, input().split())

if l + 2019 <= r:
  print(0)
else:
  res = []
  for i in range(l, r+1):
     for j in range(i+1, r+1):
        res.append((i*j)%2019)
  print(min(res))

Buggy submission (verdict: Runtime Error):
L,R=map(int,input().split())
l=L%2019
r=R%2019
l1=L//2019
r1=R//2019
if l1<r1:
  print(0)
elif l1==r1:
  res=[]
  for i in range(l,r):
    for j in range(i+1,r+1):
      if (i*j)%2019 not in res:
        res.append((i*j)%2019)
print(min(res))
Problem p03061 (python)

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

import math
l_gcd = []
r_gcd = []

c = a[0]
for i in a[:-1]:
  c = math.gcd(c, i)
  l_gcd.append(c)
  
c = a[-1]
for j in a[1:][::-1]:
  c = math.gcd(c, j)
  r_gcd.append(c)
  
ans = max(r_gcd[-1], l_gcd[-1])
for r, l in zip(r_gcd[:-1], l_gcd[:-1][::-1]):
  c = math.gcd(r, l)
  ans = max(ans, c)
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

res = []
ans = []
x = 0
if n > 2:
  while x < math.factorial(n):
    c = random.sample(a, 2)
    if c not in res:
      res.append(c)
      x += 1 
      ans.append(math.gcd(c[0],c[1]))
  print(max(ans))
elif n == 2:
  while x < math.factorial(n)/2:
    c = random.sample(a, 2)
    if c not in res:
      res.append(c)
      x += 1 
      ans.append(math.gcd(c[0],c[1]))
  print(max(ans))

Buggy submission (verdict: Runtime Error):
import random
import math
n = int(input())
a = list(map(int, input().split()))

res = []
ans = []
x = 0
while x < math.factorial(n)/2:
  c = random.sample(a, 2)
  if c not in res:
    res.append(c)
    x += 1 
    ans.append(math.gcd(c[0],c[1]))
print(max(ans))
Problem p03126 (python)

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

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
data=[0]*n
for i in range(n):
  a=list(map(int,input().split()))
  for j in range(1,a[0]+1):
    data[a[j]-1]+=1
print(data.count(n))
Problem p03161 (python)

Fixed submission:
n, k = map(int, input().split())
h = list(map(int, input().split()))

dp = [float('inf')] * n

dp[0] = 0
for i in range(1, n):
  dp[i] = min(dp[j]+abs(h[i]-h[j]) for j in range(max(0, i-k), i))

    
print(dp[n-1])

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = list(map(int, input().split()))

dp = [float('inf')] * n

dp[0] = 0
for i in range(n):
  for j in range(k+1):
    dp[i] = min(dp[i], dp[i-j] + abs(h[i]-h[i-j]))
    
    
print(dp[n-1])
Problem p03166 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**9)
from collections import defaultdict
n,m=map(int,input().split())
d=defaultdict(list)
for _ in range(m):
  x,y=map(int,input().split())
  d[x-1].append(y-1)

dp=[-1]*n

def rec(v):
  if dp[v]!=-1:
    return dp[v]
  res=0
  for nv in d[v]:
    res=max(res,rec(nv)+1)
  dp[v]=res
  return res

res=0
for v in range(n):
  res=max(res,rec(v))
print(res)

Buggy submission (verdict: Runtime Error):
from collections import defaultdict

n,m=map(int,input().split())
d=defaultdict(list)
for _ in range(m):
  x,y=map(int,input().split())
  d[x-1].append(y-1)

dp=[-1]*n

def rec(v):
  if dp[v]!=-1:
    return dp[v]
  res=0
  for nv in d[v]:
    res=max(res,rec(nv)+1)
  dp[v]=res
  return res

res=0
for v in range(n):
  res=max(res,rec(v))
print(res)
Problem p03244 (python)

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

v_even = [0]*100000
v_odd = [0]*100000

for i in range(n):
  if i%2==0:
    v_even[v[i]-1] += 1 
  else:
    v_odd[v[i]-1] += 1
    
res1 = max(v_even)
res2 = max(v_odd)
if v_even.index(res1) == v_odd.index(res2):
  if res1 > res2:
    v_odd[v_odd.index(res2)] = 0
    res2 = max(v_odd)
  elif res2 > res1:
    v_even[v_even.index(res1)] = 0
    res1 = max(v_even)
  elif res1 == res2:
    v_odd[v_odd.index(res2)] = 0
    v_even[v_even.index(res1)] = 0
    res3 = max(v_even)
    res4 = max(v_odd)
    if res3 > res4:
      res1 = res3
    else:
      res2 = res4
      
print(n//2-res1 + n//2-res2)

Buggy submission (verdict: Runtime Error):
n = int(input())
v = list(map(int, input().split()))

v_even = [0]*100000
v_odd = [0]*100000

for i in range(n):
  if i%2==0:
    v_even[v[i]] += 1 
  else:
    v_odd[v[i]] += 1
    
res1 = max(v_even)
res2 = max(v_odd)
if v_even.index(res1) == v_odd.index(res2):
  if res1 >= res2:
    v_odd[v_odd.index(res2)] = 0
    res2 = max(v_odd)
  else:
    v_even[v_even.index(res1)] = 0
    res1 = max(v_even)
print(n//2-res1 + n//2-res2)
Problem p03289 (python)

Fixed submission:
s = input()
a = s.lower()
l = len(s)
c = 0
n = 0

if s[0] == 'A':
  for i in range(2 , l-1):
    if s[i] == 'C':
      c += 1
  if c == 1:
    for i in range(1,l):
      if s[i] != a[i]:
        n += 1
    if n == 1:
      print('AC')
      exit()
print('WA')

Buggy submission (verdict: Runtime Error):
s = input()
n = len(s)
res = 0
  
if s[0] == 'A':
  if s.find('C') >= 2 and s.find('C') < n-2:
    s.lower(0)
    s.lower(s.find('C'))
    if s == s.lower():
      print('AC')
    else:
      print('WA')
  else:
    print('WA')
else:
  print('WA')
Problem p03379 (python)

Fixed submission:
n = int(input())
X = list(map(int, input().split()))
x = sorted(X)

res1 = x[n//2]
res2 = x[n//2 -1]

for i in range(n):
  if X[i] >= res1:
    print(res2)
  elif X[i] <= res2:
    print(res1)

Buggy submission (verdict: Runtime Error):
n = int(input())
X = list(map(int, input().split()))

for i in X:
  x = sorted(X)
  x.pop(i)
  print(x[n//2- 1])
Problem p03436 (python)

Fixed submission:
from collections import deque


def bfs():
  d = [[float('inf')]* w for i in range(h)]
  
  dx = [1, 0, -1, 0]
  dy = [0, 1, 0, -1]
  
  que = deque([])
  que.append((sx, sy))
  d[sx][sy] = 0
  
  while que:
    p = que.popleft()
    if p[0] == gx and p[1] == gy:
      break
    for i in range(4):
      nx = p[0] + dx[i]
      ny = p[1] + dy[i]
      
      if 0 <= nx < h and 0 <= ny < w and maze[nx][ny] != '#' and d[nx][ny] == float('inf'):
        que.append((nx, ny))
        d[nx][ny] = d[p[0]][p[1]] + 1
        
  return d[gx][gy]
  
  
h, w = map(int, input().split())
maze = [list(input()) for i in range(h)]
sx, sy = 0, 0
gx, gy = h-1, w-1

white = 0
for i in range(h):
  for j in range(w):
    if maze[i][j] == '.':
      white += 1
      
res = bfs()
if 0 < res < float('inf'):
  print(white - res - 1)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
from collections import deque


def bfs():
  d = [[float('inf')]* w for i in range(h)]
  
  dx = [1, 0, -1, 0]
  dy = [0, 1, 0, -1]
  
  que = deque([])
  que.append((sx, sy))
  d[sx][sy] = 0
  
  while que:
    p = que.popleft()
    if p[0] == gx and p[1] == gy:
      break
    for i in range(4):
      nx = p[0] + dx[i]
      ny = p[1] + dy[i]
      
      if 0 <= nx < h and 0 <= ny < w and maze[nx][ny] != '#' and d[nx][ny] == float('inf'):
        que.append((nx, ny))
        d[nx][ny] = d[p[0]][p[1]] + 1
        
  return d[gx][gy]
  
  
h, w = map(int, input().split())
maze = [list(input()) for i in range(h)]
sx, sy = 0, 0
gx, gy = h-1, w-1

white = 0
for i in range(h):
  for j in range(w):
    if maze[i][j] == '.':
      white += 1
      
res = bfs()
if 0 < res < float('inf'):
  print(white - res - 1)
else:
Problem p03524 (python)

Fixed submission:
s=input()
n=len(s)
set=set(s)
m=len(set)
a=s.count('a')
b=s.count('b')
c=s.count('c')
if m==1:
  if n==1:
    print('YES')
  else:
    print('NO')
elif m==2:
  if n==2:
    print('YES')
  else:
    print('NO')
else:
  if n%3==0:
    if a==b==c:
      print('YES')
    else:
      print('NO')
  elif n%3==2:
    if (a==n//3+1 and b==n//3+1) or (c==n//3+1 and b==n//3+1) or (a==n//3+1 and c==n//3+1):
      print('YES')
    else:
      print('NO')
  else:
    if (a==n//3 and b==n//3) or (c==n//3 and b==n//3) or (a==n//3 and c==n//3):
      print('YES')
    else:
      print('NO')

Buggy submission (verdict: Runtime Error):
n=len(s)
set=set(s)
m=len(set)
a=s.count('a')
b=s.count('b')
c=s.count('c')
if m==1:
  if n==1:
    print('YES')
  else:
    print('NO')
elif m==2:
  if c==0:
    if a==b:
      print('YES')
    else:
      print('NO')
  elif b==0:
    if a==c:
      print('YES')
    else:
      print('NO')
  else:
    if b==c:
      print('YES')
    else:
      print('NO')
else:
  d=n//m
  res=0
  if a<=d:
    res+=1
  if b<=d:
    res+=1
  if c<=d:
    res+=1
  if res<=1:
    print('YES')
  else:
    print('NO')

Buggy submission (verdict: Runtime Error):
s=input()
n=len(s)
set=set(s)
m=len(set)
a=s.count('a')
b=s.count('b')
c=s.count('c')
if m==1:
  if n==1:
    print('YES')
  else:
    print('NO')
elif m==2:
  if (a==b or b==a+1 or a=b+1) or (c==b or b==c+1 or c=b+1) or (a==c or c==a+1 or a=c+1):
    print('YES')
  else:
    print('NO')
else:
  d=n//m
  res=0
  if a<=d:
    res+=1
  if b<=d:
    res+=1
  if c<=d:
    res+=1
  if res>=d:
    print('YES')
  else:
    print('NO')
Problem p03607 (python)

Fixed submission:
n=int(input())
a={}
for i in range(n):
  a_=int(input())
  if a_ not in a:
    a[a_]=1
  else:
    a[a_]+=1
ans=0
for i in a:
  if a[i]%2==1:
    ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[int(input()) for i in range(n)]
data=[0]*10**6
ans=0
for i in a:
  data[i-1]+=1
  if data[i-1]%2==0:
    ans-=1
  else:
    ans+=1
print(ans)
Problem p03611 (python)

Fixed submission:
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
c = Counter(a)
ans = 0
for x in range(min(a), max(a)+1):
  res = c[x] + c[x+1] + c[x-1]
  ans = max(ans, res)
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))

if n == 1:
  print(1)
else:
  ans = 0
  for i in range(1, max(a)):
    res = a.count(i) + a.count(i+1) + a.count(i-1)
    ans = max(ans, res)
    
  print(ans
Problem p03627 (python)

Fixed submission:
from collections import Counter
n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
A=Counter(a)
s=set(a)
S=sorted(list(s))
S.reverse()
h=0
w=0
for i in S:
  res=A[i]
  if res>=4:
    if h==0:
      h=i
    if w==0:
      w=i
  elif 2<=res<4:
    if w==0:
      w=i
    elif w!=0 and h==0:
      h=i
print(h*w)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
a.sort()
cnt=0
data=[0]*max(a)
while cnt<n-1:
  if a[cnt]==a[cnt+1]:
    data[a[cnt]-1]+=1
    cnt+=2
  else:
    cnt+=1
data.reverse()
h=0
w=0
for i in range(len(data)):
  if data[i]==0:
    continue
  elif data[i]==1:
    if h==0:
      h=len(data)-i
    elif h!=0 and w==0:
      w=len(data)-i
  elif data[i]>=2:
    if h==0:
      h=len(data)-i
    if w==0:
      w=len(data)-i
  if h!=0 and w!=0:
    break
print(h*w)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
a.sort()
cnt=0
data=[0]*max(a)
while cnt<n-1:
  if a[cnt]==a[cnt+1]:
    data[a[cnt]-1]+=1
    cnt+=2
  else:
    cnt+=1
data.reverse()
h=0
w=0
for i in range(len(data)):
  if data[i]==0:
    continue
  elif data[i]==1:
    if h==0:
      h=len(data)-i
    elif h!=0 and w==0:
      w=len(data)-i
  elif data[i]>=2:
    if h==0:
      h=len(data)-i
    if w==0:
      w=len(data)-i
  if h!=0 and w!=0:
    break
print(h*w)
Problem p03861 (python)

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

n = b // x
m = (a-1) // x

print(n-m)

Buggy submission (verdict: Runtime Error):
print(n-m)
Problem p04043 (python)

Fixed submission:
A,B,C = map(int, input().split())
if A==5 and B==5 and C==7:
  print("YES")
elif A==5 and B==7 and C==5:
  print("YES")
elif A==7 and B==5 and C==5:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
N, L = map(int, input().split())
S = [input() for i in range(N)]
s = sorted(S)
print(*s, sep='')

Buggy submission (verdict: Runtime Error):
N, L = map(int, input().split())
P = [input().split() for i in range(L)]

p = sorted(P)
ppp = "".join(map(str, p))
print(ppp)

Buggy submission (verdict: Runtime Error):
A, B, C = int(input())
if A == 5 and B == 5 and C == 7:
  print("YES")
elif A == 5 and B == 7 and C == 5:
  print("YES")
elif A == 7 and B == 5 and C == 5:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
if A==5 and B==5 and C==7
  or A==5 and B==7 and C==5
  or A==7 and B==5 and C==5;
  print("YES");
else;
  print("NO");
end