P1469 Find the Chopstick

Description

After a period of intense preparation, the computer club’s "RP Restaurant" finally opened. One day, manager LXC received a large order, which made everyone very happy! The staff worked together to prepare the set meals as required and were about to deliver them when they suddenly encountered a tricky problem: chopsticks! CX found all the chopsticks in the restaurant, but unfortunately they are of different lengths. We all know that a pair of chopsticks must be of the same length. To make it worse, the number of chopsticks CX found is odd. Coincidentally, among these chopsticks, only one chopstick is single, and all the others are in pairs. Kind-hearted as you are, can you help CX find the length of this single chopstick?

Input Format

The first line contains an integer, the number of chopsticks $n$. The second line contains $n$ integers. The $i$-th integer is the length $a_i$ of the $i$-th chopstick.

Output Format

Output a single integer in one line representing the answer.

Explanation/Hint

Constraints - For 30% of the testdata, it is guaranteed that $n \leq 10^5$. - For 100% of the testdata, it is guaranteed that $1 \leq n \leq 10^7 + 1$, $1 \leq a_i \leq 10^9$. Hints - Pay attention to how input reading affects program efficiency. - Note the space limit of $8$ Mb. Translated by ChatGPT 5