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

26204번 - Displacing Particles 다국어

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

문제

A square has its vertices at the coordinates $(0, 0),ドル $(0, 2^N),ドル $(2^N , 2^N ),ドル $(2^N , 0)$. Each vertex has an attractor. A particle is placed initially at position $(2^{N-1} , 2^{N-1})$. Each attractor can be activated individually, any number of times. When an attractor at position $(i, j)$ is activated, if a particle is at position $(p, q),ドル it will be moved to the midpoint between $(i, j)$ and $(p, q)$.

Given $N$ and a point $(x, y),ドル calculate the least number of times you have to activate the attractors so that the particle ends up at position $(x, y)$.

입력

The input consists of a single line containing three integers $N,ドル $x$ and $y,ドル such that 1ドル ≤ N ≤ 20$ and 0ドル < x, y < 2^N$.

출력

Print a single line, containing the least number of times you have to active the attractors.

제한

예제 입력 1

1 1 1

예제 출력 1

0

예제 입력 2

4 12 4

예제 출력 2

1

예제 입력 3

4 3 1

예제 출력 3

3

힌트

출처

ICPC > Regionals > Latin America > Sub-Regional Brasil do ACM ICPC > Maratona de Programação da SBC 2022 D번

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

출처

대학교 대회

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

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