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

33443번 - Deep Abyss 다국어

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

문제

Kieray has a hash function $h(x)$. She wants you to help her find a fixed point $x_0$ of $h,ドル such that $h(x_0) = x_0$.

입력

The input contains the description of $h(x)$.

The function $h(x)$ is described by a procedure in Frog language. In this language, variables (for example, $x,ドル $y,ドル $z$) are 128-bit unsigned integers. At the beginning, the variable $x$ contains the input value to $h,ドル and the other variables are all initialized to zeroes. The result of $h(x)$ is the value of variable $x$ after the execution of the procedure.

The procedure contains at most 500 lines. Each line is an assignment that stores the result of an expression into a variable. Frog language supports bitwise negation (~), and (&), or (|), xor (^), and left/right shifting (<</>>). The semantics of these operations are similar to those in C/C++.

Each assignment contains at most one binary operation. (Hexa)decimal constant numbers are allowed in expressions. The bitwise negation (~) can be applied to each variable or constant at most once. Every expression except bitwise xor expression (^) contains at most one variable. The shift amount (right operand) of a shifting operation is non-negative and not greater than 128.

Here is the extended BNF specification of the Frog language:

Note: "*" means the preceding token appears zero or more times, and "{1,4}" means the preceding token appears one to four times. The symbol "" represents a single space character.

출력

Print the fixed point of $h(x)$ in hexadecimal without leading zeroes, conforming to the format of Hexadecimal in the extended BNF specification. If there are multiple fixed points, print the minimum one. If there is no fixed point, print ":(" (without quotes) instead.

제한

예제 입력 1

x = x | 0x19260817

예제 출력 1

0x19260817

예제 입력 2

x = x ^ 0xdeadbeef

예제 출력 2

:(

예제 입력 3

y = ~x << 3
z = ~x >> 2
w = x & ~0xa
k = ~x ^ 0xc
k = k << 1
k = k >> 2
x = y ^ z
p = k ^ w
x = x ^ p

예제 출력 3

0x9a83dcd41ee6a0f73507b9a83dcd41ef

예제 입력 4

x = x | 0x1
x = x << 128

예제 출력 4

0x0

노트

This is an illustration from Kieray. It's lovely.

출처

Camp > Petrozavodsk Programming Camp > Winter 2024 > Day 4: Peking U Contest 2 D번

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

출처

대학교 대회

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

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