[GESP202509 一级] 金字塔

Luogu
IDLGB4410
Time1000ms
Memory512MB
DifficultyP1
2025循环结构GESP
金字塔由 $n$ 层石块垒成。从塔底向上,每层依次需要 $n \times n, (n-1) \times (n-1), \cdots, 2 \times 2, 1 \times 1$ 块石块。请问搭建金字塔总共需要多少块石块? ## Input 一行,一个正整数 $n$,表示金字塔的层数。 ## Output 一行,一个正整数,表示搭建金字塔所需的石块数量。 [samples] ## Background 对应的选择、判断题:<https://ti.luogu.com.cn/problemset/1189> ## Note 对于所有测试点,保证 $1 \leq n \leq 50$。
Samples
Input #1
2
Output #1
5
Input #2
5
Output #2
55
API Response (JSON)
{
  "problem": {
    "name": "[GESP202509 一级] 金字塔",
    "description": {
      "content": "金字塔由 $n$ 层石块垒成。从塔底向上,每层依次需要 $n \\times n, (n-1) \\times (n-1), \\cdots, 2 \\times 2, 1 \\times 1$ 块石块。请问搭建金字塔总共需要多少块石块?",
      "description_type": "Markdown"
    },
    "platform": "Luogu",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 524288
    },
    "difficulty": {
      "LuoguStyle": "P1"
    },
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "LGB4410"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "金字塔由 $n$ 层石块垒成。从塔底向上,每层依次需要 $n \\times n, (n-1) \\times (n-1), \\cdots, 2 \\times 2, 1 \\times 1$ 块石块。请问搭建金字塔总共需要多少块石块?\n\n## Input\n\n一行,一个正整数 $n$,表示金字塔的层数。\n\n## Output\n\n一行,一个正整数,表示搭建金字塔所需的石块数量。\n\n[samples]\n\n##...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments