cswork / OA打开练习工作台

Pure StorageOA #12

Find Doubles

估计简单可在线判题

考点(AI 标注)哈希计数

You are given a list of integers. For each element x in the list, if exactly one element in the list equals 2x, include this x in the answer; the answer keeps repeated occurrences of x from the input and is output in ascending order. Twice 0 is still 0.

输入格式

The first line contains n; the second line contains n integers. The original upper limits are kept in full: 0≤n≤100000, 0≤value≤1000. The original problem gives no positive lower bound on the length, so this site explicitly allows the empty list n=0.

输出格式

Output all matching elements in ascending order, separated by spaces; if the answer is empty, output an empty line.

样例 1

输入:

11
1 2 3 4 5 6 7 8 9 0 8

输出:

0 1 2 3

样例 2

输入:

5
7 17 11 1 23

输出:

样例 3

输入:

3
1 1 2

输出:

1 1