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

19261번 - Enumeration of Tournaments 다국어

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

문제

Suppose that $n$ players participate in a single-elimination tournament. The tournament goes round-by-round. Let $k$ be the number of remaining players at the beginning of the round. Then they will randomly form $[\frac{k}{2}]$ pairs. Any possible partition can be chosen with equal probability. In each pair, two players play against each other, one of them wins, and the loser quits the tournament. The remaining $[\frac{k + 1}{2}]$ advance to the next round.

It is known that each participant has a unique rating, and the outcome of each game is completely determined by the ratings: whoever has higher rating will win. So, the only thing that affects the schedule of the tournament is the random partitions into pairs each round. Can you calculate the number of different tournaments that could occur? Two tournaments are called different if there is a game (between two participants) in one of the tournaments that doesn't occur in the other tournament. As the answer can be rather large, calculate this number modulo 2ドル^{64}$.

입력

The input contains one integer $n$: the initial number of players in the tournament (1ドル \le n \le 10^{18}$).

출력

Output the number of different tournaments modulo 2ドル^{64}$.

제한

예제 입력 1

4

예제 출력 1

3

예제 입력 2

5

예제 출력 2

45

힌트

출처

Camp > Petrozavodsk Programming Camp > Winter 2018 > Day 2: ITMO U 1 Contest E번

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

출처

대학교 대회

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

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