Permutation Check

AtCoder
IDabc205_b
Time2000ms
Memory256MB
Difficulty
You are given a sequence of $N$ integers between $1$ and $N$ (inclusive): $A = (A_1, A_2, \dots, A_N)$. Determine whether $A$ is a permutation of $(1, 2, \dots, N)$. ## Constraints * $1 \leq N \leq 10^3$ * $1 \leq A_i \leq N$ * All values in input are integers. ## Input Input is given from Standard Input in the following format: $N$ $A_1$ $A_2$ $\ldots$ $A_N$ [samples]
Samples
Input #1
5
3 1 2 4 5
Output #1
Yes

$(3, 1, 2, 4, 5)$ is a permutation of $(1, 2, 3, 4, 5)$, so we should print `Yes`.
Input #2
6
3 1 4 1 5 2
Output #2
No

$(3, 1, 4, 1, 5, 2)$ is not a permutation of $(1, 2, 3, 4, 5, 6)$, so we should print `No`.
Input #3
3
1 2 3
Output #3
Yes
Input #4
1
1
Output #4
Yes
API Response (JSON)
{
  "problem": {
    "name": "Permutation Check",
    "description": {
      "content": "You are given a sequence of $N$ integers between $1$ and $N$ (inclusive): $A = (A_1, A_2, \\dots, A_N)$. Determine whether $A$ is a permutation of $(1, 2, \\dots, 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": "abc205_b"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You are given a sequence of $N$ integers between $1$ and $N$ (inclusive): $A = (A_1, A_2, \\dots, A_N)$.\nDetermine whether $A$ is a permutation of $(1, 2, \\dots, N)$.\n\n## Constraints\n\n*   $1 \\leq N \\le...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments