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

import collections
c = collections.Counter(An)
print(len([i[0] for i in c.items() if i[1]%2 != 0]))

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict

def main():
    input = sys.stdin.readline
    N = int(input())
    d = defaultdict(lambda: 0)
    for _ in range(N):
        a = int(input())
        d[a] += 1

    ans = 0
    for key in d:
        if d[key] % 2 == 1:
            ans += 1

    return ans


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

Submission status: Accepted

Solution code:
n = int(input())
s = [int(input()) for _ in range(n)]
s = sorted(s)
i = s[0]
cnt = 1
num = 0
for j in s[1:]:
    if i == j:
        cnt += 1
    else:
        if cnt % 2 != 0:
            num += 1
        cnt = 1
    i = j
if cnt % 2 != 0:
    num += 1
print(num)

Submission status: Accepted

Solution code:
N=int(input())
from collections import defaultdict
d=defaultdict(int)
for i in range(N):
    d[int(input())]+=1
cnt=0
for a in d.keys():
    if d[a]%2==1:
        cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
a = sorted([int(input()) for _ in range(n)])
tmp = a[0]
cnt = [0]*n
ptr = 0
for i in range(n) :
  if(a[i-1] != a[i]) :
    ptr += 1
  cnt[ptr] += 1
print(sum([cnt[i]%2 for i in range(len(cnt))]))

Submission status: Accepted

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

lis.sort()

count=0
while len(lis)>1:
    if lis[0]==lis[1]:
        del lis[:2]
    else:
        del lis[0]
        count+=1
print(count+len(lis))

Submission status: Accepted

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

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

#print(dict)
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter
from sys import stdin

lines = stdin.readlines

N, *A = map(int, lines())
An = Counter(A)


def main():
    print(sum([1 for v in An.values() if v % 2]))
    return


main()

Submission status: Accepted

Solution code:
from collections import Counter
from sys import stdin

lines = stdin.readlines
N, *A = [int(line) for line in lines()]

An = Counter(A)


def main():
    print(sum([1 for k, v in An.items() if v % 2]))
    return


main()

Submission status: Accepted

Solution code:
from collections import Counter

n=int(input())

mylist=[input() for aa in range(n)]
#print(aa)

data=Counter(mylist)
val=list(data.values())
val=[1 for aa in val if aa%2==1]
print(sum(val))

Submission status: Accepted

Solution code:
import collections
N=int(input())
history=[]
for i in range(N):
  history.append(int(input()))
history=sorted(history)
nums=list(collections.Counter(history).values())
print(sum([n%2 for n in nums]))

Submission status: Accepted

Solution code:
N=int(input())
history=[]
for i in range(N):
  history.append(int(input()))
history=sorted(history)
nums=[]
for i in range(N):
  if i==0:
    nums.append(1)
  else:
    if history[i]==history[i-1]:
      nums[-1]+=1
    else:
      nums.append(1)
print(sum([n%2 for n in nums]))

Submission status: Accepted

Solution code:
from collections import Counter
n=int(input())
a=[]
for i in range(n):
    a.append(int(input()))
index,cnt=zip(*Counter(a).most_common())
ans=0
for i in range(len(index)):
    if cnt[i]%2==1:
        ans+=1
print(ans)
#print(index,cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def write_and_erase(N: int, A: list)->int:
    d = {}
    for a in A:
        d.setdefault(a, 0)
        d[a] = (d[a] + 1) % 2

    return sum(v for v in d.values())


if __name__ == "__main__":
    N = int(input())
    A = [int(input()) for _ in range(N)]
    ans = write_and_erase(N, A)
    print(ans)

Submission status: Accepted

Solution code:
n = int(input())
count = dict()
for i in range(n):
    a = int(input())
    if a not in count:
        count[a] = 1
    elif count[a]==0:
        count[a] = 1
    else:
        count[a] = 0
print(sum(count.values()))

Submission status: Accepted

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

for i in range(N):
    if i == 0:
        tmpnum = S[i]
        tmpcnt = 1
    else:
        if S[i] == tmpnum:
            tmpcnt += 1
        else:
            if tmpcnt % 2 != 0:
                cnt += 1
            tmpnum = S[i]
            tmpcnt = 1

if tmpcnt % 2 != 0:
    cnt += 1
            
print(cnt)

Submission status: Accepted

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

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

print(cnt)

Submission status: Accepted

Solution code:
import collections
N = int(input())
a = [int(input()) for i in range(N)]
c = collections.Counter(a)
tmp = list(c.values())
count=0
for i in range(len(tmp)):
  if tmp[i]%2!=0:
    count+=1
print(count)

Submission status: Accepted

Solution code:
# mapして偶数なら0奇数なら1
n = int(input())
dic = {}
for _ in range(n):
    x = int(input())
    if x in dic:
        del dic[x]
    else:
        dic[x] = 1

print(len(dic))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
d = {}
for _ in range(N):
    key = int(input())
    if key in d:
        d[key] += 1
    else:
        d[key] = 1
count = 0
for key in d:
    count += d[key] % 2
print(count)

Submission status: Accepted

Solution code:
n = int(input())
a = sorted([int(input()) for _ in range(n)])
ans = 0
count = 0
pre = a[0]

for i in range(n):
    if a[i] == pre:
        count+=1
    else:
        pre = a[i]
        if count%2 == 1:
            ans += 1
        count = 1
if count%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=sorted(a)
ans=0
count=0
memo=a[0]
for i in range(n):
    x=a[i]
    if x==memo:
        count+=1
    else:
        memo=a[i]
        if count%2==1:
            ans+=1
        count=1
if count%2==1:
    ans+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007

#A
def A():
    return

#B
def B():
    return

#C
def C():
    n = II()
    A = {}
    for i in range(n):
        k = II()
        if not k in A:
            A[k] = 1
        else:
            A[k] += 1
    ans = 0
    #print(A)
    for item in A.values():
        ans += item % 2
    print(ans)
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    C()

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007

#A
def A():
    n = I()
    print(n*800-200*(n//15))

#B
def B():
    k = I()
    ans = 0
    for i in range(1,k):
        for j in range(i+1,k+1):
            if (i%2)^(j%2):
                ans += 1
    print(ans)

#C
def C():
    x,t = LI()
    print(max(0,x-t))

#D
def D():
    n = I()
    ans = 1
    for i in range(1,n+1):
        ans *= i
        ans %= mod
    print(ans)

#E
def E():
    x,y,s,t = LI()
    return

#F
def F():
    n = I()
    x = LI()
    a = sorted(x)
    for i in range(n):
        j = bisect.bisect_left(a,x[i])
        if j >= n//2:
            print(a[n//2-1])
        else:
            print(a[n//2])

#G
def G():
    n,m = LI()
    if m <= 2*n:print(m//2)
    else:
        ans = n
        m -= 2*n
        ans += m//4
        print(ans)

#H
def H():
    n,k = LI()
    ans = 0
    fact
    for i in range(1,3*n+1):
        if i%k == 0:
            return

def J():
    n = I()
    d = defaultdict(int)
    for i in range(n):
        a = I()
        if d[a]:
            d[a] -= 1
        else:
            d[a] += 1
    print(sum(d.values()))
def K():
    return

#Solve
if __name__ == "__main__":
    J()

Submission status: Accepted

Solution code:
N = eval(input())
num = []
flag = {}
for i in range(N):
    num.append(eval(input()))
for i in num:
    if i not in flag.keys():
        flag[i] = False
    else:
        flag[i] = not flag[i]
sum = 0
for i in flag.keys():
    if not flag[i]:
        sum = sum + 1
print(sum)

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:
import collections
n = int(input())
a = [int(input()) for i in range(n)]

c = collections.Counter(a)
c_odd = list(filter(lambda x:x%2==1,c.values()))

print(len(c_odd))

Submission status: Accepted

Solution code:
from collections import Counter

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

D = Counter(A)
res = 0
for v in D.values():
    if v%2 != 0:
        res += 1

print(res)

Submission status: Accepted

Solution code:
from collections import Counter

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

A = Counter(A)
num = []
for a in A.items():
    if a[1]%2 != 0:
        num.append(a[0])

print(len(set(num)))

Submission status: Accepted

Solution code:
import collections
import itertools
import numpy as np
import sys
MAX_INT = int(10e10)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
l = [I() for i in range(N)]
l.sort()


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

    print(ans)

Submission status: Accepted

Solution code:
from collections import Counter

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

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())
Alist = [int(input()) for i in range(N)]
Alist.sort()
Alist.append('END')
counter = 1
ans = 0

for i in range(1, len(Alist)):
    if Alist[i - 1] == Alist[i]:
        counter += 1
    else:
        if counter % 2 == 1:
            ans += 1
        counter = 1

print(ans)

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007

#A

#B

#C
n = I()
d = defaultdict(int)
for i in range(n):
    a = I()
    d[a] ^= 1
d = list(d.values())
print(sum(d))
#D

#E

#F

#G

#H

#I

#J

#K

#L

#M

#N

#O

#P

#Q

#R

#S

#T

Submission status: Accepted

Solution code:
import collections

n = int(input())

co = collections.Counter([int(input()) for i in range(n)])

c =0

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

Submission status: Accepted

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

d = {}
for i in a:
    if i not in d:
        d[i] = True
    else:
        if d[i] == True:
            d[i] = False
        else:
            d[i] = True
cnt = 0
for i in d:
    if d[i] == True:
        cnt += 1
print (cnt)

Submission status: Accepted

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

tmp = {a: 0 for a in set(A)}

for a in A:
    tmp[a] += 1
cnt = 0
for x in tmp.values():
    if x & 1 == 1:
        cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
import collections

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def solve(a):
    c = dict()
    for i in a:
        c[i] = c.get(i, 0) + 1
    
    return count(i for i in c.values() if i % 2 != 0)

def count(it):
    c = 0
    for _ in it:
        c += 1
    return c

main()

Submission status: Accepted

Solution code:
import collections

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

c = collections.Counter(A).most_common()

ans = 0
for i,j in c:
    if j % 2 != 0: ans += 1

print( ans )

Submission status: Accepted

Solution code:
N = int(input())
cnt = 0
A = {}
for i in range(N):
    a = int(input())
    if a not in A:
        A[a] = 1
        cnt = cnt +1
    else:
        A.pop(a)
        cnt = cnt-1
print(cnt)

Submission status: Accepted

Solution code:
from collections import Counter
N=int(input())
r=[]
while N>0:
    N-=1
    r.append(int(input()))
a=Counter(r)
count=0
for i in a:
    count+= a[i]%2
print(count)

Submission status: Accepted

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

a.sort()

res = 0
c = 1
for i in range(1,n):
    if a[i] == a[i-1]:
        c += 1
        continue
    res += c%2
    c = 1
res += c%2
print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections

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

Submission status: Accepted

Solution code:
from collections import Counter

n=int(input())
l=[int(input()) for i in range(n)]

c=Counter(l)
d=c.most_common()
x=len(d)
sum=0
for i in range(x):
    sum+=d[i][1]%2
print(sum)

Submission status: Accepted

Solution code:
N = int(input())
cnt = 0
A = {}
for i in range(N):
    a = int(input())
    if a not in A:
        A[a] = 1
        cnt += 1
    else:
        A.pop(a)
        cnt -= 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Tue Mar  5 22:41:58 2019

@author: yuta
"""
from collections import Counter
N = int(input())
A = [list(map(int,input().split())) for _ in range(N)]

def main(n,a):
    b = []
    for j in range(n):
        b.append(a[j][0])
        
    count = 0
    c = Counter(b)
    b_new = list(set(b))
    for i in range(len(c)):
        if c[b_new[i]] % 2 != 0:
            count += 1
    print(count)
main(N,A)

Submission status: Accepted

Solution code:
#ABC073C
N=int(input())
A=[]
for n in range(N):
	A.append(int(input()))
A.sort()
x=A[0]
i=1
ans=N
while i<N:
	if A[i]==x:
		ans-=2
		i+=1
		if i<N:
			x=A[i]
		i+=1
	else:
		x=A[i]
		i+=1
print(ans)

Submission status: Accepted

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

count = 0
for d in D.values():
    count += d%2

print(count)

Submission status: Accepted

Solution code:
N = int(input())
A = {}
for i in range(N):
    a = int(input())
    A.setdefault(a, 0)
    if a in A:
        A[a]+=1
count = 0
for v in A.values():
    if v%2!=0:
        count += 1
print(count)

Submission status: Accepted

Solution code:
from collections import Counter

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

res = 0

c = Counter(A)

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

print(res)

Submission status: Accepted

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

A.sort()
A.append(0)
Ans = []
keepcount = 0
count = 0
for i in A:
    if keepcount == 0:
        count = 1
        keepcount = i
    elif keepcount == i:
        count += 1
        keepcount = i
    else:
        keepcount = i
        Ans.append(count)
        count = 1


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

print(ans)

Submission status: Accepted

Solution code:
q=[]
n=int(input())
l=[]
for i in range(n):
  l.append(int(input()))
l.sort()
for a in l:
  if len(q)==0:
    q.append(a)
  else:
    b=q.pop()
    if a==b:
      pass
    else:
      q.append(b)
      q.append(a)
print(len(q))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
m={}
for _ in range(N):
    a=int(input())
    if a in m:
        if m[a] == 0:
            m[a] = 1
        else:
            m[a] = 0
    else:
        m[a]=1

ans=sum(m.values())

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
import collections as coll
L = [input() for _ in range(N)]
#print(list(coll.Counter(L).items()))
c = list(filter(lambda x:x[1]%2==1,(list(coll.Counter(L).items()))))
print(len(c))

Submission status: Accepted

Solution code:
import heapq
from collections import deque
from enum import Enum
import sys
import math
from _heapq import heappush, heappop

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001



N = int(input())
SET = set()

for _ in range(N):
    number = int(input())
    if number in SET:
        SET.discard(number)
    else:
        SET.add(number)

print(len(SET))

Submission status: Accepted

Solution code:
from collections import defaultdict


int_n = int(input())

counter = defaultdict(int)

for i in range(int_n):
    counter[int(input())] += 1

written = 0
for c in counter.values():
    if c % 2 == 1:
        written += 1


print(written)

Submission status: Accepted

Solution code:
def c_write_and_erase(N, A):
    from collections import Counter
    # 奇数回言われた数字だけが最後に残る
    return len([1 for v in Counter(A).values() if v % 2 == 1])

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
a = []
for i in range(n):
    a.append(int(input()))
    
check = {}
for i in set(a):
    check[i] = 0
for i in a:
    check[i] += 1
    
count = 0
for i in check.items():
    if i[1] % 2 != 0:
        count += 1
print(count)

Submission status: Accepted

Solution code:
# https://qiita.com/_-_-_-_-_/items/34f933adc7be875e61d0
# abcde	s=input()	s='abcde'
# abcde	s=list(input())	s=['a', 'b', 'c', 'd', 'e']
# 5(1つだけ)	a=int(input())	a=5
# 1 2	| x,y = map(int,input().split())   |	x=1,y=2
# 1 2 3 4 5 ... n 　	li = input().split()	li=['1','2','3',...,'n']
# 1 2 3 4 5 ... n 　	li = list(map(int,input().split()))	li=[1,2,3,4,5,...,n]
# FFFTFTTFF 　	li = input().split('T')	li=['FFF', 'F', '', 'FF']

# INPUT
# 3
# hoge
# foo
# bar
# ANSWER
# n=int(input())
# string_list=[input() for i in range(n)]


from collections import defaultdict, Counter
import math
from bisect import bisect_left, bisect_right
import numpy as np

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

c = Counter(A)

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

print(ans)

Submission status: Accepted

Solution code:
#073-C
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return input()
n=I()
a=[]
for i in range(n):
    t=I()
    a.append(t)
b=list(set(a))
c={}
cnt=0
for i in b:
    c[i]=0
for i in a:
    c[i]+=1
for i in c.keys():
    if c[i]%2==1:
        cnt+=1
print(cnt)

Submission status: Accepted

Solution code:
from collections import Counter

N = int(input())
A = Counter([int(input()) for i in range(N)])
count = [1 for value in A.values() if value % 2]
print(len(count))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter

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

print(len([True for x in a.values() if (x % 2) == 1]))

Submission status: Accepted

Solution code:
from collections import Counter
n=int(input())
a=[int(input()) for i in range(n)]
b=Counter(a)
c=[k for k,v in b.items() if v%2==1]
print(len(c))

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

Submission status: Accepted

Solution code:
N = int(input())
memo = {}
for i in range(N):
  A = int(input())
  if(A in memo):
    memo[A] += 1
  else:
    memo[A] = 1
cnt = 0
for k, v in memo.items():
  cnt += v%2
print(cnt)

Submission status: Accepted

Solution code:
N = input()
d = {}
for _ in range(N):
    a = input()
    d[str(a)] = d.get(str(a), 0)
    d[str(a)] ^= 1

print sum(d.values())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
A=[]
for i in range(0,N):
    A.append(int(input()))
A.sort()
def histogram_sorted(data):
    result=[]
    item = data[0]
    c=1
    for i in range(1,len(data)):
        if item==data[i]:
            c=c+1
        else:
            result.append([item,c])
            c=1
            item=data[i]
    result.append([item,c])
    return result
a=histogram_sorted(A)
kosu=0
for i in range(len(a)):
        if a[i][1]%2==1:
             kosu=kosu+1
print(kosu)

Submission status: Accepted

Solution code:
from collections import defaultdict
d=defaultdict(int)
N=int(input())
ans=0
for _ in range(N):
  a = int(input())
  if d[a]==0:
    ans+=1
    d[a]=1
  else:
    d[a]=0
    ans-=1
print(ans)