168. Pascal's Triangle

Codeforces
IDCF10269168
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
First envisioned by the French mathematician, Blaise Pascal, Pascal's Triangle is a formation of numerals that are arranged in such a way that a number composing a part of the triangle is the summation of the adjacent binomial pair of the previous row in the triangle. The only line of input contains a single positive integer $n$. Output $n$ lines. The $i$th line should contain $i$ space-separated integers, consisting of the $i$th row of Pascal's Triangle. ## Input The only line of input contains a single positive integer $n$. ## Output Output $n$ lines. The $i$th line should contain $i$ space-separated integers, consisting of the $i$th row of Pascal's Triangle. [samples]
**Definitions** Let $ n \in \mathbb{Z}^+ $ be the number of rows to generate. For $ i \in \{1, \dots, n\} $, let $ R_i = ( \binom{i-1}{0}, \binom{i-1}{1}, \dots, \binom{i-1}{i-1} ) $ denote the $ i $-th row of Pascal’s Triangle. **Constraints** $ n \geq 1 $ **Objective** For each $ i \in \{1, \dots, n\} $, output the row $ R_i $ as $ i $ space-separated integers: $$ \binom{i-1}{0}, \binom{i-1}{1}, \dots, \binom{i-1}{i-1} $$
API Response (JSON)
{
  "problem": {
    "name": "168. Pascal's Triangle",
    "description": {
      "content": "First envisioned by the French mathematician, Blaise Pascal, Pascal's Triangle is a formation of numerals that are arranged in such a way that a number composing a part of the triangle is the summatio",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10269168"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "First envisioned by the French mathematician, Blaise Pascal, Pascal's Triangle is a formation of numerals that are arranged in such a way that a number composing a part of the triangle is the summatio...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ n \\in \\mathbb{Z}^+ $ be the number of rows to generate.  \nFor $ i \\in \\{1, \\dots, n\\} $, let $ R_i = ( \\binom{i-1}{0}, \\binom{i-1}{1}, \\dots, \\binom{i-1}{i-1} ) $ denote the $ ...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments