159. Maximum Value in Pascal's Triangle

Codeforces
IDCF10269159
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
Pascal's Triangle is a famous concept in mathematics, and it has proven to have incredible relevance in many fields of mathematics even hundreds of years after its creation. The triangle is very simple to construct, starting out with just the number one centered on the first line of a sheet of paper. On the second line, write two ones centered just to the left and right of the one above. For any given line on the triangle, a value is found by adding the value to the upper right and upper left of the specified point, even if the upper right or upper left doesn't exist(meaning the specified point is on the edge of the triangle). Values on the edge of the triangle will always be 1. Your task for this problem is to find the maximum value on a given line of pascal's triangle(with the top line being 0). A single integer that represents the line of pascal's triangle(with the top line being 0) to have the maximum found for. A single integer that represents the maximum value on the given line of Pascal's Triangle. If you are struggling with figuring this task out, take a look at binomial coefficients. ## Input A single integer that represents the line of pascal's triangle(with the top line being 0) to have the maximum found for. ## Output A single integer that represents the maximum value on the given line of Pascal's Triangle. [samples] ## Note If you are struggling with figuring this task out, take a look at binomial coefficients.
**Definitions** Let $ n \in \mathbb{Z}_{\geq 0} $ denote the row index of Pascal’s Triangle (with top row being row 0). **Constraints** $ n \geq 0 $ **Objective** Find the maximum value in row $ n $ of Pascal’s Triangle, where the entries are binomial coefficients $ \binom{n}{k} $ for $ k = 0, 1, \dots, n $. $$ \max_{0 \leq k \leq n} \binom{n}{k} $$
API Response (JSON)
{
  "problem": {
    "name": "159. Maximum Value in Pascal's Triangle",
    "description": {
      "content": "Pascal's Triangle is a famous concept in mathematics, and it has proven to have incredible relevance in many fields of mathematics even hundreds of years after its creation. The triangle is very simpl",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10269159"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Pascal's Triangle is a famous concept in mathematics, and it has proven to have incredible relevance in many fields of mathematics even hundreds of years after its creation. The triangle is very simpl...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ n \\in \\mathbb{Z}_{\\geq 0} $ denote the row index of Pascal’s Triangle (with top row being row 0).  \n\n**Constraints**  \n$ n \\geq 0 $  \n\n**Objective**  \nFind the maximum value in...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments