cswork / OA打开练习工作台

AmazonOA #192

Find Unique Values

估计简单可在线判题

考点(AI 标注)双指针滑窗哈希计数

Repeatedly pair the people with the smallest and the largest remaining experience into a group and remove both, until everyone is paired. Find the number of distinct values among the groups' average experience.

输入格式

The first line contains an even n; the second line contains the experience values. 2≤n≤100000 and n is even; 1≤experience≤10^9.

输出格式

Output a single integer, the answer.

样例 1

输入:

6
1 4 1 3 5 6

输出:

2

样例 2

输入:

6
1 1 1 1 1 1

输出:

1

样例 3

输入:

4
1 100 10 1000

输出:

2

样例说明

The answers are 2, 1 and 2.