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: Runtime Error

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

paper = []
for i in a:
    if i in paper:
        paper.remove(i)
    else:
        paper.append(i)
print(len(paper))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import collections

N = int(input())

List = {}
for i in range(N):
    A = int(input())
    if List.get(A,None)==None:
        List[A]=1
    else:
        del List[A]

c = collections.Counter(List)
if(c.most_common(1)[0][1]==0):
    print(0)
    exit()

print(len(c))

Submission status: Runtime Error

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

s = set()
for a_ in a:
    s ^= a

print(len(s))

Submission status: Runtime Error

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


if __name__ == "__main__":
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=int(input())
x=[]
for i in range(N):
  if i==0:
    x+=list(int(input()))
  else:
    y=int(input())
    if y in x:
      x.remove(y)
    else:
      x.append(y)
print(len(x))

Submission status: Runtime Error

Solution code:
N=int(input())
for i in range(N):
  if i==0:
    x+=list(int(input()))
  else:
    y=int(input())
    if y in x:
      x.remove(y)
    else:
      x.append(y)
print(len(x))

Submission status: Runtime Error

Solution code:
n=int(input())
ans=[0]*1000000002
for i in range(n):
  num=int(input())
  if ans[num] == 0:
    ans[num]+=1
  else:
    ans[num]=0
print(sum(ans))

Submission status: Runtime Error

Solution code:
n=int(input())
ans=[0]*100002
for i in range(n):
  num=int(input())
  if ans[num] == 0:
    ans[num]+=1
  else:
    ans[num]=0
print(sum(ans))

Submission status: Runtime Error

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

ans=0
c=0
for i in range(n-1):
    if len(l)>0 and l[c]==l[c+1]:
        l.pop(c)
        l.pop(c)
    else:
        c+=1
if len(l)==n:
    print(n)
else:
    print(len(l))

Submission status: Runtime Error

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

ans=0
c=0
for i in range(n-1):
    if len(a)>0 and a[c]==a[c+1]:
        a.pop(0)
        a.pop(0)
    else:
        c+=1
print(len(a))

Submission status: Runtime Error

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

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

# solve
ans = 0
l = [0] * max(A)
for i in range(N):
    l[A[i] - 1] += 1

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

# output
print(ans)

Submission status: Runtime Error

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

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

    check = [False] * (max(a) + 1)

    for i in a:
        check[i] = not(check[i])
    
    ans = 0
    for c in check:
        if c:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Runtime Error

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

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

    check = [False] * (int(1e5) + 1)

    for i in a:
        check[i] = not(check[i])
    
    ans = 0
    for c in check:
        if c:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
list = [0] * 1000001

for i in range(n):
  num = int(input())
  if list[num - 1] == 0:
    list[num - 1] = 1
  else:
    list[num - 1] = 0

print(sum(list))

Submission status: Runtime Error

Solution code:
n = int(input())
list = [0] * 100000

for i in range(n):
  num = int(input())
  if list[num - 1] == 0:
    list[num - 1] = 1
  else:
    list[num - 1] = 0

print(sum(list))

Submission status: Runtime Error

Solution code:
n=int(input())
l=[0]*n
for i in range(n):
  l[i]=int(input())
l.sort()
ans=0
c=0
j=0
while len(l)>0:
  while l[j+1]==l[j]:
    c+=1
    j+=1
  c+=1
  j+=1
  if c%2==1:
    ans+=1
print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
l=[0]*n
for i in range(n):
  l=int(input())
#l.sort()
ans=0
for j in range(1,10**9+1):
  if l.count(j)%2==1:
    ans+=1
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import collections

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

Submission status: Runtime Error

Solution code:
a = int(input())
b = [False] *(10**5)
for i in range(a):
    c = int(input())
    b[c-1] = not b[c-1]
d = 0
for i in b:
    if i:
        d += 1
print(d)

Submission status: Runtime Error

Solution code:
N=int(input())

from collections import defaultdict
d = defaultdict(int)

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

ams=0
for i in d.values():
    i%2==1:
    ans+=1

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=int(input())
L=[]
n=0
while n <N+1 :
  A=int(input())
  if A in L:
    L.remove(A)
    n=n+1
  else:
    L.append(A)
    n=n+1
print(len(L))

Submission status: Runtime Error

Solution code:
###template###
import sys
def input(): return sys.stdin.readline().rstrip()
def mi(): return map(int, input().split())
###template###

N = int(input())

nlist = [0] * (10**9+1)
for _ in range(N):
  i = int(input())
  nlist[i] = ~nlist[i]

print(nlist.count(~0))

Submission status: Runtime Error

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

cnt = Counter(a).value()


flg = 0
for i in cnt:
    if i%2 == 1:
        flg += 1

print(flg)

Submission status: Runtime Error

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

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

print(len(s))

Submission status: Runtime Error

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

for i in range(N):
  tmp = int(input())
  if tmp not in A:
    A.append(tmp)
  else:
    A.romove(tmp)
    
print(len(A))

Submission status: Runtime Error

Solution code:
# ABC073C - Write and Erase
import sys
input = sys.stdin.readline

n = int(input())
arr = [0] * (10 ** 9 + 1)
cnt = 0
for _ in range(n):
    m = int(input())
    if arr[m] == 0:
        arr[m] = m
    else:
        arr[m] = 0
for i in arr:
    if i != 0:
        cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
import sys
from bisect import bisect_left, bisect_right
from typing import Any, Callable, Iterable, Iterator, List, Sequence

ItemGetter = Callable[[Sequence], Any]


class SortedCollection:
    def __init__(self, items: Iterable, key: ItemGetter) -> None:
        self._key = key
        self._items = sorted(items, key=key)
        self._keys = [key(item) for item in self._items]

    @property
    def key(self) -> ItemGetter:
        return self._key

    @key.setter
    def key(self, key: ItemGetter) -> None:
        if key != self.key:
            self._key = key
            self._items = sorted(self.items, key=key)
            self._keys = [key(item) for item in self._items]

    @property
    def items(self) -> List:
        return self._items

    @property
    def keys(self) -> List:
        return self._keys

    def clear(self) -> None:
        self._key = self.key
        self._items = []

    def copy(self) -> "SortedCollection":
        return self.__class__(self, self.key)

    def __len__(self) -> int:
        return len(self.items)

    def __getitem__(self, i: int) -> Any:
        return self.items[i]

    def __iter__(self) -> Iterator:
        return iter(self.items)

    def __reversed__(self) -> Iterator:
        return reversed(self.items)

    def __repr__(self) -> str:
        return "%s(%r, key=%s)" % (
            self.__class__.__name__,
            self.items,
            getattr(self.key, "__name__", repr(self.key)),
        )

    def __contains__(self, item: Any) -> bool:
        k = self.key(item)
        i = bisect_left(self.keys, k)
        j = bisect_right(self.keys, k)
        return item in self.items[i:j]

    def index(self, k: int) -> int:
        "Find the position of an item.  Raise ValueError if not found."
        i = bisect_left(self.keys, k)
        j = bisect_right(self.keys, k)
        return self.keys[i:j].index(k) + i

    def count(self, k: int) -> int:
        "Return number of occurrences of item"
        i = bisect_left(self.keys, k)
        j = bisect_right(self.keys, k)
        return self.keys[i:j].count(k)

    def insert(self, item: Any) -> None:
        "Insert a new item.  If equal keys are found, add to the left"
        k = self.key(item)
        i = bisect_left(self.keys, k)
        self.keys.insert(i, k)
        self.items.insert(i, item)

    def insert_right(self, item: Any) -> None:
        "Insert a new item.  If equal keys are found, add to the right"
        k = self.key(item)
        i = bisect_right(self.keys, k)
        self.keys.insert(i, k)
        self.items.insert(i, item)

    def remove(self, k: int) -> None:
        "Remove first occurence of item.  Raise ValueError if not found"
        i = self.index(k)
        del self.keys[i]
        del self.items[i]

    def find(self, relation_op: str, k: int) -> Any:
        find_func_dict = {
            "==": self._find_eq,
            ">": self._find_gt,
            ">=": self._find_ge,
            "<": self._find_lt,
            "<=": self._find_le,
        }
        return find_func_dict[relation_op](k)

    def _find_eq(self, k: int) -> Any:
        "Return first item with a key == k.  Raise ValueError if not found."
        i = bisect_left(self.keys, k)
        if i != len(self) and self.keys[i] == k:
            return self.items[i]
        raise ValueError("No item found with key equal to: %r" % (k,))

    def _find_le(self, k: int) -> Any:
        "Return last item with a key <= k.  Raise ValueError if not found."
        i = bisect_right(self.keys, k)
        if i:
            return self._items[i - 1]
        raise ValueError("No item found with key at or below: %r" % (k,))

    def _find_lt(self, k: int) -> Any:
        "Return last item with a key < k.  Raise ValueError if not found."
        i = bisect_left(self.keys, k)
        if i:
            return self._items[i - 1]
        raise ValueError("No item found with key below: %r" % (k,))

    def _find_ge(self, k: int) -> Any:
        "Return first item with a key >= equal to k.  Raise ValueError if not found"
        i = bisect_left(self.keys, k)
        if i != len(self):
            return self._items[i]
        raise ValueError("No item found with key at or above: %r" % (k,))

    def _find_gt(self, k: int) -> Any:
        "Return first item with a key > k.  Raise ValueError if not found"
        i = bisect_right(self.keys, k)
        if i != len(self):
            return self._items[i]
        raise ValueError("No item found with key above: %r" % (k,))

def solve(N: int, A: "List[int]"):
    ans = 0
    seta = sorted(list(set(A)))
    sa = SortedCollection(A, key=lambda x: x)
    for a in seta:
        if sa.count(a) % 2 != 0:
            ans += 1
    print(ans)
    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: Runtime Error

Solution code:
#!/usr/bin/env python3
import sys
from bisect import bisect_left, bisect_right
from collections.abc import Collection
from typing import Any, Callable, Iterable, Iterator, List, Sequence

ItemGetter = Callable[[Sequence], Any]


class SortedCollection(Collection):
    def __init__(self, items: Iterable, key: ItemGetter) -> None:
        self._key = key
        self._items = sorted(items, key=key)
        self._keys = [key(item) for item in self._items]

    @property
    def key(self) -> ItemGetter:
        return self._key

    @key.setter
    def key(self, key: ItemGetter) -> None:
        if key != self.key:
            self._key = key
            self._items = sorted(self.items, key=key)
            self._keys = [key(item) for item in self._items]

    @property
    def items(self) -> List:
        return self._items

    @property
    def keys(self) -> List:
        return self._keys

    def clear(self) -> None:
        self._key = self.key
        self._items = []

    def copy(self) -> "SortedCollection":
        return self.__class__(self, self.key)

    def __len__(self) -> int:
        return len(self.items)

    def __getitem__(self, i: int) -> Any:
        return self.items[i]

    def __iter__(self) -> Iterator:
        return iter(self.items)

    def __reversed__(self) -> Iterator:
        return reversed(self.items)

    def __repr__(self) -> str:
        return "%s(%r, key=%s)" % (
            self.__class__.__name__,
            self.items,
            getattr(self.key, "__name__", repr(self.key)),
        )

    def __contains__(self, item: Any) -> bool:
        k = self.key(item)
        i = bisect_left(self.keys, k)
        j = bisect_right(self.keys, k)
        return item in self.items[i:j]

    def index(self, k: int) -> int:
        "Find the position of an item.  Raise ValueError if not found."
        i = bisect_left(self.keys, k)
        j = bisect_right(self.keys, k)
        return self.keys[i:j].index(k) + i

    def count(self, k: int) -> int:
        "Return number of occurrences of item"
        i = bisect_left(self.keys, k)
        j = bisect_right(self.keys, k)
        return self.keys[i:j].count(k)

    def insert(self, item: Any) -> None:
        "Insert a new item.  If equal keys are found, add to the left"
        k = self.key(item)
        i = bisect_left(self.keys, k)
        self.keys.insert(i, k)
        self.items.insert(i, item)

    def insert_right(self, item: Any) -> None:
        "Insert a new item.  If equal keys are found, add to the right"
        k = self.key(item)
        i = bisect_right(self.keys, k)
        self.keys.insert(i, k)
        self.items.insert(i, item)

    def remove(self, k: int) -> None:
        "Remove first occurence of item.  Raise ValueError if not found"
        i = self.index(k)
        del self.keys[i]
        del self.items[i]

    def find(self, relation_op: str, k: int) -> Any:
        find_func_dict = {
            "==": self._find_eq,
            ">": self._find_gt,
            ">=": self._find_ge,
            "<": self._find_lt,
            "<=": self._find_le,
        }
        return find_func_dict[relation_op](k)

    def _find_eq(self, k: int) -> Any:
        "Return first item with a key == k.  Raise ValueError if not found."
        i = bisect_left(self.keys, k)
        if i != len(self) and self.keys[i] == k:
            return self.items[i]
        raise ValueError("No item found with key equal to: %r" % (k,))

    def _find_le(self, k: int) -> Any:
        "Return last item with a key <= k.  Raise ValueError if not found."
        i = bisect_right(self.keys, k)
        if i:
            return self._items[i - 1]
        raise ValueError("No item found with key at or below: %r" % (k,))

    def _find_lt(self, k: int) -> Any:
        "Return last item with a key < k.  Raise ValueError if not found."
        i = bisect_left(self.keys, k)
        if i:
            return self._items[i - 1]
        raise ValueError("No item found with key below: %r" % (k,))

    def _find_ge(self, k: int) -> Any:
        "Return first item with a key >= equal to k.  Raise ValueError if not found"
        i = bisect_left(self.keys, k)
        if i != len(self):
            return self._items[i]
        raise ValueError("No item found with key at or above: %r" % (k,))

    def _find_gt(self, k: int) -> Any:
        "Return first item with a key > k.  Raise ValueError if not found"
        i = bisect_right(self.keys, k)
        if i != len(self):
            return self._items[i]
        raise ValueError("No item found with key above: %r" % (k,))


def solve(N: int, A: "List[int]"):
    ans = 0
    seta = sorted(list(set(A)))
    sa = SortedCollection(A, key=lambda x:x)
    for a in seta:
        if sa.count(a) % 2 != 0:
            ans += 1
    print(ans)
    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: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
lst_a = [int(input()) for _ in range(N)]
lst_ans = [0] * (10**5 + 2)
lst_a.sort()


for a in lst_a:
    lst_ans[a] += 1
ans = sum(1 for i in lst_ans if i % 2 != 0)


print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
lst_a = [int(input()) for _ in range(N)]
lst_ans = [0] * (10**5 + 2)
lst_a.sort()


for a in lst_a:
    lst_ans[a] += 1
ans = sum(1 for i in lst_ans if i % 2 == 1)


print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
lst_a = [int(input()) for _ in range(N)]
lst_ans = [0] * (10**5)
lst_a.sort()


for a in lst_a:
    lst_ans[a] += 1
ans = sum(1 for i in lst_ans if i % 2 == 1)


print(ans)

Submission status: Runtime Error

Solution code:
# /usr/bin/python
# -*- coding: utf-8 -*-
import math



An = [0 for _ in range(100001)]
for _ in range(int(input())):
  i = int(input())
  An[i] = (An[i]+1)%2

print(sum(An))

Submission status: Runtime Error

Solution code:
n=int(input())
a=[]
for i in range(n):
    a.append(int(input()))
maxa=max(a)
test=[1]*(maxa+1)

for i in range(n):
    test[a[i]]=test[a[i]]*(-1)
print((maxa-sum(test)+1)//2)

Submission status: Runtime Error

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

test=[1]*(max(a)+1)

for i in range(n):
    test[a[i]]=test[a[i]]*(-1)

print(test.count(-1))

Submission status: Runtime Error

Solution code:
n = int(input())
x = [0 for i in range(10**5+1)]
for i in range(n):
    t = int(input())
    x[t]+=1
    if x[t]==2:
        x[t]=0
print(x.count(1))

Submission status: Runtime Error

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

import bisect

def main():
    n = int(input())
    s = []

    for i in range(n):
        a = int(input())
        i = bisect.bisect_left(s, a)
        if len(s) > 0 and s[i] == a:
            s.remove(a)
        else:
            s.insert(i, a)


    print(len(s))


main()

Submission status: Runtime Error

Solution code:
N=int(input())
NUM_list = [0]*1000000000
X=0

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

for i in range(1000000000):
   X += NUM_list[i]%2

print(X)

Submission status: Runtime Error

Solution code:
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def pf(s): return print(s, flush=True)

N=I()
A=[I() for i in range(N)]
counts = collections.Counter(A)
ans=0
for i in counts.values():
    if values%2 == 1: 
        ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>

using namespace std;
int main(void) {
    int n;
    cin >> n;
    vector<int>a(n);
    for(int i = 0;i<n;i++){
        cin >> a[i];
    }
    sort(a.begin(),a.end());
    int j = 0;int sum = 0;
    while(j <n){
        if(a[j] == a[j+1]){
            j+=2;
        }else{
            sum += 1;
            j+=1;
        }
    }
    cout<<sum <<endl;
}

Submission status: Runtime Error

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

max_A = max(A)

num = [0] * (max_A + 1)

for i in range(N):
	num[A[i]] += 1

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

print(sum)

Submission status: Runtime Error

Solution code:
import sys
n=int(input())
a=[[int(i) for i in l] for l in sys.stdin]
a.sort()
stack=a[0]
num=1
ans=0
for i in range(1,n):
  if a[i]==stack:
    num+=1
  else:
    if num%2==1:
      ans+=1
    stack=a[i]
    num=1
if num%2==1:
  ans+=1
print(ans)

Submission status: Runtime Error

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

for i in range(N):
  if A[i] not in array:
    array.append(A[i])
    if A.count(A[i]) % 2 == 1:
      ans += 1
  print(i, array, ans)

Submission status: Runtime Error

Solution code:
n = int(input())
a = [int(input()) for _ in range(n)]
cnt = [0]*int(1e5+10)
for i in range(n) :
  cnt[a[i]] += 1
print(sum([cnt[i]%2 for i in range(len(cnt))]))

Submission status: Runtime Error

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

lis.sort()

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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] == memo:
        count+=1
    else:
        pre = a[i]
        if count%2 == 1:
            ans += 1
        count = 1
if count%2 == 1:
    ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
s = int(input())
num = [int(input()) for _ in range(n)]
ans = 0

for i in set(num):
    if num.count(i)%2 == 1:
        ans += 1

print(ans)

Submission status: Runtime Error

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: Runtime Error

Solution code:
import collections

n = int(input())

co = collectiosn.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: Runtime Error

Solution code:
num = int(input().strip().split())
nums = []
while num > 0:
    tmp = int(input().strip().split())
    if tmp in nums:
        nums.remove(tmp)
    else:
        nums.append(tmp)
    num -= 1
print(len(nums))

Submission status: Runtime Error

Solution code:
#include <cstdio>
#include <cstring>
int number[400000005] ={0};
int main()
{
    int n,i,j,ans=0;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&j);
        if(number[j]==0)
        {
            ans++;
            number[j]++;
        }
        else
        {
            ans--;
            number[j]--;
        }
    }
    printf("%d",ans);
    return 0;
}

Submission status: Runtime Error

Solution code:
l=[0]*100001
n=int(input())
for i in range(n):
  a=int(input())
  l[a]=abs(l[a]-1)
print(l.count(1))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
int_n = int(input())

ar_int_a = []
for i in range(int_n):
    ar_int_a.append(int(input()))

numbers = set(ar_int_a)

# written = [i for i in numbers if ar_int_a.count(i) % 2 == 1]
written = len((i for i in numbers if ar_int_a.count(i) % 2 == 1))

# print(len(written))
print(written)

Submission status: Runtime Error

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

Submission status: Runtime Error

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={}
for i in b:
    c[i]=0
for i in a:
    c[a]+=1
for i in c.keys():
    if c[i]%2==1:
        cnt+=1
print(cnt)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import collections
start = time.time()
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: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())

ko = [0 for _ in range(100000)]

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

for i in range(n):
    ko[a[i]] += 1

ko = list(filter(lambda x: x%2 == 1, ko))

#print(ko)

print(len(ko))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

n=int(input())
l=[int(input()) for i in range(n)]
ls=collections.Counter(l)
#print(ls)
a=0
for value in ls.values():
    if value%2==1:
        a+=1
print(a)

Submission status: Runtime Error

Solution code:
n=int(input())
l=[int(input()) for i in range(n)]
ls=collections.Counter(l)
#print(ls)
a=0
for value in ls.values():
    if value%2==1:
        a+=1
print(a)

Submission status: Runtime Error

Solution code:
a=[0]*1000000001
N = int(input())
for i in range(N):
    a[int(input().strip())]+=1
for i in range(len(a)):
    a[i]=a[i]%2
print(sum(a))

Submission status: Runtime Error

Solution code:
N=int(raw_input())
A = [0 for i in range(10**9)]

for i in range(N):
    a=int(raw_input())
    A[a-1]=(A[a-1]+1)%2

print(sum(A))

Submission status: Runtime Error

Solution code:
N=int(raw_input())
A = [0 for i in range(10000000000)]

for i in range(N):
    a=int(raw_input())
    A[a-1]=(A[a-1]+1)%2

print(sum(A))

Submission status: Runtime Error

Solution code:
N=int(raw_input())

A = [0 for i in range(N)]

for i in range(N):
    a=int(raw_input())
    A[a-1]=(A[a-1]+1)%2

print sum(A)

Submission status: Runtime Error

Solution code:
N=int(raw_input())

A = [0 for i in range(N)]

for i in range(N):
    a=int(raw_input())
    A[a-1]=(a-1]+1)%2

print sum(A)

Submission status: Runtime Error

Solution code:
N=int(raw_input())

A = [0 for i in range(N)]

for i in range(N):
    A[int(raw_input())-1]=(A[int(raw_input())-1]+1)%2

print sum(A)