| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 64 MB | 89 | 30 | 27 | 40.909% |
This is a run-twice problem: your solution will be executed twice on each test. See the rest of the statement and the input format section for more details.
You are a given a stream of integers such that each integer in the stream appears exactly twice, except for exactly two integers both of which appear exactly once. Your task is to construct a streaming algorithm that finds these two integers.
Your solution will be invoked on each test twice.
On each invocation, the first line contains two integers $q$ and $n$ ($q \in \{1, 2\},ドル 0ドル \leq n \leq 10^6$): the number of invocation and the size of the part of the stream. Additionally, on the second invocation, the first line also contains two integers $x$ and $y$: the output of your program after the first invocation in the same exact order.
The second line contains $n$ 64-bit unsigned integers separated by a space: the part of the stream itself.
In the first and the second parts combined, out of the integers that appear at all, each integer appears exactly twice, except for exactly two integers both of which appear exactly once.
Your program has to print two 64-bit unsigned integers. The numbers after the first invocation will be given to your program on the second invocation in the same exact order. The numbers after the second invocation should be the answer (order is not important).
1 5 5 1 4 4 5
1 736
2 3 1 736 9 9 3
1 3