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: Accepted

Solution code:

if __name__ == '__main__':
    N=int(input())
    sheet=[]
    for i in range(N):
        temp=int(input())
        sheet.append(temp)
    sheet.sort()
    count=0
    i=0
    while i<N:
        s=sheet[i]
        j=i
        while i<N and sheet[i]==s:
            i+=1
        d=i-j
        if d%2==1:
            count+=1

    print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
from collections import defaultdict
D = defaultdict(int)
for i in range(N):
    D[int(input())] += 1
ans = 0
for value in D.values():
    if value % 2 == 1:
        ans += 1
print(ans)

Submission status: Accepted

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

d = defaultdict(int)

for a in A:
    d[a] ^= 1
answer = sum(d.values())
print(answer)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
h={}
N=int(input())
for i in range(N):
    a=int(input())
    if( a in h):
        h.pop(a)
    else:
        h[a]=1

print(len(h))

Submission status: Accepted

Solution code:
from collections import defaultdict
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def main():
    n=int(input())
    cnt=defaultdict(int)
    for _ in range(n):
        a=int(input())
        cnt[a]+=1
    print(sum(v%2 for v in cnt.values()))
main()

Submission status: Accepted

Solution code:
n = int(input())
a = set()
for _ in range(n):
    a ^= {input()}
print(len(a))

Submission status: Accepted

Solution code:
import collections
n = int(input())

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

c = collections.Counter(r)
count = 0
for key, v in c.items():
  if v % 2 != 0:
    count += 1
print(count)

Submission status: Accepted

Solution code:
N = int(input())

input_set = set()
for _ in range(N):
    a = int(input())
    if a in input_set:
        input_set.remove(a)        
    else:
        input_set.add(a)
    
print(len(input_set))

Submission status: Accepted

Solution code:
n = int(input())
a = set()
for i in range(n) :
    ai = int(input())
    if ai in a :
        a.remove(ai)
    else :
        a.add(ai)
else :
    print(len(a))

Submission status: Accepted

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

from collections import Counter
c = Counter(m)
ans = 0
for k in c.keys():
    if c[k] % 2 == 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = sorted([int(input()) for _ in range(n)])
ans = 0
tmp = 1
for i in range(n-1):
    if a[i] == a[i+1]:
        tmp += 1
    else:
        if tmp%2 == 1:
            ans += 1
        tmp = 1
if tmp%2 == 1:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
from collections import defaultdict
d = defaultdict(int)
n = int(input())
for _ in range(n):
  d[int(input())] += 1
ans = 0
for i in d.values():
  ans += i%2
print(ans)

Submission status: Accepted

Solution code:
import numpy as np
import collections
N = int(input())
a_list = [int(input()) for i in range(N)]

counter = collections.Counter(a_list)
val_array = np.array(list(counter.values()))
mod2_array = val_array % 2

ans_dict = collections.Counter(mod2_array)
ans = ans_dict[1]
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter

N = int(input())
P = []
for i in range(N):
  P.append(int(input()))
  
Pc = Counter(P)

ans = 0
for k, v in Pc.items():
  if v%2 != 0:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
a=[]
for i in range(n):
    a.append(int(input()))
import collections as c
d=c.Counter(a)
x=list(d.items())
cnt=0
for i in x:
    if i[1]%2==1:
        cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
import collections
N = int(input())
A = [int(input()) for i in range(N)]
c = collections.Counter(A).most_common()
ans = 0
for i in range(len(c)):
    ans += c[i][1] % 2
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter
n=int(input())
A=Counter([int(input()) for i in range(n)])
print(sum(1 if count%2 else 0 for count in A.values()))

Submission status: Accepted

Solution code:
from collections import Counter

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

ans=0
c=Counter(a)
c_m=c.most_common()
for i in range(len(c_m)):
    if int(c_m[i][1])%2!=0:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
d = dict()
for _ in range(n):
    num = int(input())
    d[num] = d.get(num, 0) + 1
ans = 0
for i in d.items():
    ans += i[1] % 2

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
num_count = {}
for _ in range(N):
    num = int(input())
    if num_count.get(num):
        num_count[num] += 1
    else:
        num_count[num] = 1
        
left_num = 0
for value in num_count.values():
    left_num += value%2
    
print(left_num)

Submission status: Accepted

Solution code:
N = int(input())
A = {}
for _ in range(N):
    a = int(input())
    if a not in A:
        A[a] = 1
    else:
        A[a] += 1
count = 0
for val in A.values():
    if val % 2 == 0:
        continue
    else:
        count+= 1
print(count)

Submission status: Accepted

Solution code:
from collections import Counter

n = int(input())
aa = [int(input()) for _ in range(n)]

c=Counter(aa)
ans = 0

for i,j in c.most_common():
  ans+=j%2

print(ans)

Submission status: Accepted

Solution code:
from sys import stdin
from itertools import accumulate
from itertools import groupby

n = int(stdin.readline().rstrip())
li = [int(stdin.readline().rstrip()) for _ in range(n)]
point = 0
li.sort()

lin = []
for key, value in groupby(li):
    lin.append(len(list(value)))

for i in lin:
    if i%2 == 1:
        point += 1

print(point)

Submission status: Accepted

Solution code:
import sys
from collections import Counter

input = sys.stdin.readline

def main():
    N = int(input())
    A = Counter([int(input()) for i in range(N)])

    print(sum([1 for c in A.values() if c % 2]))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
N = int(input())
d = {}
for i in range(N):
    a = int(input())
    if a not in d.keys():
        d[a] = 1
    else:
        d[a] += 1
ans = 0
for a in d.items():
    ans += a[1] % 2
print(ans)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
s = set()
for _ in range(N):
  x = int(input())
  if x in s:
    s.discard(x)
  else: s.add(x)
print(len(s))

Submission status: Accepted

Solution code:
A = set()
for i in range(int(input())):
	A ^= set([int(input())])
print(len(A))

Submission status: Accepted

Solution code:
import collections

N = int(input())
nums = [int(input()) for i in range(N)]

counts = collections.Counter(nums)

con = 0

for i in counts.values():
  if i % 2 == 1:
    con += 1
    
print(con)

Submission status: Accepted

Solution code:
n = int(input())
a = [int(input()) for _ in range(n)]
b = set(a)
d = {i: 0 for i in b}

for i in a:
    d[i] += 1

ans = 0
for v in d.values():
    if v%2 == 1:
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import heapq
n=int(input())
a=[]
for i in range(n):
    a.append(int(input()))
heapq.heapify(a)
ans=0
cnt=0
x=0
while len(a)>0:
    d=heapq.heappop(a)
    #print(d)
    if cnt!=d:
        cnt=d
        ans+=1
        x=1
    elif cnt==d and x%2==1:
        ans-=1
        x+=1
    elif cnt==d and x%2==0:
        ans+=1
        x+=1
print(ans)

Submission status: Accepted

Solution code:
import collections
A = []
N = int(input())
for _ in range(N):
	A.append(int(input()))
	
c = collections.Counter(A)
res = 0

for i in c.values():
	if i % 2 != 0:
		res += 1
		
print(res)

Submission status: Accepted

Solution code:
n = int(input())

A = {}

for i in range(n):
    a = int(input())
    if a in A:
        A[a] += (-1)**A[a]
    else:
        A[a] = 1

ans = 0
for k, v in A.items():
    ans += v

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
D = {}
ans = 0
for _ in range(N):
    a = int(input())
    if a in D:
        del D[a]
        ans -= 1
    else:
        D[a] = 1
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
arr = [int(input()) for _ in range(N)]
dic = {}
for i in arr:
    if i in dic:
        dic[i] += 1
    else:
        dic[i] = 1
a = 0
for value in dic.values():
    if value % 2 == 1:
        a += 1
print(a)

Submission status: Accepted

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

A.sort()
ans = 0
cnt = 1
temp = A[0]
for i in range(1, N):
    if A[i] == temp:
        cnt += 1
    else:
        ans += cnt%2
        cnt = 1
        temp = A[i]
        
ans += cnt%2
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter
n=int(input())
L=[int(input()) for i in range(n)]
LC=Counter(L)
c=0
for k in LC.keys():
    if LC[k]%2==1:
        c+=1
print(c)

Submission status: Accepted

Solution code:
def examC():
    N = I()
    d = defaultdict(int)
    for _ in range(N):
        A = I()
        d[A] +=1
    ans = 0
    for i in d.values():
        if i%2==1:
            ans +=1
    print(ans)

import sys
import copy
import bisect
import heapq
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examC()

Submission status: Accepted

Solution code:
s = set()
for _ in range(int(input())):
  n = int(input())
  if n in s:
    s.discard(n)
  else:
    s.add(n)
print(len(s))

Submission status: Accepted

Solution code:
N=int(input())
A=[int(input())for _ in range(N)]
A.sort()
ans=0
ptr=0

while(ptr<N):
    cc=A[ptr]
    f=0

    while ptr<N and A[ptr]==cc:
        f += 1
        ptr += 1
    
    ans += f%2

print(ans)

Submission status: Accepted

Solution code:
N=int(input())
D={}
for i in range(N):
    a=int(input())
    if a in D:
        D[a]+=1
    else:
        D[a]=1

ans=0
for i,j in D.items():
    if j%2==1:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
A = [int(input()) for i in range(N)]
keys = list(set(A))
values = [0]*len(keys)
dic = {}
dic.update(zip(keys,values))
for i in A:
    dic[i] += 1
tmp = [i%2 for i in dic.values()]
print(sum(tmp))

Submission status: Accepted

Solution code:
N=int(input())
A=[int(input())for _ in range(N)]
A.sort()
ans=0
check=0
ptr=0
while(ptr<N):
    cc=A[ptr]
    f=0
    while ptr<N and A[ptr]==cc:
        f+=1
        ptr+=1
    ans+=f%2
print(ans)

Submission status: Accepted

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

c = collections.Counter(a)

ans = [k for k,v in c.items() if v%2]
print(len(ans))

Submission status: Accepted

Solution code:
from collections import Counter
n=int(input())
m=0
a=[int(input()) for _ in range(n)]
d=list(Counter(a).values())
for i in range(len(d)):
  if d[i]%2==1:
    m+=1
print(m)

Submission status: Accepted

Solution code:
import collections as col

n = int(input())
li = [int(input()) for _ in range(n)]
c = col.Counter(li)
ans = 0
for i in c.keys():
  if c[i]%2 == 1:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
paper = {}
cnt = 0
for i in range(n):
    ai = input()
    if paper.get(ai, 0) == 0:
        paper[ai] = 1
        cnt += 1
    else:
        paper[ai] = 0
        cnt -= 1
print(cnt)

Submission status: Accepted

Solution code:
N = int(input())
A_set = set()
for _ in range(N):
    A = int(input())
    if A in A_set:
        A_set.remove(A)
    else:
        A_set.add(A)

print(len(A_set))

Submission status: Accepted

Solution code:
n=int(input())
s=[]
for _ in range(n):
    s.append(int(input()))
# print(n)
# print(s)
i=1
cnt=1
ans=0
s.sort()
# print(s)

tmp=s[0]
for i in range(1,n):
    # print(s[i])
    if tmp==s[i]:
        cnt+=1
    else:
        tmp=s[i]
        if cnt % 2 == 1:
            ans+=1
        cnt=1
    if i==n-1 and cnt%2==1:
        ans+=1

print(ans)

Submission status: Accepted

Solution code:
#Write and Erase
N = int(input())
A = [0 for i in range(N)]
for i in range(N):
    A[i] = int(input())
A.sort()
n = 1
p = 0
for i in range(N-1):
    if A[i] != A[i+1]:
        n = n + 1
        p = 0
    else:
        if p == 0:
            n = n - 1
            p = p + 1
        else:
            n = n + 1
            p = p - 1
print(n)

Submission status: Accepted

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

import collections
counter=collections.Counter(a)

ans=0
for val in counter.values():
  ans+=(val%2==1)

print(ans)

Submission status: Accepted

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

dict = {}

for a in A:
    if a not in dict.keys():
        dict[a] = 1
    else:
        dict[a] += 1

cnt = 0
for v in dict.values():
    if v % 2 == 1:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
import collections
N=int(input())
L = [int(input()) for i in range(N)]
count=collections.Counter(L)
count_values=count.values()
print(len([i for i in count_values if i %2==1]))

Submission status: Accepted

Solution code:
import collections

n = int(input())
a = list()

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

dic = collections.Counter(a)
    
dic_list = list(dic.values())
ans = 0
for i in range(len(dic_list)):
    if dic_list[i] % 2 == 1:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
a =set([])
for i in range(N):
  b = int(input())
  if b in a:
    a.remove(b)
  else:
    a.add(b)
print(len(a))

Submission status: Accepted

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

for i in range(N):
  if A[i] in s:
    s.remove(A[i])
  else:
    s.add(A[i])
    
print(len(s))

Submission status: Accepted

Solution code:
import sys
from collections import Counter

N = int(input())
A = Counter([int(sys.stdin.readline()) for _ in range(N)])
ans = 0
for key, num in A.items():
  if num%2==1: ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

ns = set()

for i in range(n):
    a = int(input())
    if a not in ns:
        ns.add(a)
    else:
        ns.remove(a)

print(len(ns))

Submission status: Accepted

Solution code:
n = int(input())
A = [0] * n
for i in range(n):
  A[i] = int(input())
from collections import Counter
C = Counter(A)
counter = 0
for val in C.values():
  counter += val % 2
print(counter)

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())
A = []
for i in range(N):
    ai = int(input())
    A.append(ai)
dic = Counter(A)
cnt=0
for idx, val in dic.items():
    if val%2 != 0:
        cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
N = int(input())

ans = 0
paper = {} #key:数字 value:出てきた回数

#いちいち書いて消してするのはTLEになりそうなので、出た回数で記録する

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

Submission status: Accepted

Solution code:
import collections
n=int(input())
a=[int(input()) for _ in range(n)]
ca = collections.Counter(a)
cak = list(ca.values())
res = [i for i in cak if i % 2 ==1]
print(len(res))

Submission status: Accepted

Solution code:
from collections import defaultdict

N = int(input())
nums = {}

for _ in range(N):
    a = int(input())
    if a in nums:
        nums[a] = (nums[a] + 1) % 2
    else:
        nums[a] = 0

cnt = 0

for key,value in nums.items():
    if value == 0:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
n = int(input())

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

num_list.sort()
num_list2 = []
i = 0
while i < n:
    if i == n-1:
        num_list2.append(num_list[i])
        break
    elif num_list[i] == num_list[i+1]:
        i += 2
    else:
        num_list2.append(num_list[i])
        i += 1


print(len(num_list2))

Submission status: Accepted

Solution code:
#feel like this is to easy

def read_input():
  n = int(input())
  a = []
  for i in range(n):
    a.append(int(input()))
  return n,a

def TLE():
  n,a = read_input()
  sheet = []
  for item in a:
    if item not in sheet:
      sheet.append(item)
    else:
      sheet.pop(sheet.index(item))
  print(len(sheet))
  
def TLE2():
  n,a = read_input()
  items = list(set(a))
  count = 0
  for item in items:
    if a.count(item)%2 != 0:
      count += 1
  print(count)

def main():
  n,a = read_input()
  a.sort()
  items = list(set(a)).sort()
  t = 1
  count = 0
  for i in range(len(a)):
    if i+1 == len(a):
      count += t%2
      break
    if a[i] == a[i+1]:
      t += 1
    else:
      count += t%2
      t = 1
  print(count)

if __name__ == '__main__':
  main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
numset=set()
for i in range(N):
    num=int(input())
    if(num in numset):
        numset.discard(num)
    else:
        numset.add(num)

print(len(numset))

Submission status: Accepted

Solution code:
N = int(input())
A = [int(input()) for _ in range(N)]
A.sort()
cnt = 1
ans = 0
if len(A) == 1:
    print(1)
    exit()
for i in range(1,N):
    if A[i-1] == A[i]:
        cnt += 1
    else:
        ans += cnt%2
        cnt = 1
if cnt >= 1:
    ans += cnt%2
print(ans)

Submission status: Accepted

Solution code:
from sys import stdin
from collections import Counter

n, *a = (int(x) for x in stdin.read().split())

count = 0
for v in Counter(a).values():
    if v % 2 == 1: count += 1

print(count)

Submission status: Accepted

Solution code:
from sys import stdin

n, *a = (int(x) for x in stdin.read().split())

each_count = {n: 0 for n in set(a)}


for n in a:
    each_count[n] += 1

count = 0
for v in each_count.values():
    if v % 2 == 1: count += 1

print(count)

Submission status: Accepted

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

A.sort()
sa = sorted(set(A))

ans_dict = {}
for num in sa:
    ans_dict[num] = -1

for num in A:
    ans_dict[num] *= -1

ans = []
for num, value in ans_dict.items():
    if value == 1:
        ans.append(num)

print(len(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict

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

d = defaultdict(int)
for a in A:
    d[a] += 1

ans = 0
for k, v in d.items():
    if v % 2 == 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
lists=[]
n=int(input())
for i in range(n):
  a=int(input())
  lists.append(a)
import collections
dicdic=collections.Counter(lists)
dicdic=dict(dicdic)
ans=0
for i in dicdic.values():
  if i%2!=0:
    ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

    A.sort()

    d = {}
    x = A[0]
    cnt = 1
    # print(A)
    for ai in A[1:]:
        if ai == x:
            cnt += 1
        else:
            d[x] = cnt
            x = ai
            cnt = 1
    d[x] = cnt

    ans = 0
    for i in d.values():
        if i % 2 == 1:
            ans += 1

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

    d = {}
    for ai in A:
        if d.get(ai):
            d[ai] += 1
        else:
            d[ai] = 1

    cnt = 0
    for v in d.values():
        if v % 2 != 0:
            cnt += 1

    print(cnt)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

print(len(list(filter(lambda x: x[1]%2 == 1, c.items()))))

Submission status: Accepted

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

dict_ = dict()
for key in list_:
    dict_[key] = dict_.get(key, 0) + 1
print(sum(num % 2 for num in dict_.values()))

Submission status: Accepted

Solution code:
N = int(input())
A = [int(input()) for i in range(N) ]
paper = {}
for a in A:
  if a in paper:
    paper.pop(a)
  else:
    paper[a] = True
print( len(paper) )

Submission status: Accepted

Solution code:
N=int(input())
A=[int(input()) for i in range(N)]
A.sort()
c=1
ans=0

for i in range(1,N):
    if A[i]!=A[i-1]:
        if c%2==1:
            ans+=1
        c=1
    else:
        c+=1

if c%2==1:
    ans+=1

print(ans)

Submission status: Accepted

Solution code:
from collections import Counter

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

a_c = Counter(a).most_common() 
ans = 0
for i in a_c: 
    if i[1] % 2 == 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
import collections
n=int(input())
a=[]
for _ in range(n):
    a.append(int(input()))
c = collections.Counter(a)
ans=0
for k,v in c.items():
    if v % 2 != 0:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
import collections
n=int(input())
a=[int(input()) for _ in range(n)]
c = collections.Counter(a)
ans=0
for k,v in c.items():
    if v % 2 != 0:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
a=int(input())
lis=[]
anlis=[]
for j in range(a):
  lis+=[int(input())]
lis.sort()
i=0
while i<len(lis):
  if i==len(lis)-1:
    anlis+=[lis[i]]
  elif lis[i]!=lis[i+1]:
    anlis+=[lis[i]]
  else:
    i+=1
  i+=1
print(len(anlis))

Submission status: Accepted

Solution code:
import collections

n = int(input())
a = [ input() for _ in range(n)]
b = collections.Counter(a)
c = b.values()
c = list(c)
m = len(b)
ans = 0
for i in range(m):
    if c[i]%2==0:
        continue
    else:
        ans +=1
print(ans)

Submission status: Accepted

Solution code:
import collections

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

counter = collections.Counter(a)
ans = 0
for k, v in counter.items():
    if v % 2 != 0:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
from copy import deepcopy
from sys import exit,setrecursionlimit
import math
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac
import fractions
from functools import reduce
import bisect
import sys
import logging
import heapq

#logging.basicConfig(level=logging.DEBUG)

input = sys.stdin.readline

setrecursionlimit(1000000)


def main():
	n = int(input())
	d = defaultdict(int)
	for _ in range(n):
		t = int(input())
		if(d[t] == 0):
			d[t] += 1
		else:
			d[t] -= 1
	ans = 0
	for v in d.values():
		ans += v
	print(ans)

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

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

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

	return arr

def zip(a):
	mae = a[0]
	ziparray = [mae]
	for i in range(1,len(a)):
		if(mae != a[i]):
			ziparray.append(a[i])
			mae = a[i]
	return ziparray

def is_prime(n):
	if n < 2: return False

	for k in range(2, int(math.sqrt(n)) + 1):
		if n % k == 0:
			return False

	return True

def list_replace(n,f,t):
	return [t if i==f else i for i in n]

def base_10_to_n(X, n):
	X_dumy = X
	out = ''
	while X_dumy>0:
		out = str(X_dumy%n)+out
		X_dumy = int(X_dumy/n)
	if(out == ''): return '0'
	return out

def lcm(numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

class Queue():
	def __init__(self):
		self.q = deque([])
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.popleft()
	def size(self):
		return len(self.q)
	def debug(self):
		return self.q

class Stack():
	def __init__(self):
		self.q = []
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.pop()
	def size(self):
		return len(self.q)
	def debug(self):
		return self.q

class graph():
	def __init__(self):
		self.graph = defaultdict(list)
	def addnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].append(t)
		self.graph[t].append(f)
	def rmnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].remove(t)
		self.graph[t].remove(f)
	def linked(self,f):
		return self.graph[f]

class dgraph():
	def __init__(self):
		self.graph = defaultdict(set)
	def addnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].append(t)
	def rmnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].remove(t)
	def linked(self,f):
		return self.graph[f]

class PriorityQueue():
	def __init__(self):
		self.queue = []
	def push(self,i):
		heapq.heappush(self.queue,-i)
	def pop(self):
		return -1 * heapq.heappop(self.queue)
	def sum(self):
		return -sum(self.queue)

main()

Submission status: Accepted

Solution code:
from collections import Counter

def main():
    N, *A = map(int, open(0).read().split())
#     print(N, A)
    c = Counter(A)
#     print(c)

    print(sum(v & 1 for v in c.values()))

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
from functools import reduce
import copy
import math
from pprint import pprint
import collections
import bisect


sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def int_inputs(num_of_input):
    ins = [int(input()) for i in range(num_of_input)]
    return ins


def solve(inputs):
    numbers = inputs
    number_set = set()

    for n in numbers:
        if n in number_set:
            number_set.remove(n)
        else:
            number_set.add(n)
    return len(number_set)


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    N = int(input())
    ret = solve(int_inputs(N))
    print(ret)

Submission status: Accepted

Solution code:
n = int(input())
ary = [int(input()) for _ in range(n)]
dic = {}
cnt = 0
for num in ary:
    if num in dic:
        dic[num] += 1
    else:
        dic[num] = 1
for item in dic.items():
    if item[1] % 2 == 1:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
import collections
n= int(input())
a = [int(input()) for _ in range(n)]
answer =0 
counter = collections.Counter(a)
for c in counter.values():
  if c % 2==1:
    answer+=1
print(answer)

Submission status: Accepted

Solution code:
N = int(input())
A = []
for i in range(N):
    A.append(int(input()))
d = {}
ans = 0
for i in range(N):
    if A[i] in d:
        d[A[i]] += 1
    else:
        d[A[i]] = 1

for i in d:
    if d[i] % 2 == 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
import collections
table=collections.defaultdict(int)
N=int(input())
for i in range(N):
  table[input()]+=1
table=list(table.values())
table=[table[i] for i in range(len(table)) if table[i]%2==1]
print(len(table))

Submission status: Accepted

Solution code:
n=int(input())
cnt={}
for i in range(n):
    a=int(input())
    cnt[a]=cnt.get(a,0)+1
ans=0
for v in cnt.values():
    if v%2==1:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
import collections

N=int(input())
A=[int(input()) for i in range(N)]
c=collections.Counter(A)
l=list(c.values())
s=0
for i in l:
    s+=i%2
print(s)

Submission status: Accepted

Solution code:
N=int(input())
s=set()
for i in range(N):
    A=int(input())
    if A not in s:
        s.add(A)
    else:
        s.remove(A)
print(len(s))

Submission status: Accepted

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

for i in range(n):
    #a.append(int(input()))
    num = int(input())
    if num in numSet:
        numSet.remove(num)
    else:
        numSet.add(num)

print(len(numSet))

Submission status: Accepted

Solution code:
import collections

N = int(input())

List = {}
for i in range(N):
    A = int(input())
    if List.get(A,None)==None:
        List[A]=1
    else:
        del List[A]

c = collections.Counter(List)

print(len(c))

Submission status: Accepted

Solution code:
n = int(input())

dic = {}

for i in range(n):
    a = input()

    if a in dic.keys():
        dic[a] += 1
    else:
        dic[a] = 1

ans = 0
for i in dic.values():
    if i%2 == 1:
        ans += 1



print(ans)

Submission status: Accepted

Solution code:
Dic = {}
N = int(input())
for _ in range(N):
    a = int(input())
    if a in Dic.keys():
        Dic[a] += 1
    else:
        Dic[a] = 1
ans = 0
for v in Dic.values():
    if v % 2 == 1:
        ans += 1
print(ans)