[GESP202306 一级] 累计相加

Luogu
IDLGB3839
Time1000ms
Memory128MB
DifficultyP1
数学2023循环结构GESP
输入一个正整数 $n$,求形如: $1+(1+2)+(1+2+3)+(1+2+3+4)+ \cdots +(1+2+3+4+5+ \cdots +n)$ 的累计相加。 ## Input 输入一个正整数 $n$。约定 $1<n \le 100$。 ## Output 输出累计相加的结果。 [samples] ## Background 对应的选择、判断题:<https://ti.luogu.com.cn/problemset/1123>
Samples
Input #1
3
Output #1
10
Input #2
4
Output #2
20
Input #3
10
Output #3
220
API Response (JSON)
{
  "problem": {
    "name": "[GESP202306 一级] 累计相加",
    "description": {
      "content": "输入一个正整数 $n$,求形如: $1+(1+2)+(1+2+3)+(1+2+3+4)+ \\cdots  +(1+2+3+4+5+ \\cdots  +n)$ 的累计相加。",
      "description_type": "Markdown"
    },
    "platform": "Luogu",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 131072
    },
    "difficulty": {
      "LuoguStyle": "P1"
    },
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "LGB3839"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "输入一个正整数 $n$,求形如:\n\n$1+(1+2)+(1+2+3)+(1+2+3+4)+ \\cdots  +(1+2+3+4+5+ \\cdots  +n)$ 的累计相加。\n\n## Input\n\n输入一个正整数 $n$。约定 $1<n \\le 100$。\n\n## Output\n\n输出累计相加的结果。\n\n[samples]\n\n## Background\n\n对应的选择、判断题:<https://ti....",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments