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

23373번 - Jack the Mole 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
6.5 초 (추가 시간 없음) 1024 MB192764739.167%

문제

The spy agency you are employed by1 has sent you and some fellow spies on an important mission deep in the jungles of Luxembourg. Your colleagues and you are currently waiting on an abandoned and overgrown airstrip, about to be picked up by the finest spy plane the Dutch bureaucracy can buy.

However, an urgent communication from the HQ has just come in to inform you counterintelligence has learned that during the mission, an infamous counter-spy called Jack the Mole was planted among you! You do a headcount and to your horror realize that while you started the mission with $n-1$ people, there are now $n$!2 Since you all take Covid regulations very seriously, you all wore masks, so it is not obvious who the imposter is.

Then you remember: the finest spy plane in question is thrown off balance rather easily, so the agency picked the $n-1$ agents so that it is possible to divide them into two groups of equal weight, but not necessarily of equal size, for the left and the right side of the plane respectively. However, it did not specify exactly which two groups (anonymity and all that). Of course you have a scale with you (doesn't any good spy?), so you can find which of the $n$ people on the mission is potentially the mole.

1When your family members ask, please lie to them and say you work as a computer programmer.

2Exclamation point, not factorial.

입력

The input consists of:

  • One line containing the number of spies present, $n$ (3ドル \leq n \leq 300$).
  • One line containing $n$ space separated integers $w_1, \ldots, w_n$ (1ドル\leq w_{i} \leq 1000$), the $i$th of which gives the weight of the $i$th spy in kilograms3.

3If those ranges seem odd, recall spies can be very muscular or very nimble.

출력

Output a single number $k,ドル the number of spies that are potentially the mole, followed by $k$ integers, the suspects, in increasing order.

제한

예제 입력 1

3
1 1 2

예제 출력 1

1
3

예제 입력 2

3
1 1 1

예제 출력 2

3
1 2 3

예제 입력 3

5
2 1 3 4 2

예제 출력 3

3
1 4 5

예제 입력 4

5
1 1 1 3 1

예제 출력 4

5
1 2 3 4 5

예제 입력 5

4
2 1 5 3

예제 출력 5

2
2 3

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2021 Preliminaries J번

  • 문제를 만든 사람: Pim Spelier
(追記) (追記ここまで)

출처

대학교 대회

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

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