原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=5210 
简单题如下:

 #include<algorithm>
#include<iostream>
#include<cstdlib>
#include<cstdio>
using std::sort;
const int Max_N = ;
int arr[Max_N];
int main() {
#ifdef LOCAL
freopen("in.txt", "r", stdin);
freopen("out.txt", "w+", stdout);
#endif
int n, k, tot, ret, cnt;
while (~scanf("%d", &n)) {
tot = ;
for (int i = ; i < n; i++) scanf("%d", &arr[i]);
scanf("%d", &k);
sort(arr, arr + n);
for (int i = ; i < n;) {
ret = arr[i], cnt = ;
for (; ret == arr[i]; i++) cnt++;
tot++;
}
if (n - tot <= k) printf("%d\n", n - k);
else printf("%d\n", tot);
}
return ;
}

hdu 5210 Delete的更多相关文章

  1. hdu 5210 delete 水题

    Delete Time Limit: 1 Sec  Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5210 D ...

  2. BestCoder Round #39

    -------好久没更新博客了,发现还是需要不断总结才能进步,所以还是把最近打的一些比赛记录一下. T1:Delete (hdu 5210) 题目大意: 给出n个数,然后要删掉k个,要求剩下的数中 不 ...

  3. HDU 1892 See you~ (二维树状数组)

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=1892 See you~ Problem Description Now I am leaving h ...

  4. HDU 5458 Stability(双连通分量+LCA+并查集+树状数组)(2015 ACM/ICPC Asia Regional Shenyang Online)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5458 Problem Description Given an undirected connecte ...

  5. hdu 3695:Computer Virus on Planet Pandora(AC自动机,入门题)

    Computer Virus on Planet Pandora Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 256000/1280 ...

  6. hdu 2177 取(2堆)石子游戏(威佐夫博奕)

    题目链接:hdu 2177 这题不是普通的 Nim 博弈,我想它应该是另一种博弈吧,于是便推 sg 函数打了个 20*20 的表来看,为了方便看一些,我用颜色作了标记,打表代码如下: #include ...

  7. [题解]hdu 1009 FatMouse' Trade(贪心基础题)

    Problem Description FatMouse prepared M pounds of cat food, ready to trade with the cats guarding th ...

  8. hdu 3999 The order of a Tree (二叉搜索树)

    /****************************************************************** 题目: The order of a Tree(hdu 3999 ...

  9. 数据结构--AC自动机--hdu 2896

    病毒侵袭 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submi ...

随机推荐

  1. tar: 从成员名中删除开头的“/”

    在压缩文件时,当后面的备份目录使用绝对路径时,会出现: tar zcvf   /usr/OutFile.tar.gz  /data/CTest tar: 从成员名中删除开头的“/” 此时,对tar增加 ...

  2. myeclipse的一些设置

    常用快捷键 Ctrl + Shift + R 搜索文件Ctrl + Shift + T 搜索类型Ctrl + O 搜索成员   智能提示 Windows > Preferences > G ...

  3. 雷兽的数据库CAP乱谈之(一)阐述

    今天有人问我cap,找了https://my.oschina.net/lilw/blog/169776这片文字, 下面是cap那篇文字的解释: 所谓CAP理论,即: Cosistency       ...

  4. 尝试自己建立以alpine 为基础的docker基础镜像和组件镜像

    安装ubuntu14.04 然后 #获取root权限 sudo su #安装docker apt-get install docker #准备基础镜像 docker pull alpine docke ...

  5. Symantec System Recovery

    目的:备份系统,备份文件,裸机恢复,异机恢复等 工具:http://bbs.kafan.cn/thread-1800182-1-1.html 下载地址:http://pan.baidu.com/s/1 ...

  6. sql关联excel查询

    select * from 表名 where 字段名 in (SELECT excel列名 FROM OpenDataSource( 'Microsoft.Jet.OLEDB.4.0','Data S ...

  7. IIS FTP文件服务器搭建步骤

    利用IIS搭建需要验证用户用的FTP服务器(当然也可以不用验证,为了安全,添加验证) 1.C盘下创建文件夹,iftppub 2.打开关闭Windows功能,Internet信息服务全选,操作完后,重启 ...

  8. ubuntu下使用apt-get install安装的软件在哪个目录

    形如 apt-get install apps 这样的命令,一般会将下载文件放在 /var/cache/apt/archives目录下,然后安装. 如果不及时清理,这个目录所占空间会越来越大,幸运的是 ...

  9. 二十一、contextMap中放的常用数据

    二十一.contextMap中放的常用数据 request:请求范围的数据.即ServletRequest中的那个Map parameters:请求参数的数据.即request.getParamete ...

  10. javaSE第九天

      第九天    50 1. final关键字(掌握)    50 (1)定义:    50 (2)特点:    51 (3)面试相关:    51 A:final修饰的局部变量    51 B:fi ...