P4305 [JLOI2011] Non-repeating Numbers
Description
Given $n$ numbers, remove the duplicates and keep only the first occurrence of each number.
Input Format
**This problem contains multiple test cases.**
The first line contains an integer $T$, the number of test cases.
For each test case:
The first line contains an integer $n$.
The second line contains $n$ numbers, which are the given numbers.
Output Format
For each test case, output one line containing the remaining numbers after deduplication, separated by a single space.
Explanation/Hint
For $30\%$ of the testdata, $n \le 100$, and each given number $\in [0, 100]$.
For $60\%$ of the testdata, $n \le 10^4$, and each given number $\in [0, 10^4]$.
For $100\%$ of the testdata, $1 \le T \le 50$, $1 \le n \le 5 \times 10^4$, and each given number is within the $32$-bit signed integer range.
Translated by ChatGPT 5