102401: [AtCoder]ABC240 B - Count Distinct Integers

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Score : $200$ points

Problem Statement

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$

Output

Print the answer.


Sample Input 1

6
1 4 1 2 2 1

Sample Output 1

3

There are three different integers: $1, 2, 4$.


Sample Input 2

1
1

Sample Output 2

1

Sample Input 3

11
3 1 4 1 5 9 2 6 5 3 5

Sample Output 3

7

Input

题意翻译

给你一个正整数序列,求里面出现了几种正整数

Output

得分:200分

问题描述

在一个由正整数构成的序列$a = (a_1, a_2, \dots, a_N)$中,有多少个不同的整数?

限制条件

  • $1 \leq N \leq 1000$
  • $1 \leq a_i \leq 10^9 \, (1 \leq i \leq N)$
  • 输入中的所有值都是整数。

输入

从标准输入以以下格式获取输入:

$N$
$a_1$ $\ldots$ $a_N$

输出

打印答案。


样例输入1

6
1 4 1 2 2 1

样例输出1

3

有三个不同的整数:$1, 2, 4$。


样例输入2

1
1

样例输出2

1

样例输入3

11
3 1 4 1 5 9 2 6 5 3 5

样例输出3

7

加入题单

算法标签: