A Recursive Function

AtCoder
IDabc273_a
Time2000ms
Memory256MB
Difficulty
A function $f(x)$ defined for non-negative integer $x$ satisfies the following conditions: * $f(0) = 1$; * $f(k) = k \times f(k-1)$ for all positive integers $k$. Find $f(N)$. ## Constraints * $N$ is an integer such that $0 \le N \le 10$. ## Input The input is given from Standard Input in the following format: $N$ [samples]
Samples
Input #1
2
Output #1
2

We have $f(2) = 2 \times f(1) = 2 \times 1 \times f(0) = 2 \times 1 \times 1 = 2$.
Input #2
3
Output #2
6

We have $f(3) = 3 \times f(2) = 3 \times 2 = 6$.
Input #3
0
Output #3
1
Input #4
10
Output #4
3628800
API Response (JSON)
{
  "problem": {
    "name": "A Recursive Function",
    "description": {
      "content": "A function $f(x)$ defined for non-negative integer $x$ satisfies the following conditions: *   $f(0) = 1$; *   $f(k) = k \\times f(k-1)$ for all positive integers $k$. Find $f(N)$.",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc273_a"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "A function $f(x)$ defined for non-negative integer $x$ satisfies the following conditions:\n\n*   $f(0) = 1$;\n*   $f(k) = k \\times f(k-1)$ for all positive integers $k$.\n\nFind $f(N)$.\n\n## Constraints\n\n*...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments