Logo
(追記) (追記ここまで)

28181번 - Two Missing Numbers 다국어투 스텝

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 64 MB89302740.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

1 5
5 1 4 4 5

예제 출력 1

1 736

예제 입력 2

2 3 1 736
9 9 3

예제 출력 2

1 3

힌트

출처

Camp > Petrozavodsk Programming Camp > Winter 2023 > Day 5: LOUD Enough Contest 2 D번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /