No.2224 UFO Game
タグ : / 解いたユーザー数 285
作問者 : 👑
akakimidori
norikame
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
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もしくは右上の雲マークをクリックしてアカウントを作成してください。