编程介的小学生 2017-01-30 14:48 采纳率: 20.5%
浏览 858
已采纳

Delete

Problem Description
WLD likes playing with numbers. One day he is playing with N integers. He wants to delete K integers from them. He likes diversity, so he wants to keep the kinds of different integers as many as possible after the deletion. But he is busy pushing, can you help him?

Input
There are Multiple Cases. (At MOST 100)

For each case:

The first line contains one integer N(0
The second line contains N integers a1,a2,...,aN(1≤ai≤N), denoting the integers WLD plays with.

The third line contains one integer K(0≤K

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.

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-02-06 15:45
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 vmware exsi重置后登不上
  • ¥15 易盾点选的cb参数怎么解啊
  • ¥15 MATLAB运行显示错误,如何解决?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
  • ¥20 yolov5自定义Prune报错,如何解决?
  • ¥15 电磁场的matlab仿真
  • ¥15 mars2d在vue3中的引入问题
  • ¥50 h5唤醒支付宝并跳转至向小荷包转账界面