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

21049번 - Coin Stacks 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB257907834.061%

문제

A and B are playing a collaborative game that involves $n$ stacks of coins, numbered from 1ドル$ to $n$. Every round of the game, they select a nonempty stack each, but they are not allowed to choose the same stack. They then remove a coin from both the two selected stacks and then the next round begins.

The players win the game if they manage to remove all the coins. Is it possible for them to win the game, and if it is, how should they play?

입력

The first line of input contains an integer $n$ (2ドル \le n \le 50$), the number of coin stacks. Then follows a line containing $n$ nonnegative integers $a_1, a_2, \ldots, a_n,ドル where $a_i$ is the number of coins in the $i$'th stack. The total number of coins is at most 1ドル,000円$.

출력

If the players can win the game, output a line containing "yes", followed by a description of the moves. Otherwise output a line containing "no". When describing the moves, output one move per line, each move being described by two distinct integers $a$ and $b$ (between 1ドル$ and $n$) indicating that the players remove a coin from stacks $a$ and $b$. If there are several possible solutions, output any one of them.

제한

예제 입력 1

3
1 4 3

예제 출력 1

yes
1 2
2 3
2 3
2 3

예제 입력 2

3
1 1 1

예제 출력 2

no

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Nordic Collegiate Programming Contest > NCPC 2020 C번

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

출처

대학교 대회

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

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