Hermite 多项式

Luogu
IDLGB2146
Time1000ms
Memory128MB
DifficultyP1
函数与递归
求 Hermite 多项式的值。 $$ h_n(x)=\left\{ \begin{aligned} 1&,&n=0\\ 2x&,&n=1\\ 2xh_{n-1}(x)-2(n-1)h_{n-2}(x)&,& n>1 \end{aligned} \right. $$ 对给定的 $x$ 和正整数 $n$,求多项式的值。 ## Input 输入两个正整数 $n$ 和 $x$ 。 ## Output 求多项式的值。 [samples] ## Note $(n \le 8,x \le 8)$
Samples
Input #1
1 2
Output #1
4
API Response (JSON)
{
  "problem": {
    "name": "Hermite 多项式",
    "description": {
      "content": "求 Hermite 多项式的值。 $$ h_n(x)=\\left\\{ \\begin{aligned} 1&,&n=0\\\\ 2x&,&n=1\\\\ 2xh_{n-1}(x)-2(n-1)h_{n-2}(x)&,& n>1 \\end{aligned} \\right. $$ 对给定的 $x$ 和正整数 $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": "LGB2146"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "求 Hermite 多项式的值。\n\n$$\nh_n(x)=\\left\\{\n\\begin{aligned}\n1&,&n=0\\\\\n2x&,&n=1\\\\\n2xh_{n-1}(x)-2(n-1)h_{n-2}(x)&,& n>1\n\\end{aligned}\n\\right.\n$$\n\n对给定的 $x$ 和正整数 $n$,求多项式的值。\n\n## Input\n\n输入两个正整数 $n$ 和 $x$ 。\n\n## Out...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments