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:
n = int(input())
paper = {}

for i in range(n):
  number = input()
  if number in paper:
    del paper[number]
  else:
    paper[number] = 1;

print(len(paper))

Submission status: Accepted

Solution code:
n = int(input())
num_dict = dict()
for i in range(n):
    num = int(input())
    num_dict.setdefault(num, 0)
    num_dict[num] = (num_dict[num]+1)%2

print(sum([x for x in num_dict.values()]))

Submission status: Accepted

Solution code:
N = int(input())
d = {}
for _ in range(N):
    a = int(input())
    d[a] = d.setdefault(a, 0) + 1

res = 0
for v in d.values():
    res += v % 2
print(res)

Submission status: Accepted

Solution code:
n = int(input())
ans = set()

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

print(len(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict

def solve(n, A):
    d = defaultdict(lambda: False)
    count = 0
    for a in A:
        if not d[a]:
            d[a] = True
            count += 1
        else:
            d[a] = False
            count -= 1
    return count

_n = int(input())
_A = [int(input()) for _ in range(_n)]
print(solve(_n, _A))

Submission status: Accepted

Solution code:
import collections

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

cc = dict(collections.Counter(lst))
ans = 0
for i in cc.values():
  if (i % 2 != 0):
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
nums = [int(input()) for _ in range(n)]
cnt = {}
ans = 0
for x in nums:
    if x not in cnt:
        cnt[x] = 1
    else:
        cnt[x] += 1
for y in cnt.values():
    if y % 2 != 0:
        ans += 1

print(ans)

Submission status: Accepted

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

a.sort()
ans=0
m=1

for i in range(1,n):
    if a[i-1] == a[i]:
        m+=1
    else:
        ans+=(m%2)
        m=1

ans+=(m%2)

print(ans)

Submission status: Accepted

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

d = defaultdict(int)

for num in nums:
    d[num] += 1

ans = len([i for i, j in d.items() if j % 2 != 0])
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

numberdict = dict()
for i in range(N):
    A_i = int(input())
    if A_i in numberdict:
        numberdict[A_i] += 1
    else:
        numberdict[A_i] = 1
ans = 0
for j in numberdict.keys():
    if numberdict[j] % 2 == 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
from collections import defaultdict


dict = defaultdict(int)
n = int(input())
for _ in range(n):
    a = int(input())
    dict[a] += 1

ans = 0
for num, count in dict.items():
    if count % 2 == 1:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

A = {}

for i in range(N):
    Ai = int(input())
    if Ai in A:
        A.pop(Ai)
        
    else :
        A[Ai] = 1

print(len(A))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
from itertools import permutations, combinations
from fractions import gcd
from collections import Counter
from math import sqrt
import sys
input = sys.stdin.readline
def lcm(x, y):
    return (x*y//gcd(x, y))
def small_letters():
    return [chr(i) for i in range(97, 97+26)]
def capital_letters():
    return [chr(i) for i in range(65, 65+26)]


def main():
    """ここに書いてね"""
    N = int(input())
    A_list = [int(input()) for i in range(N)]
    ans = 0
    counter = Counter(A_list)
    for i in counter.values():
        if i % 2 == 1:
            ans += 1
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

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


import collections

counter = collections.Counter(Numbers)

#print(counter)

ans = 0

for i in counter.values():
    if i % 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)]
c = Counter(a)
ans = 0
for i in c:
    if c[i]%2 == 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:

N=int(input())
S=set()
for i in range(N):
    s=str(input())
    S^={s}
print(len(S))

Submission status: Accepted

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

cnt = 0
now = -1
ans = 0
for a in v:
    if a == now:
        cnt += 1
    else:
        ans += cnt % 2
        now = a
        cnt = 1

ans += cnt % 2
print(ans)

Submission status: Accepted

Solution code:
import collections
N = int(input())
A = collections.Counter([int(input()) for _ in range(N)])
A = A.values()
ans = [x for x in A if x&1]
print(len(ans))

Submission status: Accepted

Solution code:
import collections

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

ans = [x for x in A if x&1]
print(len(ans))

Submission status: Accepted

Solution code:
import sys
import collections

input = sys.stdin.readline


def main():
    N = int(input())
    C = collections.Counter()
    for _ in range(N):
        C[int(input())] += 1

    ans = 0
    for k in C.keys():
        if C[k] & 1:
            ans += 1

    print(ans)




    

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:


def main():
    n = int(input())
    m = {}
    for i in range(n):
        a = int(input())
        m.setdefault(a,0)
        m[a] = (m[a] + 1) % 2
    print(sum(m.values()))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

for i in numbers.values():
    answer += i % 2

print(answer)

Submission status: Accepted

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

for i in range(N):
    new = int(input())
    A.append(new)

A.sort()
A.append(0)

start=A[0]
cnt=1
anscnt=0

for i in range(1,len(A)):

    if A[i]==start:
        cnt+=1
    elif A[i]!=start:
        if cnt%2==0:
            anscnt+=cnt
        elif cnt%2!=0:
            anscnt+=cnt-1    
        cnt=1
        start=A[i]


print(N-anscnt)

Submission status: Accepted

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

paper = {}

for a in A:
    paper.setdefault(a - 1, 0)
    paper[a - 1] += 1

ans = len(list(filter(lambda x: x % 2 == 1, paper.values())))
print(ans)

Submission status: Accepted

Solution code:
import sys
 
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()
nas = lambda: stdin.readline().split()

from collections import defaultdict

m = defaultdict(int)

n = ni()
for i in range(n):
    a = ni()
    if m[a] == 0:
        m[a] = 1
    else:
        m[a] = 0

print(sum(m.values()))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
#S = list(str(input()))
#N = int(input())
#S = str(input())
N = int(input())
T = {}
for _ in range(N) :
  a = int(input())
  if a not in T :
    T[a] = ""
  else :
    T.pop(a)
    
print(len(T))

Submission status: Accepted

Solution code:
N=int(input())
s=[input() for _ in range(N)]
s.sort()

ans=1
k=1
for i in range(N-1):
    if s[i]==s[i+1]:
        k=k*(-1)
    else:k=1
    ans+=k
        
print(ans)

Submission status: Accepted

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

y = a[0]
c = 1
ans = 0
for i in range(1, n):
   if (a[i] == y):
      c += 1
   else:
      if (c % 2 == 1):
         ans += 1
      y = a[i]
      c = 1

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
counter = {}
for i in range(int(input())):
    a = int(input())
    if a not in counter:
        counter[a] = 0

    if counter[a] == 0:
        counter[a] = 1
    else:
        counter[a] = 0

print(sum(counter.values()))

Submission status: Accepted

Solution code:
n = int(input())
dic = {}
for _ in range(n):
  a = int(input())
  if a in dic:
    dic[a] += 1
  else:
    dic[a] = 1

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

Submission status: Accepted

Solution code:
import collections
ans=0
n=int(input())
li=[]
for i in range(n):
    li.append(int(input()))
c=collections.Counter(li).values()
for i in c:
  ans+=i%2
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
s=[int(input())for i in range(n)]
s.sort()
def groupby(a):
    a2=[[a[0],1]]
    for i in range(1,len(a)):
        if a2[-1][0]==a[i]:
            a2[-1][1]+=1
        else:
            a2.append([a[i],1])
    return a2
s=groupby(s)
l=len(s)
cnt=0
for i in range(l):
    cnt+=s[i][1]%2
print(cnt)

Submission status: Accepted

Solution code:


import numpy as np

n=int(input())
a=np.array([int(input()) for i in range(n)])
a=np.sort(a)
ans=0
i=0
while(i<=n-1):
    c=1
    while(i<=n-2 and a[i]==a[i+1]):
        i+=1
        c+=1
    if(c%2==1):ans+=1
    #print(a[i],c)
    i+=1
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
d={}
ans=0
for i in range(n):
    a=int(input())
    try:
        if d[a]%2==0:
            ans+=1
            d[a]+=1
        else:
            ans-=1
            d[a]+=1
    except:
        d[a]=1
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
A=[int(input()) for _ in range(N)]
d=dict()
for a in list(set(A)):
  d[a]=0
for a in A:
  d[a]+=1
ans=0
for a in list(d.keys()):
  if d[a]%2==1:
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
A = [INT() for _ in range(N)]

dic = defaultdict(int)

for x in A:
	dic[x] += 1

print(len([1 for x in dic if dic[x]%2 == 1]))

Submission status: Accepted

Solution code:
N=int(input())
B=set()

for i in range(N):
    a=int(input())
    if a in B:
        B.remove(a)
    else:
        B.add(a)
print(len(B))

Submission status: Accepted

Solution code:
from collections import Counter

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

# count = [0] * (max(a)+1)

c = Counter(a)
ans = 0

for _a in list(set(a)):
    if c[_a]%2 != 0:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
N=int(input())
sets = set()

for n in range(N):
  a = int(input())
  
  if a in sets:
    sets.remove(a)
  else:
    sets.add(a)

print(len(sets))

Submission status: Accepted

Solution code:
# C - Write and Erase
import collections
N = int(input())
a = [int(input()) for i in range(N)]
c = collections.Counter(a)
ans = 0
#print(c)
#print(len(c))
val = list(c.values())
for j in range(len(val)):
    if val[j] % 2 == 0:
        pass
    else:
        ans += 1

print(ans)

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:
N = int(input())
A = [int(input()) for _ in range(N)]

from collections import Counter
ans = 0
for (key, value) in Counter(A).items():
  if value % 2 == 1:
    ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import collections

input = sys.stdin.readline
n = int(input())
A = collections.Counter([int(input()) for _ in range(n)])

keys, cnts = zip(*A.most_common())
ans =0
for cnt in cnts:
    if cnt % 2 != 0:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
#python setは中身の重複がないように要素を管理する.
#n = int(input())
#input関数は入力されたデータを文字列として扱います
#int(input())により, 入力を数値へ変換する.
#setに対して ^ 演算子は XORの働きを持つ.
#len()は, リストをはじめコンテナ型オブジェクトのサイズの取得に使用される関数である

n = int(input())
s = set()

for i in range(n):
  s ^= {input()}

print(len(s))

Submission status: Accepted

Solution code:
n = int(input())
d = {}
for i in range(n):
  v = int(input())
  if v in d:
    d[v] += 1
  else:
    d[v] = 1
ans = 0
for v in d:
  ans += d[v] % 2
print(ans)

Submission status: Accepted

Solution code:
import collections

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

c = collections.Counter(ls)
ls_s =c.most_common()

ans = 0

for i in range(len(ls_s)):
    if ls_s[i][1] % 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:
n=int(input())
dic={}
for i in range(n):
    v=int(input())
    dic[v]=dic.get(v,0)+1
count=0

for k in dic.keys():
    if dic[k]%2!=0:
        count+=1
print(count)

Submission status: Accepted

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

dic={}
count=0

for i in range(n):
    dic[al[i]]=dic.get(al[i],0)+1

for k in dic.keys():
    if dic[k]%2!=0:
        count+=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())

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


cnt = Counter(memo)

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
dic = {}
N = int(input())
for _ in range(N):
  A = int(input())
  if A not in dic:
    dic[A] = 1
  elif dic[A] != 0:
    dic[A] -= 1
  else:
    dic[A] += 1
print(sum(dic.values()))

Submission status: Accepted

Solution code:
n = int(input())
ans = {}
for _ in range(n):
    a = int(input())
    if a not in ans:
        ans[a] = 0
    ans[a] += 1

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

Submission status: Accepted

Solution code:
N = int(input())
A = [int(input()) for i in range(N)]
dicta = {}
for i in A:
    if i not in dicta:
        dicta[i] = 1
    else:
        dicta[i] += 1
ans = 0
for v in dicta.values():
    if v%2 == 1:
        ans += 1
print(ans)

Submission status: Accepted

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

paper=set()
for i in range(n):
    if a[i] not in paper:
        paper.add(a[i])
        continue
    if a[i] in paper:
        paper.discard(a[i])
        continue

print(len(paper))

Submission status: Accepted

Solution code:
import collections

N=int(input())

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

c = collections.Counter(A)

values, counts = zip(*c.most_common())
print(len([i for i in counts if i %2!= 0]))

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

d = {}
for i in range(n):
    if a[i] not in d:
        d[a[i]] = 0
    else:
        del d[a[i]]

print(len(d))

Submission status: Accepted

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

Submission status: Accepted

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

s=set()

for i in range(n):
    if a[i] not in s:
        s.add(a[i])
    else:
        s.discard(a[i])
print(len(s))

Submission status: Accepted

Solution code:
from collections import Counter
n = int(input())
l = [0] * n
ans =0
for i in range(n):
  l[i] = int(input())
print( sum(s%2 for s in Counter(l).values()))

Submission status: Accepted

Solution code:
from collections import Counter
def main():
    n=int(input())
    L=[0]*n
    for i in range(n):
        L[i] = int(input())
    print(sum(s%2 for s in Counter(L).values()))
main()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

N = int(input())

# 集合　listよりも 検索などが高速
# 重複なしの順序も無し
ans_set = set()

for i in range(N):
    A = int(input())
    if A in ans_set:
        ans_set.remove(A)
    else:
        ans_set.add(A)

print(len(ans_set))

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def main():
    N = I()
    d = collections.defaultdict(int)
    for _ in range(N):
        c = S()
        d[c] += 1
    cnt = 0
    for key, val in d.items():
        if val % 2 == 1:
            cnt += 1
    print(cnt)
main()

Submission status: Accepted

Solution code:
N=int(input())
paper={}
for i in range(N):
  a=input()
  if a in paper:
    paper[a]+=1
  else:
    paper[a]=1
counter=0
for key in paper.keys():
  if int(paper[key])%2==1:
    counter+=1
print(counter)

Submission status: Accepted

Solution code:
import collections
n = int (input())
ln = []
ln2 = []
for _ in range(n):
    ln.append( int (input()))

C = collections.Counter(ln)
 
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 = []
for i 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:
n=int(input())
s=set()
for i in range(n):
    a=int(input())
    if a in s:
        s.remove(a)
    else:
        s.add(a)
ans=list(s)
print(len(ans))

Submission status: Accepted

Solution code:
import sys
from collections import Counter
n = int(input())
a_ls = []
for i in range(n):
    a = int(sys.stdin.readline().strip())
    a_ls.append(a)
ct = Counter(a_ls)
print(sum([i % 2 for i in ct.values()]))

Submission status: Accepted

Solution code:
N = int(input())
from collections import defaultdict
dic = defaultdict(int)
for n in range(N):
    a = int(input())
    dic[a] += 1
ans = 0
for key, value in dic.items():
    if value % 2 != 0:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
import collections
N=int(input())
A=[]
answer=0
for i in range(N):
  A+=[int(input())]
C=collections.Counter(A)
P=list(C.values())
for x in P:
  answer +=x%2
print(answer)

Submission status: Accepted

Solution code:
from collections import Counter
n = int(input())
a = [int(input()) for _ in range(n)]
x = Counter(a)
cnt = 0
for i in x.values():
    cnt += i % 2
print(cnt)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
A = []
for _ in range(N):
    A.append(int(input()))
import collections
import numpy as np
c = collections.Counter(A)
d = np.array(list(c.values()))
print(np.count_nonzero(d % 2 == 1))

Submission status: Accepted

Solution code:
import sys
from collections import Counter

n, *a = map(int, sys.stdin.read().split())

def main():
    res = 0
    for c in Counter(a).values():
        res += c & 1

    return res

if __name__ == '__main__':
    ans = main()
    print(ans)

Submission status: Accepted

Solution code:
n = int(input())

myset = set()
for i in range(n):
    a = int(input())
    if a in myset:
        myset.remove(a)
    else:
        myset.add(a)
ans = len(myset)

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

for a in A:
	if a in s:
		s.discard(a)
	else:
		s.add(a)

print(len(s))

Submission status: Accepted

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 c.values():
  if i % 2 == 1:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
f = {}
for _ in range(n):
	x = int(input())
	if x not in f:
		f[x] = 0
	f[x] = f[x] ^ 1
ans = 0
for [x, y] in f.items():
	ans = ans + y
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

cnt = 1; ans = 0
for i in range(1, n):
    if a[i] == a[i-1]:
        cnt ^= 1
    else:
        ans += cnt
        cnt = 1
ans += cnt
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
nums = [int(input()) for i in range(N)]
idxs = set(nums)
ans = {idxs.pop() : 0 for i in range(len(idxs))}
count = 0

for num in nums:
    ans[num] += 1

for i in ans.keys():
    ans[i] = (ans[i] % 2)

print(sum(ans.values()))

Submission status: Accepted

Solution code:
n=int(input()) #1<=n<=100000
a=[input() for i in range(n)]
from collections import Counter
S=Counter(a)
cnt=0
for i in S.values():
  if i%2!=0:
    cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
import sys
n = int(input())
a = [int(i) for i in sys.stdin]
a.sort()
dict = {}
for i in range(n):
  if a[i] in dict:
    del dict[a[i]]
  else: 
  	dict[a[i]]=0
print(len(dict))

Submission status: Accepted

Solution code:
n=int(input())
A=[]
ans=set()
for i in range(n):
    A.append(int(input()))
for a in A:
    if(a in ans):
        ans.remove(a)
    else:
        ans.add(a)
print(len(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
from collections import Counter

def main()->None:
    N = int(input())
    range_N = range(N)
    A = [int(input()) for _ in range_N]

    count_A = Counter(A)

    res = []
    for a in count_A.keys():
        count = count_A[a]
        if count % 2 == 1:
            res.append(a)
    print(len(res))








if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import collections
n = int(input())
a = [int(input()) for i in range(n)]
b = collections.Counter(a)
cnt = 0
for i in b.keys():
	if b[i] % 2 != 0:
		cnt += 1
print (cnt)

Submission status: Accepted

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

def fanc(n, a):
    if n == 1: 
        print(1)
        return 0
    cnt = 0
    while len(a) > 1:
        same_cnt = 0
        j = 1
        while a[0] == a[j]:
            same_cnt += 1
            if j == len(a) - 1:
                break
            j += 1
        if same_cnt  % 2 == 0:
            cnt += 1
        del a[0:same_cnt+1]
    if len(a) == 1: cnt += 1
    print(cnt)
    return 0

fanc(n, a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
d={}
for _ in[0]*int(input()):
    i=input()
    d[i]=d.get(i,0)^1
print(sum(d.values()))

Submission status: Accepted

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

l = [int(input()) for _ in range(n)]
c = Counter(l)

ans = [i for i in c.values() if i % 2 == 1]

print(len(ans))

Submission status: Accepted

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

Submission status: Accepted

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

def groupby(a):
    a2=[[a[0],1]]
    for i in range(1,len(a)):
        if a2[-1][0]==a[i]:
            a2[-1][1]+=1
        else:
            a2.append([a[i],1])
    return a2

y=groupby(x)
c=0
for i in y:
    if i[1]%2==1:
        c+=1
print(c)

Submission status: Accepted

Solution code:
import collections
n = int(input())
nums = collections.defaultdict(int)
ans = 0
for _ in range(n):
    num = int(input())
    nums[str(num)] += 1
for k in nums.keys():
    if nums[k] % 2 == 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
nums = set([])
for _ in range(n):
    num = int(input())
    if num in nums:
        nums.remove(num)
    else:
        nums.add(num)
print(len(nums))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
d = {}
for _ in range(N):
    A = int(input())
    d[A] = not d.get(A, False)

print(sum(d.values()))

Submission status: Accepted

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

al = sorted(al)
ans = 0

before = 0
for a in al:
    if before == a:
        ans -= 1
        before = 0
    else:
        ans += 1
        before = a
    
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter
def ABC073C_WriteAndErase():
    N = int(input().strip())
    Ai = [int(input().strip()) for i in range(N)]


    Bi = Counter(Ai)
    count = 0
    for key, val in Bi.items():
        if val % 2 == 1:
            count += 1

    print(count)
    

def main():
    ABC073C_WriteAndErase()

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import collections

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

B = collections.Counter(A)

count = 0
for key, val in B.items():
    if val % 2 == 1:
        count += 1

print(count)

Submission status: Accepted

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

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())
dic = {}
for _ in range(n):
  tmp = int(input())
  if tmp in dic and dic[tmp] == 1:
    dic[tmp] = 0
  else:
    dic[tmp] = 1
print(sum(dic.values()))

Submission status: Accepted

Solution code:
N = int(input())
D = {}
for _ in range(N):
    A = int(input())
    if A not in D: D[A]=0
    D[A]+=1
print(len([v for v in D.values() if v%2==1]))

Submission status: Accepted

Solution code:

if __name__ == '__main__':
    N=int(input())
    sheet=set()
    for i in range(N):
        temp=int(input())
        if temp in sheet:
            sheet.remove(temp)
        else:
            sheet.add(temp)
    print(len(sheet))