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

19260번 - DotA Quals 스페셜 저지다국어

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

문제

Today, instead of studying for the coming exams, a student with a nickname "Idned" has decided to take part in an open qualification for a huge DotA (Development of the Algorithms) tournament. The qualification is going to be a single-elimination tournament with 2ドル^n$ participants, and Idned is one of them. There will be $n$ rounds in total. All other remaining participants will be randomly divided into pairs for each round with equal chances for any possible division. In each pair, the participants will play against each other, and the loser will quit the tournament (and will not participate in the further rounds).

Each participant has a unique rating, and Idned's rating is $k$-th highest. Idned is sure that the outcome of each game is fully determined by the ratings of two participants, and whoever has a higher rating will win. Using this assumption, can you determine the expected number of rounds in which Idned will take part?

입력

The input contains two integers $n$ and $k$: the total number of rounds and Idned's position in the overall rating (1ドル \le n \le 10$; 1ドル \le k \le 2^n$).

출력

Output the expected number of rounds.

Your answer must be correct to within an absolute or relative error of 10ドル^{-9}$. Formally, let your answer be $a,ドル and the jury's answer be $b$. Your answer will be considered correct if $\frac{|a-b|}{\max(1, |b|)} \le 10^{-9}$.

제한

예제 입력 1

2 2

예제 출력 1

1.666666666667

예제 입력 2

3 5

예제 출력 2

1.457142857143

힌트

출처

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

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

출처

대학교 대회

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

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