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

9883번 - Morton Numbers 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB26917013159.276%

문제

The Morton number of two integers x and y is the integer formed by interleaving the bits of x and y in binary such that the bits of x are in the even position and the bits of y are in the odd position.

If we consider x and y to represent the 2D coordinates of a point, then the Morton numbers have the property that if two points are close to each other, then their respective Morton numbers will also be close to one another. Furthermore the Morton numbers are proportional to x and y.

In the problem, you will be given two integers x and y in base 10 (0 ≤ x, y ≤ 216 - 1) and you should return the Morton number of x and y in base 10.

For example if x = 4 and y = 5, then x = 0000000000000100 and y = 0000000000000101 in binary. Hence the Morton number of x and y is 00000000000000000000000000110001 in binary which is equivalent to 49. Note that the bits in bold represents the bits from x.

입력

The input consists of the two integers, x and y, on the same line separated by whitespace.

출력

Output the Morton number of x and y.

제한

예제 입력 1

4 5

예제 출력 1

49

힌트

출처

Olympiad > National Olympiad in Informatics (Singapore) > NOI 2006 연습 세션 P1번

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

출처

대학교 대회

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

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