060. Maximum Number

Codeforces
IDCF10269060
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
Find the largest possible number that can be stored with N bits. Assume that the number is a signed integer value. Remember that the maximum value possible with a certain number of bits can be calculated with the formula $2^(N -1) -1$. When solving this problem, keep in mind that if the input is greater than 32, your programming language may not have large enough integers, so you will need to use larger variable types or arbitrary precision arithmetic. Arbitrary-precision arithmetic comes with most programming languages, for example the BigInteger class in Java. An Integer N ranging from 1 to 64. An Integer representing the largest possible number within the given bit size. Be careful of floating point precision errors, and be sure that your output does not print output by a power of ten, e.g. 9.77E13. ## Input An Integer N ranging from 1 to 64. ## Output An Integer representing the largest possible number within the given bit size. [samples] ## Note Be careful of floating point precision errors, and be sure that your output does not print output by a power of ten, e.g. 9.77E13.
**Definitions** Let $ N \in \mathbb{Z} $ be the number of bits, with $ 1 \leq N \leq 64 $. **Constraints** $ 1 \leq N \leq 64 $ **Objective** Compute the maximum value of a signed $ N $-bit integer: $$ 2^{N-1} - 1 $$
API Response (JSON)
{
  "problem": {
    "name": "060. Maximum Number",
    "description": {
      "content": "Find the largest possible number that can be stored with N bits. Assume that the number is a signed integer value. Remember that the maximum value possible with a certain number of bits can be calcula",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10269060"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Find the largest possible number that can be stored with N bits. Assume that the number is a signed integer value. Remember that the maximum value possible with a certain number of bits can be calcula...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ N \\in \\mathbb{Z} $ be the number of bits, with $ 1 \\leq N \\leq 64 $.\n\n**Constraints**  \n$ 1 \\leq N \\leq 64 $\n\n**Objective**  \nCompute the maximum value of a signed $ N $-bit in...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments