#P1162. 数组去重
数组去重
Problem Description
给定一个长度为 的数组 ,请你编写一个函数:
int get_unique_count(int a[], int n); // 返回数组前n个数中的不同数的个数
Input Format
第一行包含一个整数 。
第二行包含 个整数,表示数组 。
数据范围
,
。
Output Format
共一行,包含一个整数表示数组中不同数的个数。
5
1 1 2 4 5
4
给定一个长度为 n 的数组 a,请你编写一个函数:
int get_unique_count(int a[], int n); // 返回数组前n个数中的不同数的个数
第一行包含一个整数 n。
第二行包含 n 个整数,表示数组 a。
1≤n≤1000,
1≤ai≤1000。
共一行,包含一个整数表示数组中不同数的个数。
5
1 1 2 4 5
4