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

33371번 - Bit Component 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB216630.000%

문제

Denis really likes binary representation of numbers. Once he wrote down binary representations of numbers from 1ドル$ to 7ドル,ドル in some order, one under the other, so that their rightmost digits were aligned. Then he realized that the ones in these numbers form a single connected region: if we consider the places for digits as squares on a grid, all squares containing ones are connected by sides. Now he wonders if the same thing can be done for numbers from 1ドル$ to $n$ for different $n$.

You are given an integer $n$. You should find a good permutation of all integers from 1ドル$ to $n,ドル or determine that there is no such permutation. A permutation is good if, when we write the numbers down as described above, the ones form a single connected region.

입력

The only line contains a single integer $n$ (1ドル \leq n \leq 2 \cdot 10^5$).

출력

If there is no good permutation of numbers from 1ドル$ to $n,ドル print a single line with the word "NO" (uppercase). Otherwise, print a line with the word "YES" (uppercase), and then another line containing the good permutation you found. If there are several possible answers, print any one of them.

제한

예제 입력 1

1

예제 출력 1

YES
1

예제 입력 2

2

예제 출력 2

NO

예제 입력 3

3

예제 출력 3

YES
2 3 1

노트

Third example

출처

Camp > Petrozavodsk Programming Camp > Summer 2023 > Day 5: Moscow IPT Yolki-Palki Contest 1 B번

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

출처

대학교 대회

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

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