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:
from collections import Counter
n=int(input())
a=[input() for _ in range(n)]
cnt=Counter(a)
ans=0
for i in cnt.values():
  if i%2:
    ans+=1
print(ans)

Submission status: Accepted

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

count=collections.Counter(A)
ans=0
for i in count.values():
    if i%2:ans+=1
print(ans)

Submission status: Accepted

Solution code:
dic={}
for _ in range(int(input())):
	a=int(input())
	if a in dic:
		dic[a]=1-dic[a]
	else:
		dic[a]=1
print(sum(dic.values()))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
l=[int(input()) for i in range(n)]
from collections import Counter 
c=Counter(l)
s=0 
for i in c: 
    s+=(c[i]&1)
print(s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections
N = int(input())
x = [0] * N
for i in range(N):
  x[i] = int(input())
  
q = collections.Counter(x)
value = q.values()

count = 0
for i in value:
  if i % 2 == 1:
    count += 1

print(count)

Submission status: Accepted

Solution code:
N = int(input())

dict = {}
for _ in range(N):
    a = int(input())
    if a not in dict:
        dict[a] = 1
    elif dict[a] == 1:
        dict[a] = 0
    else:
        dict[a] = 1

print(sum(dict.values()))

Submission status: Accepted

Solution code:
import collections
N=int(input())
li=[]
for n in range(N):
    A=int(input())
    li.append(A)
li_count=collections.Counter(li)
ans=0
for k in li_count.keys():
    if li_count[k]%2!=0:
        ans+=1
print(ans)

Submission status: Accepted

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

import collections

c = collections.Counter(A)

res = 0

for item in c.most_common():
        if item[1]  % 2 != 0:
                res+=1

print(res)

Submission status: Accepted

Solution code:
import collections

def test():
    n = int(input())
    a = [int(input()) for i in range(n)]
    b = collections.Counter(a)
    ans = 0
    for i in b.values():
        if i % 2 != 0:
            ans += 1
    print(ans)


if __name__ == "__main__":
    test()

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())
a = []
count = 0

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

c = Counter(a)
for i in c:
    if c[i] % 2 == 1:
        count += 1

print(count)

Submission status: Accepted

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

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())
s=set()
for i in range(n):s^={input()}
print(len(s))

Submission status: Accepted

Solution code:
N = int(input())
L = set()
for i in range(N):
    L ^= {input()}
print(len(L))

Submission status: Accepted

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

for i in range(N):
    A ^= {int(input())}

print(len(A))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter

n = int(input())
a = Counter([int(input()) for _ in range(n)]).values()
res = len(list(filter(lambda x: x%2==1, a)))
print(res)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    A = [int(input()) for i in range(N)]
    from collections import Counter
    c = Counter(A)
    ans = 0
    for v in c.values():
        if v&1:
            ans += 1
    
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())

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

print(len(s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
dat = dict()

n = int(input())
import bisect
for i in range(n):
    x = int(input())
    if x in dat:
        del dat[x]
    else:
        dat[x] = 1

print(len(dat))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections

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

A_count = collections.Counter(A)

ans = 0
for value in list(A_count.values()):
    if value%2 == 1:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
ans = {}

for _ in range(n):
    a = int(input())
    if a in ans:
        del ans[a]
    else:
        ans[a] =1
        
print(len(ans))

Submission status: Accepted

Solution code:
def input():
    import sys
    return sys.stdin.readline().rstrip()


def main():
    import math
    import collections
    import itertools

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

    counter_a = collections.Counter(as_)
    ans = 0
    for key, count in counter_a.items():
        if count % 2 == 1:
            ans += 1
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())
A = []
cnt = 0
for i in range(N):
    a = str(input())
    A.append(a)
c = Counter(A)
set_A = list(set(A))
for i in set_A:
    if int(c[str(i)]) < 2:
        cnt += 1
    else:
        cnt += int(c[str(i)]) % 2
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC073 C - Write and Erase
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())

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

B = set()

for a in A:
    if a in B:
        B.remove(a)
    else:
        B.add(a)

print(len(B))

Submission status: Accepted

Solution code:
from collections import Counter

def main():
  n = int(input())
  ans = 0
  A = Counter((int(input()) for _ in range(n)))
  for i in A.values():
    if i%2 != 0:
      ans += 1
  print(ans)

if __name__=='__main__':
  main()

Submission status: Accepted

Solution code:
from collections import Counter

n = int(input())
ans = 0

A = Counter((int(input()) for _ in range(n)))

for j in A.values():
  if j%2 != 0:
    ans += 1
print(ans)

Submission status: Accepted

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

print(sum([value%2 for value in A.values()]))

Submission status: Accepted

Solution code:
# ABC073C - Write and Erase
from collections import Counter


def main():
    N, *A = map(int, open(0))
    cnt = Counter(A)
    ans = sum(i % 2 for i in cnt.values())
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# ABC073C - Write and Erase
def main():
    N, *A = map(int, open(0).read().split())
    store = set()
    for a in A:
        if a in store:
            store.remove(a)
        else:
            store.add(a)
    ans = len(store)
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#073C write and erase

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:
from collections import Counter

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

A = Counter(A)
count = 0

for a in A.values():
    count += a%2

print(count)

Submission status: Accepted

Solution code:
n = int(input())

result = set()

for _ in range(n):
  a = int(input())
  result.add(a) if a not in result else result.remove(a)
  
print(len(result))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

D = dict()
for i in range(N):
    if A[i] not in D:
        D[A[i]] = 1 
    else:
        D[A[i]] += 1

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

Submission status: Accepted

Solution code:
def slove():
    import sys
    import collections
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    a = collections.Counter([int(input().rstrip('\n')) for _ in range(n)])
    cnt = 0
    for k, v in a.items():
        if v % 2 != 0:
            cnt += 1
    print(cnt)


if __name__ == '__main__':
    slove()

Submission status: Accepted

Solution code:
import collections
N = int(input())
A = []
for i in range(N):
    A.append(int(input()))
cnt = dict(collections.Counter(A))
ans = 0
for key in cnt.keys():
    value = cnt[key]
    if value%2!=0:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
from collections import defaultdict
d = defaultdict(int)

N = int(input())

for i in range(N):
    tmp = input()
    d[tmp] += 1

counter = 0

for j,v in d.items():
    if v % 2 == 1:
        counter += 1

print(counter)

Submission status: Accepted

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

Submission status: Accepted

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

r=set()
for a in A:
    if a in r:
        r.remove(a)
    else:
        r.add(a)

print(len(r))

Submission status: Accepted

Solution code:
s = set()

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

print(len(s))

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:
import sys
input=sys.stdin.readline
n=int(input())
a=[int(input()) for _ in range(n)]
a.sort()
h=a[0]
ans=1
for i in a[1:]:
    if i!=h:
        ans+=1
        h=i
    else:
        ans-=1
        h=pow(10,10)    
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter

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

c = Counter(l)
cnt_odd = [k for k, v in c.items() if v % 2 != 0]
print(len(cnt_odd))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = set()
for i in range(int(input())):s ^= {input()}
print(len(s))

Submission status: Accepted

Solution code:
s=set()
for i in range(int(input())):s^={input()}
print(len(s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
li = dict()
for i in range(n):
    a = int(input())
    li.setdefault(a,0)
    if li[a] == 0:
        li[a] = 1
    else:
        li[a] = 0
ans = list(li.values())
print(ans.count(1))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict

N = int(input())
d = defaultdict(int)

for i in range(N):
    d[int(input())] += 1

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

print(ans)

Submission status: Accepted

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

for i in range(N):
    a_array.append(int(input()))

paper = set([])

for i in a_array:
    if i in paper:
        paper.remove(i)
    else:
        paper.add(i)

print(len(paper))

Submission status: Accepted

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

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-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 I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

# Summarize count of factor within list
def summarize_list(l):
  sl=sorted(l)

  a=sl[0]
  c=1
  res=[]

  for x in sl[1:]:
    if x==a:
      c+=1
    else:
      res.append([a,c])
      a=x
      c=1
  res.append([a,c])

  return res

def main():
  n=I()
  l=[I() for _ in range(n)]

  ans=0
  l=summarize_list(l)

  for x in l:
    if x[1]%2!=0:
      ans+=1
  return ans

# main()
print(main())

Submission status: Accepted

Solution code:
from collections import Counter

n=int(input())
a=[int(input()) for i in range(n)]
counter=Counter(a)
cnt=0
for i in counter.values():
    if i%2==1:
        cnt+=1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
n = int(input())
d = set()
b = map(int,sys.stdin)
for a in b:
    if a in d:
        d.remove(a)
    else:
        d.add(a)
print(len(d))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter

N, *A = map(int, open(0).read().split())
a = list(Counter(A).values())
a = [i for i in a if i % 2 == 1]

print(len(a))

Submission status: Accepted

Solution code:
import collections

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

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

Submission status: Accepted

Solution code:
from collections import Counter

N = int(input())
A = [int(input()) for i in range(N)]
a = list(Counter(A).values())
a = [i for i in a if i % 2 == 1]

print(len(a))

Submission status: Accepted

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

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

print(len(A))

Submission status: Accepted

Solution code:
N=int(input())
A=[int(input()) for i in range(N)]
B=set(A)
C=len(B)
for i in A:
  if i not in B:
    B.add(i)
  else:
    B.remove(i)
print(C-len(B))

Submission status: Accepted

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

counter = Counter(ali)
count = 0
for k, v in counter.items():
    if v % 2 == 1:
        count += 1
print(count)

Submission status: Accepted

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

c = collections.Counter(A)
ans = 0
for t in c.values():
    if t%2 == 1: ans += 1
    
print(ans)

Submission status: Accepted

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


mydict = dict()
cnt = 0

for i in range(N):
    if not (A[i] in mydict):
        mydict[A[i]] = i
        
counter = [0] * N
for a in A:
    counter[mydict[a]] += 1
    
ans = 0
for c in counter:
    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)]

cnt = Counter(A)
ans = 0
for num, val in cnt.items():
    if val % 2 != 0:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
a={}
for _ in range(n):
    num=int(input())
    if num not in a:
        a[num]=1
    else:
        a[num]+=1
all_count=0
for _, count in a.items():
    if count%2==1:
        all_count+=1
print(all_count)

Submission status: Accepted

Solution code:
from collections import defaultdict

n = int(input())
a = defaultdict(int)
for _ in range(n):
    a[int(input())] += 1
print(len([1 for v in a.values() if v % 2]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter

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

c = Counter(As)
c = sorted(c.items(), key=lambda x:x[0])
A_unique, A_counts = zip(*c)

ans = 0
for a in A_counts:
    if a%2!=0:
        ans += 1
print(ans)

Submission status: Accepted

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

print(len([1 for n in d.values() if n % 2 == 1]))

Submission status: Accepted

Solution code:
from collections import Counter as co
n=int(input())
l=[int(input()) for _ in range(n)]
print(len([1 for (a,d) in co(l).items() if d%2]))

Submission status: Accepted

Solution code:
from collections import defaultdict


def resolve():
    n = int(input())
    a = list(int(input()) for _ in range(n))
    d = defaultdict(int)
    for ai in a:
        d[ai] += 1
    ans = 0
    for v in d.values():
        ans += v % 2
    print(ans)


if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

a = sorted(a)
d = {}
for i in a:
  if i not in d.keys():
    d[i] = 1
  else:
    d[i] += 1

print(len([i for i in d.values() if i % 2 == 1]))

Submission status: Accepted

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

print(len(s))

Submission status: Accepted

Solution code:
import collections

n = int(input())
counter = collections.Counter()
for _ in range(n):
    counter[int(input())] += 1
res = 0
for k, v in counter.items():
    if v % 2 == 1:
        res += 1
print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
from fractions import gcd
# import queue
from collections import Counter
# from itertools import accumulate
# from functools import reduce

def lcm(a, b):
    return a * b // gcd(a, b)

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

big_prime = 1000000007

"""
# 標準入力取得
## 文字列
 = sys.stdin.readline().rstrip()
 = list(sys.stdin.readline().rstrip())

## 数値
 = int(sys.stdin.readline())
 = map(int, sys.stdin.readline().split())
 = list(map(int, sys.stdin.readline().split()))
 = [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""


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

L = [int(sys.stdin.readline()) for _ in range(N)]

Lc = Counter(L)

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections
import sys

input = sys.stdin.readline


class AtCoder:
    def main(self):
        N = int(input())
        A = [int(input()) for _ in range(N)]

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


# Run main
if __name__ == '__main__':
    AtCoder().main()

Submission status: Accepted

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

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

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

if n % 2:
  ans += 1

print(ans)

Submission status: Accepted

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

# input
N = int(input())
A = list()
for _ in range(N):
    A.append(int(input()))

# solve
ans = set()
for i in range(N):
    if A[i] in ans:
        ans.remove(A[i])
    else:
        ans.add(A[i])

# output
print(len(ans))

Submission status: Accepted

Solution code:
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
    read_all = [tuple(map(int, input().split())) for _ in range(N)]
    return map(list,zip(*read_all))

#################

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

d = defaultdict(int)
for i in range(N):
    if d[A[i]]==0:
        d[A[i]] = 1
    else:
        d[A[i]] = 0

ans = 0
for k in d.keys():
    if d[k] != 0:
        ans += 1
        
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
A = [int(input()) for _ in range(N)]
num_set = set()
for a in A:
    if a not in num_set:
        num_set.add(a)
    else:
        num_set.remove(a)
print(len(num_set))

Submission status: Accepted

Solution code:
N = int(input())
A = []
from collections import defaultdict
D = defaultdict(int)
for i in range(N):
    a = int(input())
    A.append(a)
    D[a] += 1

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

Submission status: Accepted

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

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

paper = set()

for num in a:
    if num in paper:
        paper.discard(num)
    else:
        paper.add(num)

ans = len(paper)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
in_=int(input())
size=10001
l=[[] for i in range(size)]
for i in range(in_):
  num=int(input())
  r=num%size
  if num in l[r]:
    l[r].remove(num)
  else:
    l[r].append(num)
sum=0
for li in l:
  sum=sum+len(li)
print(sum)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import collections

input = sys.stdin.readline

N = int(input())

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

l = collections.Counter(L)

cnt = 0

for i in l.keys():
    if l[i]%2!=0:cnt += +1
print(cnt)

Submission status: Accepted

Solution code:
import sys
n,*A = map(int,sys.stdin)
B = set()
for a in A:
    B ^= {a}
print(len(B))

Submission status: Accepted

Solution code:
import sys
n,*A = map(int,sys.stdin)
B = set()
for a in A:
    if a in B:
        B.remove(a)
    else:
        B.add(a)
print(len(B))

Submission status: Accepted

Solution code:
import sys
n,*A = sys.stdin
B = set()
for a in A:
    if int(a) in B:
        B.remove(int(a))
    else:
        B.add(int(a))
print(len(B))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
n = int(input())
A = set()
for _ in range(n):
    a = int(input())
    if a in A:
        A.remove(a)
    else:
        A.add(a)
print(len(A))

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
n = int(input())
A = set()
for _ in range(n):
    a = input().rstrip()
    if a in A:
        A.remove(a)
    else:
        A.add(a)
print(len(A))

Submission status: Accepted

Solution code:
N,*A=open(0);s=set()
for a in A:s^={int(a)}
print(len(s))

Submission status: Accepted

Solution code:
import collections as c
N = int(input())
num = c.Counter([int(input()) for _ in range(N)])

a = list(num.values())

ans = 0

for s in a:
	if s%2 == 1:
		ans += 1

print(ans)

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    N = int(input())
    #A = []
    d = {}
    for i in range(N):
        Ai = int(input())
        if Ai in d.keys():
            d[Ai] = not d[Ai]
        else:
            d[Ai] = True
    
    ans = 0
    for item in d.items():
        if item[1]:
            ans += 1
    
    print(ans)

Submission status: Accepted

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


def solve(N: int, A: "List[int]"):
    from collections import Counter
    c = Counter(A)
    ans = 0
    for v in c.values():
        if(v%2):
            ans += 1

    print(ans)
    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
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]"
    solve(N, A)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections
from sys import stdin
N = int(stdin.readline().rstrip())
data = []
for _ in range(N):
    data.append(int(input()))
c = collections.Counter(data)
ans = 0
for i in list(c.values()):
    if i % 2 != 0:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
d = {}
for _ in range(N):
  t = int(input())
  if t in d:
    d[t] += 1
  else:
    d[t] = 1
print(sum(i % 2 for i in d.values()))

Submission status: Accepted

Solution code:

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
##############################

N = int(input())
s = {}
for i in range(N):
    a = int(input())
    if s.get(a, False):
        s.pop(a)
    else:
        s[a] = True

print(len(s))

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input().strip())
ans = 0
c = Counter([int(input().strip()) for _ in range(N)])
for k,v in c.items():
  if v%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)]
ca = Counter(a)
ans = 0
for i in ca.values():
  if i % 2 != 0:
    ans += 1
print(ans)

Submission status: Accepted

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

def main():
    N = int(input())

    a = sorted([int(input()) for i in range(N)]) + [int(1e10)]

    ans = 0
    pre = a[0]
    count = 1
    for i in range(1, N+1):
        if pre != a[i] and count&1:
            ans += 1
            count = 0
        count += 1
        pre = a[i]
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

def main():
    N = int(input())

    dic = {}
    for i in range(N):
        a = int(input())
        if a in dic:
            dic[a] += 1
        else:
            dic[a] = 1
    
    ans = 0
    for num, count in dic.items():
        if count&1:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

    nums = []

    for i in a:
        if len(nums) > 0:
            if i <= nums[-1]:
                ind = bisect.bisect_left(nums, i)
                if nums[ind] == i:
                    nums.pop(ind)
                else:
                    nums.insert(ind, i)
            else:
                nums.append(i)
        else:
            nums.append(i)
    
    print(len(nums))


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

    nums = []

    for i in a:
        if len(nums) > 0:
            if i <= nums[-1]:
                ind = bisect.bisect_left(nums, i)
                if nums[ind] == i:
                    nums.pop(ind)
                else:
                    bisect.insort(nums, i)
            else:
                nums.append(i)
        else:
            nums.append(i)
    
    print(len(nums))


if __name__ == "__main__":
    main()