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: Time Limit Exceeded

Solution code:
n = int(input())
l = []
for _ in range(n):
    a = input()
    if a in l:
        l.remove(a)
    else:
        l.append(a)

print(len(l))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
L = [False for i in range(10**9+1)]
A = [int(input()) for n in range(N)]


for a in A:
    L[a] = not L[a]

print(sum(L))

Submission status: Time Limit Exceeded

Solution code:
num=int(raw_input())
tmp=[]
for i in range(num):
    tmp.append(int(raw_input()))

output=0
for i in set(tmp):
    if tmp.count(i)%2 ==1:
        output+=1
print output

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=[input() for _ in range(n)]
x=[]
for i in a:
  if i in x:
    x.remove(i)
  else:
    x.append(i)
print(len(x))

Submission status: Time Limit Exceeded

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

for i in range(N):
    new_num = input()
    if new_num in number_list:
        number_list.remove(new_num)
    else:
        number_list.append(new_num)

print(len(number_list))

Submission status: Time Limit Exceeded

Solution code:
l=int(input())

list=[]
for i in range(l):
    a=int(input())
    if a in list:
        list.remove(a)
    else:
        list.append(a)

print(len(list))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

lis = []
for i in range(N):
    a = int(input())
    if a in lis:
        lis.remove(a)
    else:
        lis.append(a)
    
nsum = len(lis)
print(nsum)

Submission status: Time Limit Exceeded

Solution code:
time = int(input())
ans = []
for i in range(time):
    now = input()
    if now in ans:
        ans.remove(now)
    else:
        ans.append(now)
print(len(ans))

Submission status: Time Limit Exceeded

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


Memo = []
def solve(data):
    global Memo
    for d in data:
        if d in Memo:
            Memo.remove(d)
        else:
            Memo.append(d)
    return len(Memo)


def main():
    N = int(input())
    data = [int(input()) for _ in range(N)]
    result = solve(data)
    print(result)


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8
# Here your code !
n = int(input())
pool = []
for i in range(n):
    a = input()
    if a not in pool:
        pool.append(a)
    elif a in pool:
        pool.remove(a)
print(len(pool))

Submission status: Time Limit Exceeded

Solution code:
as_ = []
for _ in range(int(input())):
    a = int(input())
    if a in as_:
        as_.remove(a)
    else:
        as_.append(a)

print(len(as_))

Submission status: Time Limit Exceeded

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

import sys


def main():
    _ = sys.stdin.readline()
    arr = []
    for line in sys.stdin:
        num = line.rstrip()
        if num in arr:
            arr.remove(num)
        else:
            arr.append(num)
    print(len(arr))


if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

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

print(len(li))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a_list = []

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

print(len(a_list))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
def solution():
	n = int(input())
	l = []
	for i in range(n):
		x = int(input())
		if x in l:
			del l[l.index(x)]
		else:
			l.append(x)

	print(len(l))

solution()

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
S = []
for i in range(N):
  A = int(input())
  if A in S:
    S.remove(A)
  else:
    S.append(A)
print(len(S))

Submission status: Time Limit Exceeded

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

for i in range(N):
    A = int(input())
    q = A in que
    if q == True:
        num = que.index(A)
        que.pop(num)
    else:
        que.append(A)
print(len(que))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

ans = []
for i in range(N): 
    a = int(input())
    if a not in ans:
        ans.append(a)
    else:
        ans.remove(a)


print(len(ans))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import sys

N = int(input())
a = []

for _ in range(N):
    x = int(sys.stdin.readline())
    if x in a:
        a.remove(x)
    else:
        a.append(x)
        
print(len(a))

Submission status: Time Limit Exceeded

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

for n in numbers:
    if n not in paper:
        paper.append(n)
    else:
        paper.remove(n)

print(len(paper))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())

A=[]

for i in range(N):
	ai=int(input())
	if ai in A:
		A.remove(ai)
	else:
		A.append(ai)
print(len(A))

Submission status: Memory Limit Exceeded

Solution code:
import sys
input = sys.stdin.readline
import numpy as np
N = int(input())
sum = 0
li = np.ones(100000010)
for i in range(N) :
    A = int(input())
    if li[A] == 1 :
        sum +=1
        li[A] = 0
    else :
        li[A] = 1
        sum -=1
print(sum)

Submission status: Memory Limit Exceeded

Solution code:
N = int(input())
A = [int(input()) for i in range(N)]
ans = [0]*100000000
for i in A:
  if ans[i] == 0:
    ans[i] += 1
  elif ans[i] > 0:
    ans[i] -= 1
print(sum(ans))

Submission status: Accepted

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

Submission status: Accepted

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

al.sort()
al.append(10**9+1)
cnt = 1
ans = 0
for j in range(n):
    if al[j] == al[j+1]:
        cnt += 1
    elif cnt%2 == 0:
        cnt = 1
    elif cnt%2 == 1:
        cnt = 1
        ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(N):
    a = int(input())
    
    if a not in dic:
        dic[a] = 1
    else:
        del dic[a]

print(len(dic))

Submission status: Accepted

Solution code:
import sys
def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
from functools import partial, reduce
from collections import Counter


def f_chain(*args):
    return reduce(lambda x, f: f(x), args)

def main():
    n = II()
    aa = [II() for _ in range(n)]
    c_cnt = Counter(aa).values()
    f_chain(c_cnt,
            partial(map, lambda x: 1 if x%2==1 else 0),
            sum,
            print)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
## io ##
def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
from functools import partial, reduce
from collections import Counter
#======================================================#
def f_chain(*args):
    return reduce(lambda x, f: f(x), args)
def is_odd(n):
    return n%2==1

def main():
    n = II()
    aa = [II() for _ in range(n)]
    c = Counter(aa)
    f_chain(c.values(),
            partial(filter, is_odd),
            list,
            len,
            print,
    )

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
A = []
count = 1
ans = 0

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

A.sort()

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

print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 23 16:58:10 2020

@author: liang
"""


"""
【パディングはソート後】
"""
N = int(input())
A = [int(input()) for _ in range(N)]
A.sort()
A += [-1]
ans = 0
count = 1
for i in range(N):
    #print(count)
    if A[i] == A[i+1]:
        #print("A")
        count += 1
    else:
        #print("B")
        if count%2 == 1:
            ans += 1
        count = 1
print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 23 16:50:38 2020

@author: liang
"""
N = int(input())
d = dict()
ans = 0 
A = [int(input()) for _ in range(N)]
for a in A:
    if a in d:
        d[a] += 1
    else:
        d[a] = 1
#print(d)
for key in d.keys():
    if d[key] %2 ==1:
        ans += 1
        d[key] = 0
#print(d)
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
alst = [int(input()) for _ in range(n)]
alst.sort()
bef = -1
ans = 0
for a in alst:
  if a == bef:
    ans -= 1
    bef = -1
  else:
    ans += 1
    bef = a
print(ans)

Submission status: Accepted

Solution code:
from collections import defaultdict

d = defaultdict(int)

n = int(input())
for i in range(n):
  a = int(input())
  d[a] = int(not(d[a]))
ans=0
for k,v in d.items():
  if v == 1:
    ans += 1

print(ans)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

Submission status: Accepted

Solution code:
n = int(input())
a = [int(input()) for _ in range(n)]
import collections
cnt = 0
b = collections.Counter(a)
for k in b:
    if b[k]%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)]

print(sum(c%2 for c in Counter(A).values()))

Submission status: Accepted

Solution code:

from collections import Counter

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

L = Counter(A)

print(sum( 1 for c in L.values() if c%2 ))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
memo = {}
for i in range(N):
    s = int(input())
    if s in memo:
        memo[s] += 1
    else:
        memo[s] = 1
ans = 0
for key, val in memo.items():
    if val%2:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from math import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
import math
import bisect
import heapq
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入g
#
# インデックス系
# int min_y = max(0, i - 2), max_y = min(h - 1, i + 2);
# int min_x = max(0, j - 2), max_x = min(w - 1, j + 2);
#
#
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
#mod = 998244353
INF = float('inf')
from sys import stdin
readline = stdin.readline
def readInts():
  return list(map(int,readline().split()))
def readTuples():
    return tuple(map(int,readline().split()))
def I():
    return int(readline())
n = I()
dic = defaultdict(int)
for i in range(n):
    a = I()
    dic[a] += 1
ans = 0
for k,v in dic.items():
    ans += v%2
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter
print(sum(x % 2 for x in Counter([int(input())
                                  for _ in range(int(input()))]).values()))

Submission status: Accepted

Solution code:
from collections import defaultdict


N, *A = map(int, open(0).read().split())
ans = defaultdict(int)
for a in A:
    ans[a] += 1
print(sum(v % 2 for v in ans.values()))

Submission status: Accepted

Solution code:
from collections import defaultdict
d = defaultdict(int)
n = int(input())
for i in range(n):
    a = int(input())
    if d[a] > 0:
        d[a] -= 1
    else:
        d[a] += 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter

n = int(input())
al = list(int(input()) for _ in range(n))
c = Counter(al)
ans = 0
for k, v in c.items():
    if v%2 != 0:
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
A = [int(input()) 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:
from collections import Counter
n = int(input())
ans = 0
C = Counter(int(input()) for _ in range(n))
for c in C.values():
    if c % 2 == 1:
        ans += 1
print(ans)

Submission status: Accepted

Solution code:
import collections

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

ans= 0
Acount = collections.Counter(A)

for i in Acount:
    if Acount[i] % 2 == 1:
        ans += 1

print(ans)

Submission status: Accepted

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

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

A.sort()

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

ans+=count%2

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S = set()
ans = 0
for i in range(N):
    a = int(input())
    if a in S:
        ans -= 1
        S.remove(a)
    else:
        ans += 1
        S.add(a)
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

N =int(input())
A = {}
for i in range(N):
    val = int(input())
    if val in A:
        A[val] += 1
    else:
        A[val] = 1

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

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

Submission status: Accepted

Solution code:
import collections

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

cnt = 0
for x in c.values():
    if x % 2 == 1:
        cnt += 1
print(cnt)

Submission status: Accepted

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

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

print(len(kami))

Submission status: Accepted

Solution code:
import math
from math import gcd,pi,sqrt
INF = float("inf")

import sys
sys.setrecursionlimit(10**6)
import itertools
from collections import Counter,deque
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]

def main():
    n = i_input()
    dic = {}
    for i in range(n):
        a = i_input()
        dic[a] = dic.get(a,0) + 1

    ans = 0

    for i,k in dic.items():
        if k % 2 == 1:
            ans += 1
    print(ans)








if __name__=="__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

print(len(a))

Submission status: Accepted

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

tmp = 1
cnt = 0
for i in range(N):    
    if i+1<N:
        if A[i] == A[i+1]:
            tmp += 1
        else:
            cnt += tmp%2
            tmp = 1
    else:
        cnt += tmp%2

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

A.sort()

cnt=1
ans=0
for n in range(1,N):
    if A[n]==A[n-1]:
        cnt+=1
    else:
        if cnt%2==1:
            ans+=1
        cnt=1
    if n==N-1 and cnt%2==1:
        ans+=1
print(ans)

Submission status: Accepted

Solution code:
from collections import Counter
with open(0) as f:
    N, *A = map(int, f.read().split())
ans = sum(1 for v in Counter(A).values() if v&1)
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
A=dict()
for _ in range(N):
    a=int(input())
    if a not in A:
        A[a]=0
    A[a]=1-A[a]
print(sum(A.values()))

Submission status: Accepted

Solution code:
import collections
n = int(input())
l = list(int(input()) for i in range(n))
d = collections.Counter(l)
ans = 0
for v in d.values():
  ans += v % 2
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
d = {}
for i in range(N):
  a = int(input())
  d[a] = d.get(a, 0) ^ 1
x = sorted(d.values())
print(sum(x))

Submission status: Accepted

Solution code:
from collections import defaultdict
n = int(input())
li = []
s = set()
for val in range(n):
    i = int(input())
    if i in s:
        s.remove(i)
    else:
        s.add(i)

print(len(s))

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())
x = [int(input()) for i in range(n)]
c = collections.Counter(x)
cc = list(c.values())
cnt = 0
for i in range(len(cc)):
    if cc[i] % 2 == 1:
        cnt += 1
print(cnt)

Submission status: Accepted

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

dic = {}

for i in range(N):
  if A[i] in dic.keys():
    dic[A[i]] += 1
  else:
    dic[A[i]] = 1
    
cnt = 0

for j in dic.keys():
  if dic[j] % 2 == 1:
    cnt += 1
    
print(cnt)

Submission status: Accepted

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

caa = collections.Counter(aa) # couter aa
cnt = 0
laa = [x[1] for x in caa.items()]
for la in laa:
  if la % 2 == 1:
    cnt += 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter

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

l=Counter(l)

cnt=0

for i in l.values():
  if i%2==0:
    cnt+=1
    
print(len(l)-cnt)

Submission status: Accepted

Solution code:
n=int(input())
a=[]
for i in range(n):
    a.append(int(input()))
a=sorted(a)
ans=0
cnt=1
for i in range(n-1):

    if a[i]==a[i+1]:
        cnt+=1
    else:
        if cnt%2==1:ans+=1
        cnt=1
if cnt%2==1:ans+=1
print(ans)

Submission status: Accepted

Solution code:
import sys
from sys import exit
from collections import deque
from bisect import bisect_left, bisect_right, insort_left, insort_right #func(リスト,値)
from heapq import heapify, heappop, heappush
from math import *

sys.setrecursionlimit(10**6)
INF = 10**20
MOD = 10**9+7

def mint():
    return map(int,input().split())
def lint():
    return list(map(int,input().split()))
def judge(x, l=['Yes', 'No']):
    print(l[0] if x else l[1])
def lprint(l, sep='\n'):
    for x in l:
        print(x, end=sep)

N = int(input())
A = dict()
for _ in range(N):
    a = int(input())
    A.setdefault(a,0)
    A[a] += 1
ans = 0
for a in A:
    ans += A[a]%2!=0
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
paper = dict()
for i in range(n):
    a = int(input())
    if a not in paper:
        paper[a] = 1
    else:
        paper.pop(a)

res = 0
for value in paper.values():
    if value == 1:
        res += 1
print(res)

Submission status: Accepted

Solution code:
import sys
mod=10**9+7 ; inf=float("inf")
from math import sqrt, ceil
from collections import deque, Counter, defaultdict #すべてのkeyが用意されてる defaultdict(int)で初期化
input=lambda: sys.stdin.readline().strip()
sys.setrecursionlimit(11451419)
from decimal import ROUND_HALF_UP,Decimal  #変換後の末尾桁を0や0.01で指定
  #Decimal((str(0.5)).quantize(Decimal('0'), rounding=ROUND_HALF_UP))
from functools import lru_cache
from bisect import bisect_left as bileft, bisect_right as biright
#メモ化再帰defの冒頭に毎回 @lru_cache(maxsize=10**10)
#引数にlistはだめ
#######ここまでテンプレ#######
#ソート、"a"+"b"、再帰ならPython3の方がいい
#######ここから天ぷら########

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

Submission status: Accepted

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

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

Submission status: Accepted

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

import collections

c = collections.Counter(A)

print(sum([1 for x in c.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)]

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

print(ans)

Submission status: Accepted

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

import collections

ans = 0
lis = collections.Counter(lis)

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

print(ans)

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# vim: fileencoding=utf-8


def main():
    n = int(input())
    a = set()
    for i in range(n):
        m = input()
        if m in a:
            a.remove(m)
        else:
            a.add(m)
    print(len(a))


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import collections
n=int(input())
a=[int(input()) for _ in range(n)]
b=collections.Counter(a)
ans=0
for i in b.keys():
  if b[i]%2:
    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)

hoge = 0
foo = 0
ans = 0

for i in range(n):
    if i == 0:
        foo = a[i]
        hoge = 1
    elif i == n-1:
        if foo != a[i]:
            if hoge == 1:
                ans += 1
            ans += 1
        else:
            if hoge == 0:
                ans += 1
    elif foo == a[i]:
        hoge = 1-hoge
    else:
        if hoge == 1:
            ans += 1
        foo = a[i]
        hoge = 1

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
d=dict()
for _ in range(n):
    hoge=int(input())
    if d.get(hoge,0)==0:
        d[hoge]=1
    else:
        d[hoge]+=1
ans=0
for i in d.values():
    if i%2==1:
        ans+=1
print(ans)

Submission status: Accepted

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

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

cc=collections.Counter(A)
ans=0
for nums in list(cc.values()):
    if nums%2==1:
        ans+=1
print(ans)

Submission status: Accepted

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

    count = 0
    tmp = 0
    number = a_lst[0]

    for i in range(n):

        if a_lst[i] == number:
            tmp += 1

            if i == n - 1:
                if tmp % 2 != 0:
                    count += 1

        else:
            number = a_lst[i]

            if tmp % 2 == 0:
                tmp = 1
                continue
            else:
                count += 1
                tmp = 1

    if n > 1:
        if a_lst[-1] != a_lst[-2]:
            count += 1

    print(count)


if __name__ == '__main__':
    main()

Submission status: Accepted

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


def solve(N: int, A: "List[int]"):
    from collections import Counter    
    return sum(map(lambda x: x%2==1, Counter(A).values()))

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
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]"
    print(solve(N, A))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()

Submission status: Accepted

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

num_dic = {}
for a in al:
    num = num_dic.get(a, 0)
    num_dic[a] = 1 if num == 0 else 0

ans = 0
for k, v in num_dic.items():
    if v != 0:
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

n = int(input())

a = []

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

a.sort()

i = 0
ans = 0
while i < n:
    num = 1
    i += 1
    while i < n and a[i] == a[i-1]:
        num += 1
        i += 1
    if num % 2 == 1:
        ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
sum = 0
nums = {}

for _ in range(n):
    a = input()
    if a not in nums:
        nums[a] = 1
    else:
        nums[a] += 1

for i in nums.values():
    sum += i % 2

print(sum)