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 defaultdict

N = int(input())

d = defaultdict(int)
for i in range(N):
    a = int(input())
    if d[a]:
        d.pop(a)
    else:
        d[a] = 1

print(len(d.keys()))

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
from collections import Counter
n=int(input())
a=[int(input()) for i in range(n)]

count = Counter(a)
ans=0
for i in count.values():
    ans+=i%2
print(ans)

Submission status: Accepted

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

count = Counter(a)
ans=0
for i in count.values():
    ans+=i%2
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
from collections import Counter as c
n=int(input())
a=[0]*n
for i in range(n):
  a[i]=int(input())
d=c(a)
l=list(d.keys())
x=0
for i in l:
  if d[i]%2==1:
    x+=1
print(x)

Submission status: Accepted

Solution code:
n=int(input())
a=[input() for _ in range(n)]
l={}
for i in a:
    if i in l:
        del l[i]
    else:
        l[i]=0
print(len(l))

Submission status: Accepted

Solution code:
N = int(input())
d = {}
for _ in range(N):
    A = int(input())
    if A in d:
        d[A] = not d[A]
    else:
        d[A] = True

print(sum(d.values()))

Submission status: Accepted

Solution code:
n = int(input())
a = [int(input()) for _ in range(n)]
b = {}
for i in a:
    if i in b:
        del b[i]
    else: b[i] = 0
print(len(b))

Submission status: Accepted

Solution code:
N = int(input())
A = []
for _ in range(N):
    A.append(int(input()))
A.sort()
ans = 0
idx = 0
while idx < N:
    sub = 0
    while idx + sub < N and A[idx] == A[idx + sub]:
        sub = sub + 1
    if sub % 2 == 1:
        ans = ans + 1
    idx = idx + sub
print(ans)

Submission status: Accepted

Solution code:
import sys
import copy
import  math
import bisect
from collections import *
from operator import itemgetter
"""
from fractions import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)
"""
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

n = ni()
li = [ni() for _ in range(n)]
c = Counter(li)
ans = 0
for k, v in c.items():
    if v % 2 == 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict
import sys,heapq,bisect,math,itertools,string,queue,datetime
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
 
ans = 0
n = inp()
a = [inp() for _ in range(n)]
d = defaultdict(int)
 
for key in a:
    d[key] += 1
for i in d:
    if d[i] % 2:
        ans += 1 
print(ans)

Submission status: Accepted

Solution code:
import collections as co
N = int(input())
A = [int(input()) for i in range(N)]
c = co.Counter(A)
count = 0
for a,b in c.most_common():
    if b%2==1:
        count += 1
print(count)

Submission status: Accepted

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

D = {}

for i in range(n):
    try:
        D[A[i]] += 1
    except:
        D[A[i]] = 1

ans = 0
for i in D.values():
    ans += i % 2
print(ans)

Submission status: Accepted

Solution code:
import itertools
l = sorted([int(input()) for _ in range(int(input()))])
print(sum(1 for key,value in itertools.groupby(l) if len(list(value))%2))

Submission status: Accepted

Solution code:
import itertools
n = int(input())
l = sorted([int(input()) for _ in range(n)])
l = [1 for key,value in itertools.groupby(l) if len(list(value))%2]
print(len(l))

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict
import sys,heapq,bisect,math,itertools,string,queue,datetime
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

ans = 0
n = inp()
a = [inp() for _ in range(n)]
d = defaultdict(int)

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

Submission status: Accepted

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

for i in range(N):
    a = int(input())
    if a in A.keys():
        A[a] += 1
    else:
        A[a] = 1

ans = 0

for i in A.keys():
    if A[i] % 2 == 1:
        ans += 1

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
l = sorted([input() for _ in range(n)])
x = l[0]
count = 0
score = 0
for s in l[1:]:
    if x==s:
        count+=1
    else:
        score+=count%2==0
        count=0
    x = s
score+=count%2==0
print(score)

Submission status: Accepted

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

l = []
for i in list(count):
  if count[i] % 2 != 0:
    l.append(count[i])

print(len(l))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

import sys
import math
import bisect
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
a = [I() for _ in range(n)]
b = list(Counter(a).items())
ans = 0
for i,j in b:
    if j % 2:
        ans += 1
print(ans)

Submission status: Accepted

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

result = {}
for a_i in a:
    if not a_i in result or 0 == result[a_i]:
        result[a_i] = 1
    else:
        result[a_i] = 0
print(list(result.values()).count(1))

Submission status: Accepted

Solution code:
N,*A=list(map(int,open(0).read().split()))

import collections
c = collections.Counter(A)
cnt=0
for _, x in c.most_common():
  if x % 2 != 0:
    cnt+=1
print(cnt)

Submission status: Accepted

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

for i in range(n):
    a = int(input())
    if a not in array:
        array[a] = 1
    elif array[a] == 1:
        array[a] -= 1
    else:
        array[a] += 1

print(sum(array.values()))

Submission status: Accepted

Solution code:
from collections import defaultdict


def main():
    n = int(input())
    d = defaultdict(int)
    for i in range(n):
        d[int(input())] += 1

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections

n=int(input())
a=[int(input()) for i in range(n)]
count=0
a = collections.Counter(a)
a=a.most_common()
a=list(a)

for i in range(len(a)):
    if a[i][1]%2==1:
        count+=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc073/tasks/abc073_c
# C - Write and Erase
import collections

n = int(input().split()[0])
a_list = []

for _ in range(n):
    a_list.append(int(input().split()[0]))

counter = collections.Counter(a_list)
no_list = [k for k, c in counter.items() if c % 2 == 1]
ans = len(no_list)
print(ans)

Submission status: Accepted

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

def main():
    n=int(input())
    a=[0 for _ in range(n)]
    for i in range(n):
        a[i]=int(input())
    check={}
    for i in a:
        if not (i in check):
            check[i]=1
        elif(check[i]==1):
            check[i]=0
        elif(check[i]==0):
            check[i]=1
    ans=0
    for i in check:
        if(check[i]==1):
            ans+=1
 
    print(ans)
    
    
main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
M = {}
for i in range(N):
  A = int(input())
  if not(A in M):
    M[A] = 0
  M[A] += 1
r = 0
for A in M.keys():
  if M[A]%2 == 1:
    r += 1
print(r)

Submission status: Accepted

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

a.sort()

ans = 0
tmp = 1

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

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

print(ans)

Submission status: Accepted

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

a.sort()

ans = 0
tmp = 1

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections

n = int(input())
a = [int(input()) for _ in range(n)]
b = collections.Counter(a)

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict

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

mem = defaultdict(int)
for i in range(N) :
    mem[A[i]] += 1
    
ret = 0
for v in mem.values() :
    if v % 2 == 1 :
        ret += 1
print(ret)

Submission status: Accepted

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

    d = dict()
    for a in A:
        d[a] = d.get(a, 0) + 1
    count = 0
    for a in d:
        if d[a] % 2 == 1:
            count += 1
    return count


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

Submission status: Accepted

Solution code:
nums = int(input())
ary = list(range(nums))

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

ary.sort()
a = {}
result = 0

for i in ary :
    if i in a:
        a[i] = a[i]+1
    else:
        a[i] = 1

for i in a.keys():
    if a[i] % 2 == 1:
        result += 1

print (result)

Submission status: Accepted

Solution code:
nums = int(input())
ary = list(range(nums))
check_number = [0 for i in range(nums+2)]
for i in range(nums):
    ary[i] = int(input())

ary.sort()
check = 0
count = 0
result = 0
x = 0
for i in ary :
    if check == i:
        check_number[x] += 1
    else:
        check = i
        x += 1
        check_number[x] = 1

for i in check_number:
    if i % 2 == 1:
        result += 1
print (result)

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 = [int(input()) for i in range(n)]
a.sort()
result = 0
count = 1
for i in range(n-1):
    if a[i] == a[i+1]:
        count += 1
    else:
        if count % 2 == 1:
            result += 1
        count = 1
if count % 2 == 1:
    result += 1
print(result)

Submission status: Accepted

Solution code:
n=int(input())
As=[int(input()) for _ in range(n)]
As.sort()
As_uniq=list(set(As))

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

Submission status: Accepted

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

A.sort()
a=0
count=0
total=0
for i in A:
    if i==a:
        count+=1
    else:
        if count%2==1:
            total+=1
        a=i
        count=1
if count%2==1:
    total+=1
print(total)

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())
As = Counter([int(input()) for i in range(N)])
ans=0
for x,y in As.items():
    if y%2!=0:
        ans+=1
print(ans)

Submission status: Accepted

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

from collections import Counter

def main(N,A):
    elements = sorted(set(A))
    A = Counter(A)
    count = 0
    for i in elements:
        if(A[i]%2==1):
            count += 1
    print(count)
    
if __name__ == '__main__':
    N = int(input())
    A = []
    for i in range(N):
        A.append(int(input()))
    main(N,A)

Submission status: Accepted

Solution code:
import sys
from collections import Counter


def main():
    count_by_kw = Counter()
    n = int(input())
    for _ in range(n):
        count_by_kw[int(sys.stdin.readline())] += 1

    ans = 0
    for key, value in count_by_kw.items():
        if value % 2 == 1:
            ans += 1
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N=int(input())
A=[int(input()) for _ in range(N)]
d={}
for a in A:d[a]=0
for a in A:d[a]+=1
cnt=0
for i in d:
    if d[i]%2:cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
from collections import Counter
N = int(input())
c = Counter([int(input()) for s in range(N)])
ans = [v % 2 for v in c.values()].count(1)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter

nums = int(input())
counter = Counter(int(input()) for _ in range(nums))

res = 0
for p in counter.most_common():
  res += (1 if p[1] % 2 == 1 else 0)
print(res)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

    print(len(B))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7

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

s = set()
for a in A:
    if a in s:
        s.remove(a)
    else:
        s.add(a)
print(len(s))

Submission status: Accepted

Solution code:
n = int(input())

d = {}

for i in range(n):
  a = int(input())
  if a in d and d[a] == 1:
    d[a] = 0
  else:
    d[a] = 1

ans = 0
for v in d.values():
  ans += v
  
print(ans)

Submission status: Accepted

Solution code:
from collections import defaultdict



cnt = defaultdict(int)


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




print(sum([i%2 for i in cnt.values()]))

Submission status: Accepted

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

Submission status: Accepted

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

#print(A)

check = [0]
for i in range(1, N):
    if A[i] != A[i-1]:
        check.append(i)
check.append(N)

l = []
for i in range(1, len(check)):
    tmp = check[i] - check[i-1]
    l.append(tmp)

#print(l)

ans = 0
for i in range(len(l)):
    if l[i] % 2 == 1:
        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.discard(a)
    else:
        d.add(a)

print(len(d))

Submission status: Accepted

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

for i in range(N):
    p.append(input())

p.sort()
c = 1
ans = 0
for i in range(1, len(p)):
    if p[i] == p[i - 1]:
        c += 1
    else:
        if c % 2 == 1:
            ans += 1
        c = 1
if c % 2 == 1:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
li = [int(input()) for _ in range(n)]
li.sort()
tmp = 0
new_li = []
for l in li:
    if l != tmp:
        tmp = l
        new_li.append(1)
    elif l == tmp:
        new_li[-1] += 1
count = 0
for n in new_li:
    if n%2 != 0:
        count += 1
print(count)

Submission status: Accepted

Solution code:
N = int(input())
d = dict()

for i in range(N):
    a = str(input())
    if a in d:
        d[a] += 1
    else:
        d[a] = 1

ans = 0
for v in d.values():
    if (v & 1) == 1:
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections
N = int(input())
num = []
for _ in range(N):
	num.append(input())
count_dict = collections.Counter(num)
d =[]
for k,v in count_dict.items():
  d.append([k,v])

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

print(ans)

Submission status: Accepted

Solution code:
from collections import Counter

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

Submission status: Accepted

Solution code:
from collections import Counter

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

Submission status: Accepted

Solution code:
from collections import defaultdict

N = int(input())

numList = defaultdict(int)

for _ in range(N):
    num = int(input())

    if numList[num] == 0:
        numList[num] = 1
    else:
        numList[num] = 0

ans = sum([c for _, c in numList.items()])
print(ans)

Submission status: Accepted

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

for _ in range(n):
    key = input()
    if key in dic:
        del dic[key]
    else:
        dic[key] = 1

print(len(dic.keys()))

Submission status: Accepted

Solution code:
from collections import*
_,*l=map(int,open(0).read().split())
c=Counter(l)
a=0
for i in c.values():a+=i%2
print(a)

Submission status: Accepted

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

d = {}
for i in range(n):
    if a[i] in d:
        d[a[i]] += 1
    else:
        d[a[i]] = 1
count = 0
for i in d.keys():
    if d[i]%2 ==1:
        count +=1
print(count)

Submission status: Accepted

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

print(len(list(filter(lambda x: x % 2 != 0, A.values()))))

Submission status: Accepted

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

counter = Counter()
for _ in range(N):
    counter[input()] += 1
ans = 0
for v in counter.values():
    ans += v % 2
print(ans)

Submission status: Accepted

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

N = int(input())
 
a = {}
for i in range(N):
    x = input()
    if x in a:
        del a[x]
    else:
        a[x] = 0
print(len(a))

Submission status: Accepted

Solution code:
N = int(input())

a = {}
for i in range(N):
    x = input()
    if x in a:
        del a[x]
    else:
        a[x] = 0
print(len(a))

Submission status: Accepted

Solution code:
n = int(input())
a = []
for i in range(n):
  a.append(int(input()))
a.sort()
ans = 0
for i in range(n):
  try:
    if a[i-1] != a[i]:
      ans += cnt
      cnt = 1
    else:
      cnt = 1 - cnt
  except:
    #i==0
    cnt = 1
  #print(a[i],cnt,ans)
ans += cnt
print(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:
import collections

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

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

Submission status: Accepted

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

Submission status: Accepted

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

count = 0
dic = {}

for i in a:
    if i in dic:
        dic[i] += 1
    else:
        dic[i] = 1

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

print(count)

Submission status: Accepted

Solution code:
from collections import Counter

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

ans = 0
cnt = Counter(lst)

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys, math, fractions, itertools, collections


def solve(N: int, A: "List[int]"):
    c = collections.Counter(A)
    d = list(c.values())
    print(len([dd for dd in d if dd % 2 == 1]))
    return


# Generated by 1.1.4 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:
# -*- coding: utf-8 -*-
import sys
input = sys.stdin.readline
a = int(input())
c = [int(input()) for i in range(a)]

from collections import defaultdict
d = defaultdict(int)
for i in c:
    d[i] += 1
cnt = 0
for v in d.values():
    cnt +=  v%2
print(cnt)

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:
def main():
    N = int(input())
    A = [0]*N
    for i in range(N):
        A[i] = int(input())

    d = {}
    for a in A:
        d[a] = d.get(a, 0)+1

    print(sum(v % 2 for k, v in d.items()))
main()

Submission status: Accepted

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

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

print(len(se))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
from bisect import bisect_left
INF = float("inf")


def solve(N: int, A: "List[int]"):
    X = []
    for a in A:
        i = bisect_left(X, a)
        if i < len(X) and X[i] == a:
            X.pop(i)
        else:
            X.insert(i, a)
    print(len(X))

    return


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

Submission status: Accepted

Solution code:
N = int(input())

count = {}
ans = 0

for i in range(N):
    a = int(input())
    v = count.get(a,0)
    v = v+1
    if(v%2 == 0):
        ans = ans - 1
    else:
        ans = ans + 1
    count[a] = v

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import math

# NO, PAY-PAY
#import numpy as np
#import statistics
#from statistics import mean, median,variance,stdev

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
 
def main():
    N = inputInt()
    ans = {}
    for _ in range(N):
        tmp = inputInt()
        if tmp in ans:
            ans[tmp] += 1
        else:
            ans[tmp] = 1
        
    o = 0
    for v in ans.values():
        if v % 2 == 1:
            o += 1
    print(o)
        
            	
if __name__ == "__main__":
	main()

Submission status: Accepted

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

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

print(len(a))

Submission status: Accepted

Solution code:
N = int(input())
dict = {}
for _ in range(N):
  num = int(input())
  if num in dict:
    dict[num] += 1
  else:
    dict[num] = 1
    ans = 0
for key, value in dict.items():
  if value%2 == 1:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
import sys
import collections

n = int(sys.stdin.readline())
a_list = [int(x) for x in sys.stdin.readlines()]
a_list_counter = collections.Counter(a_list)
count = 0
for i in a_list_counter:
    if a_list_counter[i] % 2 != 0:
        count += 1
    else:
        continue
print(count)

Submission status: Accepted

Solution code:
n=int(input())
a=[int(input()) for _ in [0]*n]
s=set()
for x in a:s^={x}
print(len(s))

Submission status: Accepted

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

    paper = set()

    for i in range(N):
        A = int(input())
        if A in paper:
            paper.discard(A)
        else:
            paper.add(A)
    
    print(len(paper))

main()

Submission status: Accepted

Solution code:
# -*- coding: UTF-8 -*-
# ABC073_C

N = int(input())
ans = set()

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

Submission status: Accepted

Solution code:
import collections

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

cnt = 0
for key, value in A.items():
    if value % 2 == 0:
        pass
    else:
        cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
set_a = set()
for i in range(n):
    a = int(input())
    if a not in set_a:
        set_a |= {a,}
    else:
        set_a -= {a,}
print(len(set_a))

Submission status: Accepted

Solution code:
import collections 

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

B = collections.Counter(A)

ans = 0
for k, v in B.items():
    ans += v%2

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
A = []
for i in range(N):
    A.append(int(input()))
    
A.sort()
count = 1
EraseFlag = True
for i in range(1,N):
    if A[i] == A[i-1]:
        if EraseFlag:
            count -=1
            EraseFlag = False
            continue
        else:
            count+=1
            EraseFlag = True
            continue
    else:
        count+=1
        EraseFlag = True
        
print(count)

Submission status: Accepted

Solution code:
a = {}
b = int(input())
for i in range(b):
    c = int(input())
    if c not in a:
        a[c] = True
    else:
        a[c] = not a[c]
d = 0
for v in a.values():
    if v:
        d += 1
print(d)

Submission status: Accepted

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