Problem:


Score : 300 points

Problem Statement

You are playing the following game with Joisino.

Initially, you have a blank sheet of paper.

Joisino announces a number. If that number is written on the sheet, erase the number from the sheet; if not, write the number on the sheet. This process is repeated N times.

Then, you are asked a question: How many numbers are written on the sheet now?

The numbers announced by Joisino are given as A_1, ... ,A_N in the order she announces them. How many numbers will be written on the sheet at the end of the game?

Constraints

1≤N≤100000

1≤A_i≤1000000000(=10^9)

All input values are integers.

Input

Input is given from Standard Input in the following format:

N
A_1
:
A_N

Output

Print how many numbers will be written on the sheet at the end of the game.

Sample Input 1

3
6
2
6

Sample Output 1

1

The game proceeds as follows:

6 is not written on the sheet, so write 6.

2 is not written on the sheet, so write 2.

6 is written on the sheet, so erase 6.

Thus, the sheet contains only 2 in the end. The answer is 1.

Sample Input 2

4
2
5
5
2

Sample Output 2

0

It is possible that no number is written on the sheet in the end.

Sample Input 3

6
12
22
16
22
18
12

Sample Output 3

2



Sample input:
3
6
2
6


Sample output:
1

Submission status: Wrong Answer

Solution code:
# 20
n = int(input())
a = [int(input()) for i in range(n)]
al = list(set(a))

print(len(al)-(len(a)-len(al)))

Submission status: Wrong Answer

Solution code:
## 20
n = int(input())
a = [0 for i in range(10**6)]

for i in range(n):
    num = (int(input())-1)%10**3
    a[num] += 1
    a[num] %= 2
    
    
print(a.count(1))

Submission status: Wrong Answer

Solution code:
## 20
n = int(input())
a = [0 for i in range(10**5)]

for i in range(n):
    num = (int(input())-1)%10**4
    a[num] += 1
    a[num] %= 2
    
    
print(a.count(1))

Submission status: Wrong Answer

Solution code:
N = int(input())
AA =[]
for i in range(N):
  a = int(input())
  AA.append(a)
AA.sort()

count = 1
for i in range(1,len(AA)):
  if AA[i] !=AA[i-1]:
    count +=1
  else:
    count -=1
print(count)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 23 16:58:10 2020

@author: liang
"""

N = int(input())
A = [int(input()) for _ in range(N)]
A.sort()
A += [-1]
ans = 0
count = 1
for i in range(N):
    print(count)
    if A[i] == A[i+1]:
        #print("A")
        count += 1
    else:
        #print("B")
        if count%2 == 1:
            ans += 1
        count = 1
print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 23 16:58:10 2020

@author: liang
"""

N = int(input())
A = [int(input()) for _ in range(N)]+[-1]
A.sort()
ans = 0
count = 1
for i in range(N):
    if A[i] == A[i+1]:
        count += 1
    else:
        if count%2 == 1:
            ans += 1
        count = 1
print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 23 16:58:10 2020

@author: liang
"""

N = int(input())
A = [int(input()) for _ in range(N)]
A.sort()
ans = 0
count = 1
for i in range(N-1):
    if A[i] == A[i+1]:
        count += 1
    else:
        if count%2 == 1:
            ans += 1
        count = 1
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import copy
import math
import itertools
#import numpy as np
import re

N = int(input())
A = [int(input()) for c in range(N)]
A = sorted(A)

tmp = 0
cnt = 0
for i in range(N-1):
    tmp += 1
    if A[i] == A[i+1]:
        pass
    else:
        cnt += tmp%2
        tmp = 0

if len(set(A)) == 1:
    cnt = 1

print(cnt)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=[]
for n in range(N):
    A.append(int(input()))

A.sort()

cnt=1
ans=0
for n in range(1,N):
    if A[n]==A[n-1]:
        cnt+=1
    else:
        if cnt%2==1:
            ans+=1
        cnt=1
print(ans)

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
n = int(input())
li = []
for i in range(n):
    li.append(int(input()))

dic = defaultdict(int)
for i in li:
    if dic[i] == 0:
        dic[i] = 1
    elif dic[i] == 1:
        dic[i] = 0

ans = 0
for i in li:
    if dic[i] == 1:
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
# ABC 073: C – Write and Erase
N = int(input())
A = [int(input()) for _ in range(N)]

'''
nums = []

for num in A:
    if num not in nums:
        nums.append(num)
    else:
        del nums[nums.index(num)]

print(len(nums))
'''

nums = {}

for num in nums:
    if num not in nums:
        nums.add(num)
    else:
        nums.discard(num)

print(len(nums))

Submission status: Wrong Answer

Solution code:
from collections import Counter
n = int(input())
a = [int(input()) for i in range(n)]
c = Counter(a)
ans = 0
for i in range(n):
    if c[a[i]] % 2 == 1:
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
paper = dict()
for i in range(n):
    a = int(input())
    if a not in paper:
        paper[a] = 1
    else:
        paper[a] = 0

res = 0
for value in paper.values():
    if value == 1:
        res += 1
print(res)

Submission status: Wrong Answer

Solution code:
6
12
22
16
22
18
12

Submission status: Wrong Answer

Solution code:
n = int(input())
a = []

for i in range(n):
    a.append(int(input()))

a = sorted(a)

hoge = 0
foo = 0
ans = 0

for i in range(n):
    if i == 0:
        foo = a[i]
        hoge = 1
    elif foo == a[i]:
        hoge = 1-hoge
    else:
        if hoge == 1:
            ans += 1
        foo = a[i]
        hoge = 1

print(ans)

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    a_lst = [int(input()) for _ in range(n)]
    a_lst.sort()

    count = 0
    tmp = 0
    number = a_lst[0]

    for i in range(n):

        if a_lst[i] == number:
            tmp += 1

            if i == n - 1:
                if tmp % 2 != 0:
                    count += 1

        else:
            number = a_lst[i]

            if tmp % 2 == 0:
                tmp = 1
                continue
            else:
                count += 1
                tmp = 1

    print(count)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    a_lst = [int(input()) for _ in range(n)]
    a_lst.sort()

    count = 0
    tmp = 0
    number = a_lst[0]
    
    for i in range(n):
        if a_lst[i] == number:
            tmp += 1
            
            if i == n - 1:
                if tmp % 2 != 0:
                    count += 1
        
        else:
            number = a_lst[i]

            if tmp == 0:
                count += 1

            else:
                if tmp % 2 == 0:
                    tmp = 0
                    continue
                else:
                    count += 1
                    tmp = 0

    print(count)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    a_lst = [int(input()) for _ in range(n)]
    a_lst.sort()

    tmp = 0
    count = 0
    number = a_lst[0]
    for i in range(n):
        if a_lst[i] == number:
            tmp += 1
        else:
            number = a_lst[i]

            if tmp == 0:
                count += 1

            else:
                if tmp % 2 == 0:
                    tmp = 0
                    continue
                else:
                    count += 1
                    tmp = 0

    print(count)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys


def solve(N: int, A: "List[int]"):
    from collections import Counter    
    return sum(map(lambda x: x == 1, Counter(A).values()))


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    print(solve(N, A))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n = ri()
cnt = 0
for v in collections.Counter([ri() for _ in range(n)]).values():
    if v&1==0:
        cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = []
for i in range(n):
  a.append(int(input()))
a.sort()
jud = 1
q = a[0]
ans = 0
for i in range(1,n):
  if(q==a[i]):
    jud += 1
  else: 
    if(jud%2==1):
      ans += 1
    jud = 1
    q = a[i]
if (jud%2==1)and(jud>2):
  ans += 1
if(n==1):
  ans = 1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = []
for i in range(n):
  a.append(int(input()))
a.sort()
jud = 1
q = a[0]
ans = 0
for i in range(1,n):
  if(q==a[i]):
    jud += 1
  else: 
    if(jud%2==1):
      ans += 1
    jud = 1
    q = a[i]
if (jud%2==1)and(jud>2):
  ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = []
for i in range(n):
  a.append(int(input()))
a.sort()
jud = 1
q = a[0]
ans = 0
for i in range(n):
  if(q==a[i]):
    jud += 1
  else: 
    if(jud%2==1):
      ans += 1
    jud = 1
if (jud%2==1)and(jud>2):
  ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = []
for i in range(n):
  a.append(int(input()))
a.sort()
jud = 0
q = a[0]
ans = 0
for i in range(n):
  if(q==a[i]):
    jud += 1
  else: 
    if(jud%2==1):
      ans += 1
    jud = 1
if (jud%2==1):
  ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = []
ans = 0
for i in range(n):
  a.append(int(input()))
a.sort()
jud = 1
q = a[0]
ans = 0
for i in range(1,n):
  if(q==a[i]):
    jud += 1
  else: 
    if(jud%2==1):
      ans += 1
    jud = 1
    q = a[i]
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = []
ans = 0
for i in range(n):
  a.append(int(input()))
a.sort()
i = 0
jud = 1
q = a[0]
ans = 0
for i in range(1,n):
  if(q==a[i]):
    jud += 1
  else:
    if(jud%2==1):
      ans += 1
    jud = 1
    q = a[i]
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = []
ans = 0
for i in range(n):
  a.append(int(input()))
a.sort()
i = 0
jud = 1
q = [a[0]]
ans = 0
for i in range(1,):
  if(q[-1]==a[i+1]):
    jud += 1
  else:
    if(jud%2==1):
      ans += 1
    jud = 1
print(ans)

Submission status: Wrong Answer

Solution code:
import collections
n = int(input())
a = []
for _ in range(n):
    a.append(int(input()))
ans = collections.Counter(a)

Submission status: Wrong Answer

Solution code:
n=int(input())
d={}
for i in range(n):
  A=int(input())
  if A not in d:
    d[A]=1
  elif d[A]==1:
    d[A]==0
  else:
    d[A]=1
print(sum(d.values()))

Submission status: Wrong Answer

Solution code:
import collections
n=int(input())
d={}
for i in range(n):
  A=int(input())
  if A in d:
    d[A]=0
  else:
    d[A]=1
print(sum(d.values()))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(input()) for _ in range(N)]
from collections import Counter
counter = dict(Counter(A))
ans = 0
for a in A:
    if counter[a] % 2 == 1:
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(input()) for _ in range(N)]
dic = {a: False for a in A}
for a in A:
    dic[a] = True if not dic[a] else False
ans = 0
for a in A:
    ans += dic[a]
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
A=[int(input()) for _ in range(n)]
B={}
for i in A:
    if i in B:
        B[i]=0
    else:
        B[i]=1
print(sum(B.values()))

Submission status: Wrong Answer

Solution code:
n=int(input())
A=sorted([int(input()) for _ in range(n)])
cnt=0
for i in range(1,len(A)):
    if A[i-1]==A[i]:
        i+=1
        cnt+=1
print(len(A)-cnt*2)

Submission status: Wrong Answer

Solution code:
n = int(input())

d = {}
for i in range(n):
    a = int(input())
    if a in d:
        d[a] ^= 1
print(sum(d.values()))

Submission status: Wrong Answer

Solution code:
n=int(input())
if(n==1):
  print(1)
  exit()
hoge=[]
for i in range(n):
    hoge.append(int(input()))
hoge.sort()
ans=0
now=hoge[0]
for i in range(1,n):
  huga=hoge[i]
  if(huga==now):
    now=-1
  elif(now==-1):
    now=huga
  else:
    ans+=1
    now=huga
print(ans)

Submission status: Wrong Answer

Solution code:
import collections


def solve():
    pass


n = int(input())
A = []
for i in range(n):
    a = int(input())
    A.append(a)

c = collections.Counter(A)
cnt = 0
for k, v in c.items():
    if v % 2 == 0: continue
    else: cnt += v
print(cnt)

Submission status: Wrong Answer

Solution code:
import collections


def solve():
    pass


n = int(input())
A = []
for i in range(n):
    a = int(input())
    A.append(a)

c = collections.Counter(A)
cnt = 0
for k, v in c.items():
    if v % 2 == 0: continue
    cnt += v
print(cnt)

Submission status: Wrong Answer

Solution code:
N=int(input())
S=[]
a=0
b=0
for i in range(N):
  A=int(input())
  S.append(A)
  for j in range(i):
    if S[j]==A:
      a=a+1
      b=b-1
      break
  if a==0:
    b=b+1
  a=0
  
print(b)

Submission status: Wrong Answer

Solution code:
N=int(input())
S=[]
a=0
b=0
for i in range(N):
  A=int(input())
  S.append(A)
  for j in range(i):
    if S[j]==A:
      a=a+1
      break
  if a==0:
    b=b+1
  else:
    b=b-1
    a=0
  
print(b)

Submission status: Wrong Answer

Solution code:
n=int(input())
num=[]
l=[]
count=0
for _ in range(n):
    a=int(input())
    l.append(a)
l=sorted(l)
for i in l:
    if num==[]:
        num.append(i)
    elif num[0]!=i:
        if len(num)%2!=0:
            count+=1
        num=[i]
    else:
        num.append(i)
print(count)

Submission status: Wrong Answer

Solution code:
n=int(input())
num=[]
l=[]
count=0
for _ in range(n):
    a=int(input())
    l.append(a)
l=sorted(l)
print(l)
for i in l:
    if num==[]:
        num.append(i)
    elif num[0]!=i:
        if len(num)%2!=0:
            count+=1
        num=[i]
    else:
        num.append(i)
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(input()) for _ in range(N)]
A=sorted(A)
 
ans=0
cnt=0
tmp=A[0]
 
for i in range(1,N):
    if A[i]==tmp:
        cnt+=1
    else:
      if cnt%2!=0:
        ans=+1
      cnt=1
    tmp=A[i]
    
if cnt%2==1:
  ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(input()) for _ in range(N)]
A=sorted(A)
 
ans=0
cnt=1
tmp=A[0]
 
for i in range(1,N):
    if A[i]==tmp:
        cnt+=1
    else:
      if cnt%2!=0:
        ans=+1
      cnt=1
    tmp=A[i]
    
if cnt%2==1:
  ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(input()) for _ in range(N)]
A=sorted(A)
 
ans=0
cnt=1
tmp=A[0]
 
for i in range(1,N):
    if A[i]==tmp:
        cnt+=1
    elif A[i]!=tmp and cnt%2!=0:
        cnt=1
        ans+=1
    tmp=A[i]
if cnt%2 ==1:
  ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(input()) for _ in range(N)]
A=sorted(A)

ans=0
cnt=1
tmp=A[0]

for i in range(1,N):
    if A[i]!=tmp and cnt%2==0:
        tmp=A[i]
        cnt=1
    elif A[i]!=tmp and cnt%2!=0:
        tmp=A[i]
        cnt=1
        ans+=1
    elif A[i]==tmp:
        cnt+=1

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(input()) for _ in range(N)]

A=sorted(A)
ans=0
tmp=-1

for i in range(N):
    if A[i]!=tmp:
        ans+=1
        tmp=A[i]
    else:
        ans-=1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(input()) for i in range(N)]

vA=sorted(set(A))
oA=[0]*len(set(A))

for i in range(N):
    x=vA.index(A[i])
    oA[x]+=1
ans=0
for i in range(len(oA)):
    if oA[i]!=2:
        ans +=1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
d = dict()
for _ in range(n):
    k = int(input())
    if d.get(k) == None:
        d[k] = 1
    else:
        d[k] = 0

print(sum(d.values()))

Submission status: Wrong Answer

Solution code:
import numpy as np
n=int(input())
l=[]
for i in range(n):
    l.append(int(input()))
l.sort()
ans=0
if l[0]!=l[1]:
    ans+=1
for i in range(1,n-1):
    if l[i]!=l[i-1] and l[i]!=l[i+1]:
        ans+=1
if l[n-1]!=l[n-2]:
    ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np
n=int(input())
l=[]
for i in range(n):
    l.append(int(input()))
l.sort()
ans=0
if l[0]!=l[1]:
    ans+=1
for i in range(1,n-1):
    if l[i]!=l[i-1] and l[i]!=l[i+1]:
        ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np
n=int(input())
l=[]
for i in range(n):
    l.append(int(input()))
l.sort()
ans=0
for i in range(n-1):
    if l[i]!=l[i-1] and l[i]!=l[i+1]:
        ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np
n=int(input())
l=[]
for i in range(n):
    l.append(int(input()))
l.sort()
ans=0
for i in range(len(l)-1):
    if l[i]!=l[i-1] and l[i]!=l[i+1]:
        ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
def c(s):
    n = input()
    if n in s:
        s.remove(n)
    else:
        s.add(n)

def main():
    n = int(input())
    s = set()

    for i in range(n):
        c(s)

    return print(s)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n=int(input())
d={}
for x in range(n):
  s=int(input())
  if s in d:
    if d[s]==0:
      d[s]=1
    else:
      d[s]=0
      
  if s not in d:
    d[s]=1
  
ans=0
for y in d:
  if d[y]==1:
    ans+=1

Submission status: Wrong Answer

Solution code:
n=int(input())
d={}
for x in range(n):
  s=int(input())
  if s in d:
    d[s]=0
  if s not in d:
    d[s]=1
  
ans=0
for y in d:
  if d[y]==1:
    ans+=1
    
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(input()) for i in range(n)]
ans = 0
a.sort()
cnt = 1
for i in range(1, n):
  if a[i-1] == a[i]:
    cnt += 1
  else:
    if cnt % 2 == 1:
      ans += 1
    cnt = 1
print(ans)

Submission status: Wrong Answer

Solution code:
4
2
5
5
2

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(input()) for i in range(n)]
ans = 0
sa = list(set(a))
for i in range(len(sa)):
  if a.count(sa[i]) % 2 == 1:
    ans += a.count(sa[i])
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
from heapq import heapify, heappop
read=sys.stdin.read

n,*a=map(int,read().split())
a.append(max(a)+1)
heapify(a)
x=heappop(a)
f=1
ans=0
while a:
  y=heappop(a)
  if x==y:
    f^=1
  else:
    ans+=1-f
    f=1
    x=y
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = []

for i in range(n):
    a = int(input())
    A.append(a)

A.sort()

odd = 0
prev = A[0]
cnt = 1

for i in range(1,n):
    if A[i] != prev:
        if cnt % 2 == 1:
            odd += 1
        cnt = 1
        prev = A[i]
    else:
        cnt += 1

print(odd)

Submission status: Wrong Answer

Solution code:
from collections import Counter
n = int(input())
l = []
for i in range(n):
   l.append(int(input()))
lcnt = Counter(l)
l_value = list(lcnt.values())
for i in range(len(l_value)):
   if  l_value[i]%2 == 0:
       l_value[i] = 0
print(sum(l_value))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(int(input()) for i in range(n))
b = len(set(a))
a = len(a)

print(b - (a - b))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(input()) for i in range(n)]

l = sorted(a)
same = 1
count = 0
for i in range(1, n):
    if l[i] == l[i - 1]:
        same += 1
        continue
    elif same % 2 == 1:
        count += 1
    same = 1
if l[n - 1] != l[n - 2]:
    count += 1
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(input()) for i in range(n)]

l = sorted(a)
same = 1
count = 0
for i in range(1, n):
    if l[i] == l[i - 1]:
        same += 1
        continue
    if same % 2 == 1:
        count += 1
    same = 1
if l[n - 1] != l[n - 2]:
    count += 1
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())

p = ""
for _ in range(n):
    a = input()
    if a in p:
        p = p.replace(a, "")
    else:
        p += a
else:
    print(len(p))

Submission status: Wrong Answer

Solution code:
from collections import Counter
N = int(input())
C = Counter([int(input()) for _ in range(N)])
print(sum(list(filter(lambda x: x % 2 == 1, list(C.values())))))

Submission status: Wrong Answer

Solution code:
n = int(input())
ls = []

for i in range(n):
    a = int(input())
    ls.append(a)

ls.sort()

ans = 0
k = -1
count = 0
for i in range(n):
    if ls[i] != k and i != n - 1:
        if count % 2 == 1:
            ans += 1
        count = 1
        k = ls[i]
    elif i == n - 1:
        if count % 2 == 0:
            ans += 1
    else:
        count += 1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
ls = []

for i in range(n):
    a = int(input())
    ls.append(a)

ls.sort()

ans = 0
k = -1
count = 0
for i in range(n):
    if ls[i] != k:
        if count % 2 == 1:
            ans += 1
        count = 1
        k = ls[i]
    else:
        count += 1
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
b=set(a)
ans=0
for i in b:
  if a.count(i)%2==1:
    ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
C = {}
for _ in range(n):
    a = input()
    if a not in C:
        C[a] = 0
    C[a] += 1
print(C)
for i in C.keys():
    C[i] %= 2
print(sum(C.values()))

Submission status: Wrong Answer

Solution code:
import collections

n = int(input())
an = []
for i in range(n):
    a = input()
    an.append(a)

c = list(str(collections.Counter(an).values()).replace('dict_values([','').replace('])','').replace(', ',''))
Ans = 0
for i in range(len(c)):
    if int(c[i]) % 2 == 1:
        Ans = Ans + 1

print(Ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
a = [input() for _ in range(n)]
a.sort()
count = 0
i=0
while i<n-1:
  j=i+1
  ex=1
  while j<n:
    if a[j]==a[i]:
      ex=1-ex
      j+=1
    else:
      i=j+1
      count+=ex
      break
print(count+1)

Submission status: Wrong Answer

Solution code:
n=int(input())
a = [input() for _ in range(n)]
a.sort()
print(a)
count = 0
i=0
while i<n-1:
  j=i+1
  ex=1
  while j<n:
    if a[j]==a[i]:
      ex=1-ex
      j+=1
    else:
      i=j+1
      count+=ex
      break
print(count+1)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(input()) for _ in range(n)]

b = set(sorted(a))

print(len(b) * 2 - len(a))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
n = int(input())
dd = defaultdict(int)

for i in range(n):
    dd[int(input())] += 1

ans = 0
for k,v in dd.items():
    if v == 1:
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=[int(input()) for _ in range(N)]
A.sort()
ans=0
b=A[0]
c=0
for i in range(N):
  if b!=A[i]:
    ans+=(c%2)
    b=A[i]
    c=1
  else:
    c+=1
print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=[int(input()) for _ in range(N)]
A.sort()
ans=0
b=A[0]
c=0
for i in range(N):
  if b!=A[i]:
    if c%2!=0:
      ans+=1
    b=A[i]
    c=1
  else:
    c+=1
print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=[int(input()) for _ in range(N)]
A.sort()
ans=0
b=0
c=0
for i in range(N):
  if b!=A[i]:
    if c%2!=0:
      ans+=1
    b=A[i]
    c=1
  else:
    c+=1
print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

## Library

import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools

## input

# n=int(input())
# A,B,C,D=map(int, input().split())
# string = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for i in range(M)]

N = int(input())
A = [int(input()) for _ in range(N)]
C = collections.Counter(A)

ans = 0

for i in range(1,N+1):
    if C[i] % 2 == 1:
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
arr=[0]*n
for i in range(n):
    arr[i]=int(input())

arr=sorted(arr)
num=arr[0]
tmp=1
ans=0
for i in range(1,n):
    if arr[i]==num:
        tmp+=1
    else:
        if tmp%2==1:
            ans+=1
        num=arr[i]
        tmp=1
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[int(input()) for i in range(n)]
a=sorted(a)
ans=[]
num=1
for i in range(n-1):
    if a[i]==a[i+1]:
        num+=1
    else:
        if num%2!=0:
            ans.append(a[i])
        if i+1==n-1:
            ans.append(a[i])
        num=1
print(len(ans))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[int(input()) for i in range(n)]
a=sorted(a)
ans=[]
prev_a=a.pop()
num=1
for i in range(n-1):
    current_a = a.pop()
    if prev_a == current_a:
        num+=1
    else:
        if num%2!=0:
            ans.append(current_a)
        if len(a)==0:
            ans.append(current_a)
        num=1
    prev_a=current_a
print(len(ans))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[int(input()) for i in range(n)]
a=sorted(a)
ans=[]
prev_a=a.pop()
num=1
for i in range(n-1):
    current_a = a.pop()
    if prev_a == current_a:
        num+=1
    else:
        if num%2==0:
            if len(a)==0:
                ans.append(current_a)
        elif num%2!=0:
            ans.append(current_a)
            if len(a)==0:
                ans.append(current_a)
        num=1
    prev_a=current_a
print(len(ans))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[int(input()) for i in range(n)]
a=sorted(a)
ans=[]
prev_a=a.pop()
num=1
for i in range(len(a)):
    current_a = a.pop()
    if prev_a == current_a:
        num+=1
    else:
        if num%2!=0:
            ans.append(current_a)
        num=1
    prev_a=current_a
print(len(ans))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(input()) for _ in range(n)]

from collections import Counter

c = Counter(a)

print(sum([1 for num,cnt in c.items() if cnt&2==1]))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(input()) for _ in range(n)]

from collections import Counter

c = Counter(a)

print(sum([1 for num,cnt in c.items() if cnt&2]))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(input()) for _ in range(n)]

from collections import Counter

c = Counter(a)

print(sum([1 for num,cnt in c.items() if cnt^2]))

Submission status: Wrong Answer

Solution code:
N = int(input())
count = 0
num = set([])

for i in range(N):
    tmp = int(input())
    if tmp not in num:
        num.add(tmp)
    else:
        count += 1

print(len(num) - count)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = []
 
for _ in range(n):
    a = int(input())
    l.append(a)

l.sort()

ans = 0
cnt = 1
tmp = l[0]
for i in range(1,len(l)):
    if tmp == l[i]:
        cnt += 1
        tmp = l[i]
    else:
        if cnt%2 != 0:
            ans += 1
            cnt = 1
            tmp = l[i]
        else:
            cnt = 1
            tmp = l[i]

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = []
 
for _ in range(n):
    a = int(input())
    l.append(a)

l.sort()
print(l)
ans = 0
cnt = 1
tmp = l[0]
for i in range(1,len(l)):
    if tmp == l[i]:
        cnt += 1
        tmp = l[i]
    else:
        if cnt%2 != 0:
            ans += 1
            cnt = 1
            tmp = l[i]
        else:
            cnt = 1
            tmp = l[i]

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [input() for _ in range(N)]
a = set(A)
ans_list = list()
ans_list.append(len(a))
while len(A) > 0:
  for i in a:
    if i in A:
      A.remove(i)
  ans_list.append(len(A))

ans = 0
for i in ans_list:
  if ans_list.index(i) % 2 == 0:
    ans += i
  else:
    ans -= i
  	
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = [int(input()) for _ in range(n)]
l.sort()
c = 1
t = l[0]
ans = 0
for i in range(1, n):
  if t == l[i]:
    c += 1
  else:
    ans += c%2
    c = 1
    t = l[i]
if n == 1 or l[-2] != l[-1]:
  ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = [int(input()) for _ in range(n)]
l.sort()
c = 1
t = l[0]
ans = 0
for i in range(1, n):
  if t == l[i]:
    c += 1
  else:
    ans += c%2
    c = 1
    t = l[i]
if n == 1:
  ans = 1
print(ans)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

N = int(input())
d = {}
for i in range(N):
    a = int(input())
    if a in d:
        d[a] = 0
    else:
        d[a] = 1
cnt = 0
for a in d:
    if d[a]:
        cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
import sys
N = int(input())
A = []
for _ in range(N):
    A.append(int(input())) 

# 0の時と、全部が同じ数の時の場合分け。

if N == 1:
    print(1)
    sys.exit()

if set(A) == 1:
    print(0)
    sys.exit()

A = sorted(A)


count = 1
ans = 0
firstnum = A[0] 
for i in range(1,N):
    if firstnum == A[i]:
        count = count + 1
    else:
        if count % 2 == 0:
            count = 1
        else:
            ans = ans + 1
            count = 1

    firstnum = A[i]  
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
N = int(input())
A = []
for _ in range(N):
    A.append(int(input())) 


# 0の時と、全部が同じ数の時の場合分け。

if N == 1:
    print(1)
    sys.exit()

if set(A) == 1:
    print(0)
    sys.exit()

A = sorted(A)


count = 0
ans = 0
firstnum = A[0] 
for i in range(1,N):
    if firstnum == A[i]:
        count = count + 1
    
    elif firstnum != A[i]:
        if count % 2 == 0:
            ans = ans + 1
            count = 0
        else:
            count = 0

    firstnum = A[i]  
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
N = int(input())
A = []
for _ in range(N):
    A.append(int(input())) 


# 0の時と、全部が同じ数の時の場合分け。

if N == 1:
    print(1)
    sys.exit()

if set(A) == 1:
    print(0)
    sys.exit()

A = sorted(A)


count = 0
ans = 0
firstnum = A[0] 
for i in range(1,N):
    if firstnum == A[i]:
        count = count + 1
    
    elif firstnum != A[i]:
        if count == 0 or count % 2 == 0:
            ans = ans + 1
            count = 0
        else:
            count = 0

    firstnum = A[i]  
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
N = int(input())
A = []
for _ in range(N):
    A.append(int(input())) 


# 0の時と、全部が同じ数の時の場合分け。

if N == 1:
    print(1)
    sys.exit()

if set(A) == 1:
    print(1)
    sys.exit()

A = sorted(A)


count = 0
ans = 0
firstnum = A[0] 
for i in range(1,N):
    if firstnum == A[i]:
        count = count + 1
    
    elif firstnum != A[i]:
        if count == 0 or count % 2 == 0:
            ans = ans + 1
            count = 0
        else:
            count = 0

    firstnum = A[i]  
print(ans)