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

Fixed submission:
A,B,C = map(int,input().split())
Top = max(A,B,C)
Bottom = min(A,B,C)
Middle = A+B+C - Top - Bottom
if (Middle - Bottom)%2 != 0:
  Top += 1
  Bottom += 1
  Answer = (Top -Middle) + (Middle - Bottom)//2 +1
else:
  Answer = (Top - Middle) + (Middle - Bottom)//2
print(Answer)

Buggy submission (verdict: Runtime Error):
Bottom = min(A,B,C)
Middle = A+B+C - Top - Bottom
if (Middle - Bottom)%2 != 0:
  Top += 1
  Bottom += 1
  Answer = (Top -Middle) + (Middle - Bottom)//2 +1
else:
  Answer = (Top - Middle) + (Middle - Bottom)//2
print(Answer)
Problem p03434 (python)

Fixed submission:
n = int(input())
List = list(map(int,input().split()))
A = []
B = []
List = sorted(List,reverse=True)
for i in range(len(List)):
  if i%2 == 0:
    A.append(List[i])
  else:
    B.append(List[i])
Answer = sum(A) - sum(B)
print(Answer)

Buggy submission (verdict: Runtime Error):
n = int(input())
List = list(map(int,input().split()))
A = []
B = []
List = sorted(List,reverse=True)
for i in range(len(List)):
  if i%2 == 0:
    A.append(item)
  else:
    B.append(item)
Answer = sum(A) - sum(B)
print(Answer)
Problem p03471 (python)

Fixed submission:
N,Y = map(int,input().split())
y = Y/1000
Answer = [-1, -1, -1]

for i in range(N+1):
  for j in range(N+1-i):
    if 10*i+5*j+(N-i-j) == Y/1000:
      Answer = [i, j, N-i-j]
      print(*Answer)
      exit()
print(*Answer)

Buggy submission (verdict: Runtime Error):
N,Y = map(int,input().split())
y = Y/1000
Answer = [-1, -1, -1]
for i in range(N+1):
  if i*10 <= y:
    for j in range(N-i):
      if i*10 + j*5 <= y:
        k = y - i*10 - j*5:
          if i + j + k == N:
            Answer = [i,j,k]
      else:
        break
    else:
      break
print(Answer[0],Answer[1],int(Answer[2]))
Problem p03680 (python)

Fixed submission:
N = int(input())
dic = {}
for i in range(N):
  a = int(input())
  dic[i+1] = a
counter = 0
place = 1
while place != 2:
  if dic[place] in dic and dic[place] != place:
    temp = dic[place]
    dic.pop(place)
    place = temp
    counter += 1
  else:
    counter = -1
    break
print(counter)

Buggy submission (verdict: Runtime Error):
N = int(input())
dic = {}
for i in range(N):
  a = int(input())
  dic[i+1] = a
counter = 0
place = 1
while place != 2:
  if dic[place] in dic:
    temp = dic[place]
    dic.pop(place)
    place = temp
    counter += 1
  else:
    counter = -1
    break

print(counter)
Problem p03697 (python)

Fixed submission:
A,B = map(int,input().split())  
if A + B >= 10:
  print('error')
else:
  print(A+B)

Buggy submission (verdict: Runtime Error):
A,B = map(int,input().split())  
if A + B < 10:
  prin(A+B)
else:
  print('error')
Problem p03720 (python)

Fixed submission:
N,M = map(int,input().split())
dic = {}

for i in range(N):
  dic[i+1] = 0

for i in range(M):
  a,b = map(int,input().split())
  dic[a] += 1
  dic[b] += 1
output = dic.values()
for item in output:
  print(item)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
dic = {}
for i in range(M):
  a,b = map(int,input().split())
  if a not in dic:
    dic[a] = 1
  else:
    dic[a] +=1
  if b not in dic:
    dic[b] = 1
  else:
    dic[b] +=1

for j in range(N):
  print(dic[j+1])
Problem p03721 (python)

Fixed submission:
N,M = map(int,input().split())
dic = {}
for _ in range(N):
  a, b = map(int,input().split())
  if a in dic:
    dic[a] += b
  else:
    dic[a] = b
List = sorted(dic)
ans = 0
i = 0
while M > 0:
  M -= dic[List[i]]
  ans = List[i]
  i += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
dic = {}
for _ in range(N):
  a, b = map(int,input().split())
  if a in dic:
    dic[a] += b
  else:
    dic[a] = b
List = sorted(dic)
ans = 0
i = 0
while M >= 0:
  M -= dic[List[i]]
  ans = List[i]
  i += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
dic = {}
for _ in range(N):
  a, b = map(int,input().split())
  if a in dic:
    dic[a] += b
  else:
    dic[a] = b
List = sorted(dic)[::-1]
ans = 0
i = 1
while M > 0:
  M -= dic[i]
  ans = i
  i += 1
print(ans)
Problem p03760 (python)

Fixed submission:
O = input()
E = input()
Answer = ''
for i in range(len(O)-1):
  Answer = Answer + O[i]
  Answer = Answer + E[i]
if len(E)==len(O):
  Answer = Answer + O[len(O)-1]
  Answer = Answer + E[len(E)-1]
else:
  Answer = Answer + O[len(O)-1]

print(Answer)

Buggy submission (verdict: Runtime Error):
O = input()
E = input()
Answer = ''
for i in range(len(O)):
  Answer = Answer + O[i]
  Answer = Answer + E[i]
print(Answer)
Problem p04000 (python)

Fixed submission:
from collections import *
h,w,n = map(int,input().split())
dic = defaultdict(int)
for _ in range(n):
  a,b = map(int,input().split())
  for i in range(9):
    dic[a - i //3,b - i % 3] += 1
ans =[0]*10
for i, j in dic:
  ans[dic[i,j]] += h-1 > i > 0 < j < w -1
ans[0] = (h -2)*(w-2) - sum(ans)
for item in ans:
  print(item)

Buggy submission (verdict: Runtime Error):
from collections import *
h,w,n = map(int,input().split())
dic = defaultdict(int)
for _ in range(n):
  a,b = map(int,input().split())
  for i in range(9):
    dic[a - i //3,b - i % 3] += 1
ans =[0]*n
for i, j in dic:
  ans[dic[i,j]] += h-1 > i > 0 < j < w -1
ans[0] = (h -2)*(w-2) - sum(ans)
for item in ans:
  print(item)
Problem p04011 (python)

Fixed submission:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
if n <= k:
    total = n*x
else:
    total = k*x + (n-k)*y
print(total)

Buggy submission (verdict: Runtime Error):
n = input()
k= input()
X = input()
y = input()
if n<=k:
    total = n*x
else:
    total = k*x + (n-k) * y
print(total)
Problem p04032 (python)

Fixed submission:
S = input()
for i in range(len(S)-2):
  for j in [i+1,i+2]:
    if S[i] == S[j]:
      print(i+1,j+1)
      exit()
if len(S) == 2 and S[0]==S[1]:
  print(1,2)
  exit()
print('-1 -1')

Buggy submission (verdict: Runtime Error):
S = input()
for i in range(len(S)-1):
  for j in [i+1,i+2]:
    if S[i] == S[j]:
      print(i+1,j+1)
      exit()
print('-1 -1')
Problem p03565 (python)

Fixed submission:
import sys
from itertools import permutations
import math
from operator import itemgetter

s=input()
t=input()

if len(s)<len(t):
    print('UNRESTORABLE')
    sys.exit()

flag2=True
for i in reversed(range(len(s)-len(t)+1)):
    if (s[i]==t[0]) | (s[i]=='?'):
        flag=True
        for j in range(1,len(t)):
            if (s[i+j]!=t[j]) & (s[i+j]!='?'):
                flag=False
        if flag:
            s=s[:i]+t+s[i+len(t):] 
            s=s.replace('?','a')
            print(s)
            flag2=False
            sys.exit()

if flag2:
    print('UNRESTORABLE')

Buggy submission (verdict: Runtime Error):
import sys
from itertools import permutations
import math
from operator import itemgetter

s=input()
t=input()

flag2=True
for i in reversed(range(len(s))):
    if s[i]==t[0]:
        flag=True
        for j in range(1,len(t)):
            if (s[i+j]!=t[j]) & (s[i+j]!='?'):
                flag=False
        if flag:
            s=s[:i]+t+s[i+len(t):] 
            s=s.replace('?','a')
            print(s)
            flag2=False
            sys.exit()

if flag2:
    print('UNRESTORABLE')
Problem p04043 (python)

Fixed submission:
a,b,c=map(int,input().split())
if(((a==5)or(a==7)) and ((b==5)or(b==7)) and ((c==5)or(c==7))):
  if(a+b+c==17):
    print("YES")
  else:
    print("NO")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if(((a==5)or(a==7)) and ((b==5)or(b==7)) and ((c==5)or(c==7))):
  if(a+B+c==17):
    print("YES")
  else:
    print("NO")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if(((a==5)or(a==7)) and ((b==5)or(b==7)) and ((c==5)or(c==7))):
  ifa+B+c==17:
    print("YES")
  else:
    print("NO")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if(((a==5)or(a==7)) and ((b==5)or(b==7)) and ((c==5)or(c==7))):
  ifa+B+c==17:
    print(YES)
  else:
    print(NO)
else:
  print(NO)
Problem p02621 (python)

Fixed submission:
import sys

a = int(sys.stdin.readline())

print(a+a*a+a*a*a)

Buggy submission (verdict: Runtime Error):
import sys

a = int(sys.stdin.readline())

print(a+a*a+a*a*a
Problem p03796 (python)

Fixed submission:
""" abc055_b """

import sys
from functools import reduce

H = pow(10, 9) + 7

def _main():
    _n = int(sys.stdin.readline())

    # N! = aH + b
    # (N+1) * N! = aH(N+1) + b(N+1)
    #            = aH(N+1) + int(b(N+1)/H) * H + b(N+1) % H
    result = reduce(lambda a, n: (a * n) % H, range(1, _n + 1), 1)

    print(result)

if __name__ == '__main__':
    _main()

Buggy submission (verdict: Runtime Error):
    _n = int(sys.stdin.readline())

    # N! = aH + b
    # (N+1) * N! = aH(N+1) + b(N+1)
    #            = aH(N+1) + int(b(N+1)/H) * H + b(N+1) % H
    result = reduce(lambda a, n: (a * n) % H, range(1, _n + 1), 1)

    print(result)
Problem p03798 (python)

Fixed submission:
""" abc055_a """

import sys

H = pow(10, 9) + 7

def _main():
    _n = int(sys.stdin.readline())
    answers = list(map(lambda a: a == 'o', sys.stdin.readline()))

    # ooxoox
    # S-----
    # a[0] = o: SS---S
    # a[1] = o: SSS--S
    # a[2] = x: SSSW-S
    # a[3] = o: SSSWWS
    # a[4] = o: SSSWWS OK
    # a[5] = x: SSSWWS OK

    def _evaluate(zoo_first, zoo_last):

        zoo = [None] * _n

        zoo[0] = zoo_first == 'S'
        zoo[_n-1] = zoo_last == 'S'

        for i in range(0, _n):
            same = answers[i] if zoo[i] else not answers[i]
            next_z = zoo[(i-1)%_n] if same else not zoo[(i-1)%_n]
            if zoo[(i+1)%_n] is None:
                zoo[(i+1)%_n] = next_z
            else:
                if zoo[(i+1)%_n] != next_z:
                    return -1

        return zoo

    for _f, _l in [['S', 'S'], ['W', 'W'], ['S', 'W'], ['W', 'S'],]:
        result = _evaluate(_f, _l)
        if -1 != result:
            print(_format(result))
            return

    print(-1)

def _format(result):
    return ''.join(map(lambda e: 'S' if e else 'W', result))

if __name__ == '__main__':
    _main()

Buggy submission (verdict: Runtime Error):
""" abc055_a """

import sys

H = pow(10, 9) + 7

def _main():
    n_s, n_c = map(int, sys.stdin.readline().split(' '))

    if 2 * n_s <= n_c:
        result = n_s + int((n_c - n_s * 2) / 4)
    else:
        result = int(n_c / 2)

    print(result)

if __name__ == '__main__':
    _main()
Problem p02658 (python)

Fixed submission:
n=int(input())
line=input().split(" ")
f=0

for i in line:
  if int(i)==0:
    print("0")
    f=1

g=1
if f==0:
  for i in line:
    g=g*int(i)
    if g>10**18:
      print("-1")
      f=1
      break
  if f==0:
    print(g)

Buggy submission (verdict: Runtime Error):
n=int(input())
line=map(int,input().split(" "))
for i in line:
  if i==0:
    print("0")
    return
g=1
for i in line:
  g=g*i
  if g>10**18:
    print("-1")
    return
print(g)
Problem p02663 (python)

Fixed submission:
h1,m1,h2,m2,k=map(int,input().split(" "))
if h1>h2:
  h2=h2+24
if m2>=m1:
  mk=m2-m1
  T=mk+(h2-h1)*60
else:
  mk=m2+60-m1
  T=mk+(h2-h1-1)*60
print(T-k)

Buggy submission (verdict: Runtime Error):
h1,m1,h2,m2,k=map(int,input().split(" "))
if h1>h2:
  h2=h2+24
if m2>=m1:
  mk=m2-m1
  T=mk+(h2-h1)*60
print(T-k)
Problem p02700 (python)

Fixed submission:
line=input().split(" ")
a=int(line[0])
b=int(line[1])
c=int(line[2])
d=int(line[3])

while a>0 and c>0:
  c=c-b
  if c<=0:
    print("Yes")
    break
  a=a-d
  if a<=0:
    print("No")
    break

Buggy submission (verdict: Runtime Error):
line=input().split(" ")
a=int(line[0])
b=int(line[1])
c=int(line[2])
d=int(line[3])
 
while a>0 and c>0:
  c=c-b
  if c<=0:
    print("Yes")
    break
  a=a-d
  if a<=0:
    print("No")
    break
line=input().split(" ")
a=int(line[0])
b=int(line[1])
c=int(line[2])
d=int(line[3])

while a>0 and c>0:
  c=c-b
  if c<=0:
    print("Yes")
    break
  a=a-d
  if a<=0:
    print("No")
    break
Problem p02731 (python)

Fixed submission:
L = int(input())

print((L/3)**3)

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

# 各数字の個数を格納
dict = {}
for a in A:
    if a in dict:
        dict[a] += 1
    else:
        dict[a] = 1

# k番目の値を除いたlistで同じ数字を引く回数を出力
memo = {}
for k in range(N):
    ans = 0
    m = A[k]
    if m in memo.keys():
        ans = memo[m]
    else:
        dict_work = dict.copy()
        dict_work[m] -= 1
        for d in dict_work.values():
            if d > 1:
                ans += (d * (d - 1)) // 2
        memo[m] = ans
    print(ans)
Problem p02732 (python)

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

# 各数字の個数を格納
dict = {}
for a in A:
    if a in dict:
        dict[a] += 1
    else:
        dict[a] = 1

# k番目の値を消さない場合の場合分けの個数
ans = 0
for d in dict.values():
    if d > 1:
        ans += (d * (d - 1)) // 2

# k番目の値を除いた場合に減る場合の数を引いて答えを出力
for k in range(N):
    w = dict[A[k]]
    # 減る数
    decrease = 0
    if w == 1:
        pass
    elif w == 2:
        decrease = -1
    elif w > 2:
        decrease = ((w - 1) * (w - 2) // 2) - (w * (w - 1) // 2 )
    print(ans + decrease)

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

# 各数字の個数を格納
dict = {}
for a in A:
    if a in dict:
        dict[a] += 1
    else:
        dict[a] = 1

# k番目の値を消さない場合の場合分けの個数
ans = 0
for d in dict.values():
    if d > 1:
        ans += (d * (d - 1)) // 2

# k番目の値を除いた場合に減る場合の数を引いて答えを出力
memo = {}
for k in range(N):
    w = dict[A[k]]
    # 減る数
    if w == 1:
        pass
    elif w == 2:
        decrease = -1
    elif w > 2:
        decrease = ((w - 1) * (w - 2) // 2) - (w * (w - 1) // 2 )
    print(ans + decrease)
Problem p02778 (python)

Fixed submission:
S = input()
print("x" * len(S))

Buggy submission (verdict: Runtime Error):
S = input()
print(x * len(S))
Problem p02923 (python)

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

if N == 1:
    print(0)
else:
    ans = 0
    H1 = H[0]
    H2 = H[1]
    count = 1
    move = 0
    while count != N:
        count += 1
        if H2 <= H1:
            move += 1
            ans = max(ans, move)
        else:
            move = 0
        if count != N:
            H1 = H2
            H2 = H[count]

    print(ans)

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

ans = 0
count = 0
for i in range(N):
    if H[i] >= H[i + 1]:
        count += 1
    else:
        ans = max(ans, count)
        count = 0

print(ans)

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

if N == 1:
    print(0)
else:
    ans = 0
    H1 = H[0]
    H2 = H[1]
    count = 1
    move = 0
    while count != (N):
        count += 1
        if H2 <= H1:
            move += 1
            ans = max(ans, move)
        else:
            move = 0
        if count != N:
            H1 = H2
            H2 = H[count]

print(ans)
Problem p02983 (python)

Fixed submission:
L, R = map(int, input().split())
MOD = 2019
l = L % MOD
r = R % MOD
ans = 2019

if l >= r or l == 0 or r == 0 or (R - L) >= 2019:
    ans = 0
else:
    for i in range(l, r):
        for j in range(l + 1, r + 1):
            if j <= i:
                continue
            else:
                ans = min(ans, i * j % MOD)

print(ans)

Buggy submission (verdict: Runtime Error):
L, R = map(int, input().split())
MOD = 2019
l = L % MOD
r = R % MOD
ans = 2019

if l >= r or l == 0 or r == 0　or (R - L) >= 2019:
    ans = 0
else:
    for i in range(l, r):
        for j in range(l + 1, r + 1):
            if j <= i:
                continue
            else:
                ans = min(ans, i * j % MOD)

print(ans)
Problem p03060 (python)

Fixed submission:
N = int(input())
X = list(map(int, input().split()))
Y = list(map(int, input().split()))
ans = 0
         
for i in range(N):
         ans += max(X[i] - Y[i], 0)

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
X = list(map(int, input().split())
Y = list(map(int, input().split())
ans = 0
         
for i in range(N):
         ans += max(X[i] - Y[i]), 0)

print(ans)
Problem p03109 (python)

Fixed submission:
S = input()
s = S[5:7] + S[8:10]
s = int(s)

if s < 501:
  print('Heisei')
else:
  print('TBD')

Buggy submission (verdict: Runtime Error):
S = input()
s = S[4:6] + S[7:9]
s = int(s)

if s < 501:
  print('Heisei')
else:
  print('TBD')
Problem p03206 (python)

Fixed submission:
D = int(input())

if D == 25:
  print('Christmas')
elif D == 24:
  print('Christmas Eve')
elif D == 23:
  print('Christmas Eve Eve')
else:
  print('Christmas Eve Eve Eve')

Buggy submission (verdict: Runtime Error):
D = int(input())

if D = 25:
  print('Christmas')
elif D = 24:
  print('Christmas Eve')
elif D = 23:
  print('Christmas Eve Eve')
else:
  print('Christmas Eve Eve Eve')
Problem p03238 (python)

Fixed submission:
N = int(input())
if N == 1:
  print('Hello World')
else:
  A = int(input())
  B = int(input())
  print(A + B)

Buggy submission (verdict: Runtime Error):
N = int(input())
XYH = [list(map(int, input().split())) for _ in range(N)]
H_list= [XYH[i][2] for i in range(N)]
H_max = max(H_list)
H_min = min(H_list)
H_diff = H_max - H_min
ans = []

# 高さH,中心座標を(Cx, Cy)として総当たりで試す
for H in range(H_max - (200 - H_diff), H_max + (201 - H_diff)):
    for Cx in range(0, 101):
        for Cy in range(0, 101):
            count = 0
            for X, Y, h in XYH:
                if h == max(H - abs(X - Cx) - abs(Y - Cy), 0):
                    count += 1
                else:
                    break

            if count == N:
                ans = [str(Cx), str(Cy), str(H)]

print(' '.join(ans))

Buggy submission (verdict: Runtime Error):
N = int(input())
if N == 1:
  print('Hello World')
else:
  A, B = map(int, input().split())
  print(A + B)
Problem p03359 (python)

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

if b < a:
	print(a-1)
else:
	print(a)

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

M = max(A, B, C)

SUM = M*(2**K)

if M == A:
	SUM+=(B+C)

if M == B:
	SUM+=(A+C)

if M == C:
	SUM+=(A+B)

print(SUM)

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

M = max(A, B, C)

SUM = M*(2**K)

print(M)

if M == A:
	SUM+=(B+C)

if M == B:
	SUM+=(A+C)

if M == C:
	SUM+=(A+B)

print(SUM)

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

M = max(A, B, C)

SUM = M*(2**K)

print(M)

if M == A:
	SUM+=(B+C)

if M == B:
	SUM+=(A+C)

if M == C:
	SUM+=(A+B)

print(SUM)
Problem p03385 (python)

Fixed submission:
S = list(input())
S.sort()
a = ''.join(S)
if a == 'abc':
	print('Yes')
else:
	print('No')

Buggy submission (verdict: Runtime Error):
S = sort(input())

if S == 'abc':
	print('Yes')
else:
	print('No')
Problem p03545 (python)

Fixed submission:
ABCD = input()

for i in range(2 ** 3):
    op = format(i, '03b')
    op = op.replace('1', '+').replace('0', '-')
    formula = ABCD[0] + op[0] + ABCD[1] + op[1] + ABCD[2] + op[2] + ABCD[3]
    if eval(formula) == 7:
        print(formula + '=7')
        break

Buggy submission (verdict: Runtime Error):
ABCD = input()

for i in range(2 ** 3):
    op = format(i, '03b')
    op = op.replace('1', '+').replace('0', '-')
    formula = ABCD[0] + op[0] + ABCD[1] + op[1] + ABCD[2] + op[2]
    if eval(formula) == 7:
        print(formula + '=7')
        break
Problem p03547 (python)

Fixed submission:
X, Y = input().split()

if X > Y:
  print('>')
elif X == Y:
  print('=')
else:
  print('<')

Buggy submission (verdict: Runtime Error):
X, Y = input().split()

if X > Y:
  print('>')
elif X = Y:
  print('=')
else:
  print('<')
Problem p03555 (python)

Fixed submission:
C1 = input()
C2 = input()

if C1[0] == C2[2] and C1[1] == C2[1] and C1[2] == C2[0]:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
C1 = input()
C2 = input()

if C1[0] == C[2] and C1[1] == C2[1] and C1[2] == C2[0]:
  print('YES')
else:
  print('NO')
Problem p03573 (python)

Fixed submission:
A, B, C = map(int, input().split())
if A == B:
  print(C)
elif B == C:
  print(A)
else:
  print(B)

Buggy submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
if A == B:
  print('C')
elif B == C:
  print('A')
else:
  print('B)
Problem p03607 (python)

Fixed submission:
'''
全量のリストを用いると検索対象が大きくなってしまうため、ディクショナリで都度追加/削除する
'''

N = int(input())

A = {}

for _ in range(N):
    tmp = int(input())
    if tmp in A:
        del A[tmp]
    else:
        A[tmp] = 1

print(len(A))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(input()) for _ in range(N)]
A.sort()

ans = 0
a = A[0]
work = 1
for i in (1, N):
    if A[i] == a:
        work += 1
    else:
        if work % 2 == 0:
            pass
        else:
            ans += 1
        work = 1
        a = A[i]

print(ans)
Problem p03623 (python)

Fixed submission:
x, a, b = map(int, input().split())
if abs(x - a) < abs(x - b):
    print('A')
else:
    print('B')

Buggy submission (verdict: Runtime Error):
x, a, b = map(int, input().split())
if (abs(x - a) < abs(x - b):
    print('A')
else:
    print('B')
Problem p03693 (python)

Fixed submission:
r, g, b = input().split()
print('YES' if int(g+b)%4==0 else 'NO')

Buggy submission (verdict: Runtime Error):
r, g, b = input().split()
print('YES' int(g+b)%4==0 else 'NO')
Problem p04012 (python)

Fixed submission:
w = list(input())
s = set(w)
s = list(s)
ans = 'Yes'

for i in range(len(s)):
  if w.count(s[i]) % 2 == 1:
    ans = 'No'
    break

print(ans)

Buggy submission (verdict: Runtime Error):
w = list(input())
s = set(w)
ans = 'Yes'

for i in range(len(s)):
  if w.count(s[0]) % 2 == 1:
    ans = 'No'
    break

    print(ans)
Problem p04029 (python)

Fixed submission:
N = int(input())

print(int((1 + N) * N / 2))

Buggy submission (verdict: Runtime Error):
N = int(input())

print(int((1 + N) * N / 2)
Problem p02612 (python)

Fixed submission:
N = int(input())
if N%1000 == 0:
  print(0)
else:
  
  a = N//1000 + 1
  print(a*1000 -N)

Buggy submission (verdict: Runtime Error):
N = int(input())
d = {}
d['AC'] = 0
d['WA'] = 0
d['TLE'] = 0
d['RE'] = 0

for i in range(N):
  x = input()
  d[x] +=1
for j in d.keys():
  print(j + " " + "x" + " " + str(d[j]))
  print("\n")
Problem p02657 (python)

Fixed submission:
A,B = map(int,input().split())
print(A*B)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
x = 1

for i in range(N):
  x*= A[i]
  
if x>pow(10,18):
  print(-1)
else:
  print(x)
Problem p02681 (python)

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

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
if (T[:-1] == S):
  return "Yes"
else :
  return "No"
Problem p02719 (python)

Fixed submission:
#!/usr/bin/env python
# coding: utf-8

# In[10]:


N,K = map(int,input().split())
new = N % K
n2 = K - new

print(min(new,n2))

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
# coding: utf-8

# In[10]:


N,K = int(input()), int(input())
new = abs(N-K)
while(new<N):
    N = new 
    new = abs(new-K)
print(N)

Buggy submission (verdict: Runtime Error):
N = int(input())
K = int(input())
n1 = N%K
n2 = K -n1
print(min(n1,n2))

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
# coding: utf-8

# In[10]:


N,K = int(input()), int(input())
new = abs(N%K)
while(new<N):
    N = new
    new = abs(new%K)
print(N)

Buggy submission (verdict: Runtime Error):
N,K = int(input()), int(input())
new = abs(N-K)
while(new<N):
    N = new
    new = abs(new-K)
print(N)
Problem p03160 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
dp = [0 for i in range(N)]
dp[0] = 0
dp[1] = abs(A[1] - A[0])
for i in range(2,N):
  dp[i] = min( dp[i-1] + abs(A[i] - A[i-1]),dp[i-2] + abs(A[i] - A[i-2]))
  
print(dp[N-1])

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
dp = [0 for i in range(N)]
dp[0] = 0
dp[1] = abs(A[1] - A[0])
for i in range(2,N):
  dp[i] = min( dp[i-1] + abs(A[i] - A[i-1]),dp[i-2] + abs(A[i] - A[i-2]))
  
print(dp[n-1])