PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#CC0000001. Đếm số giá trị khác nhau (Distinct Numbers)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Đếm số giá trị khác nhau (Distinct Numbers)
Distinct Numbers
Source: CSES Version: Phuoc Hung OJ Extended
Problem Statement
You are given a sequence of integers. Some numbers may occur repeatedly. Determine how many different values appear; count each value only once.
Input
The first line contains . The next line contains integers .
Output
Print one integer: the count of distinct values.
Subtasks
- Subtask 1 (20 points): ; .
- Subtask 2 (30 points): ; .
- Subtask 3 (50 points): ; .
Examples
Input
7
5 2 5 9 2 8 9
Output
4
Explanation
The four distinct values are .