問題一覧 > 通常問題

No.2224 UFO Game

レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (解説公開後に AC するまで非表示) / 解いたユーザー数 285
作問者 : 👑 AngrySadEight / テスター : akakimidori norikame
お気に入りにしたユーザー ProblemId : 8558 / 自分の提出
問題文最終更新日: 2023-01-22 17:06:38
UFO Game
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Show the original
yukicoder contest 378 (順位表) の他の問題:

Problem Statement

Hachiji-kun loves a game in which you earn score by destroying UFOs. Today as well, he is determined to aim for as high a score as possible.

However, in that game, the score display goes wrong if you earn too much score. Specifically, when the value of the score is $T(0 \leq T < 2^{32})$, the score is displayed as follows.

  • If $T < 2^{31}$, the score display is $T$ as it is.
  • If $T \geq 2^{31}$, the score display is $2^{32} - T$ preceded by x.

Now, the score display was $S$. Find the value $T$ of the score at this time.

Constraints

  • $S$ is either an integer or an integer value preceded by x.
  • $0 \leq T < 2^{32}$
  • $T$ is a multiple of $10$.

Input

The input is given from standard input in the following format.

$S$

Output

Output the answer.

Sample

Sample 1
Input
2000000000
Output
2000000000

Since the score is less than $2^{31}$, the score display is the value of the score as it is.

Sample 2
Input
x678048776
Output
3616918520

Since the score is at least $2^{31}$, letting $T$ be the value of the score, the score display is $2^{32}-T$ preceded by x.

Sample 3
Input
x1794967296
Output
2500000000

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。