Output
For each case:
Print one integer. It denotes the maximum of different numbers remain after the deletion.
Sample Input
4
1 3 1 2
1
Sample Output
3
Hint
if WLD deletes a 3, the numbers remain is [1,1,2],he'll get 2 different numbers.
if WLD deletes a 2, the numbers remain is [1,1,3],he'll get 2 different numbers.
if WLD deletes a 1, the numbers remain is [1,2,3],he'll get 3 different numbers.
Source
BestCoder Round #39 ($)
1001 Delete
用一個cnt數組記下每個數在a序列中出現了幾次
在刪數的時候貪心,盡可能刪那些出現次數>1的數
這樣就可以使最後有最多不同的數
#include
#include
#include
#include
#include
#include