Count Distinct Integers

AtCoder
IDabc240_b
Time2000ms
Memory256MB
Difficulty
In a sequence of $N$ positive integers $a = (a_1, a_2, \dots, a_N)$, how many different integers are there? ## Constraints * $1 \leq N \leq 1000$ * $1 \leq a_i \leq 10^9 \, (1 \leq i \leq N)$ * All values in input are integers. ## Input Input is given from Standard Input in the following format: $N$ $a_1$ $\ldots$ $a_N$ [samples]
Samples
Input #1
6
1 4 1 2 2 1
Output #1
3

There are three different integers: $1, 2, 4$.
Input #2
1
1
Output #2
1
Input #3
11
3 1 4 1 5 9 2 6 5 3 5
Output #3
7
API Response (JSON)
{
  "problem": {
    "name": "Count Distinct Integers",
    "description": {
      "content": "In a sequence of $N$ positive integers $a = (a_1, a_2, \\dots, a_N)$, how many different integers are there?",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc240_b"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "In a sequence of $N$ positive integers $a = (a_1, a_2, \\dots, a_N)$, how many different integers are there?\n\n## Constraints\n\n*   $1 \\leq N \\leq 1000$\n*   $1 \\leq a_i \\leq 10^9 \\, (1 \\leq i \\leq N)$\n* ...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments