hdoj 5210 Delete 【水题】
来源:互联网 发布:ios运行windows程序 编辑:程序博客网 时间:2024/06/05 18:47
题目链接:hdoj 5210 Delete
Delete
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 1049 Accepted Submission(s): 509
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
#include <cstdio>#include <iostream>#include <algorithm>#include <cstring>#define CLR(a, b) memset(a, (b), sizeof(a))using namespace std;typedef long long LL;const int INF = 0x3f3f3f3f;const int MAXN = 1e5 + 10;bool vis[110];int main(){ int n; while(scanf("%d", &n) != EOF) { CLR(vis, false); int sum1 = 0, sum2 = 0; for(int i = 0; i < n; i++) { int v; scanf("%d", &v); if(!vis[v]) { sum1++; vis[v] = true; } else { sum2++; } } int k; scanf("%d", &k); int ans; if(k <= sum2) { ans = sum1; } else { k -= sum2; ans = sum1 - k; } printf("%d\n", ans); } return 0;}
0 0
- hdoj 5210 Delete 【水题】
- Hdoj 5210 Delete 【水】
- HDU ACM 5210 Delete 水题
- 水题hdoj-2000、hdoj-2002、hdoj-2003、hdoj-2004
- hdu 5210 Delete
- HDU-5210-Delete(Oier)
- HDU 5210 Delete
- hdu 5210 Delete
- HDU 5210 DELETE
- HDU 5210 Delete
- HDU 5210 Delete
- hdu 5210 Delete
- DELETE
- delete
- delete
- DELETE
- delete
- delete
- Appium API介绍
- 重写Salesforce Attachment上传页面
- EditText动态添加图片-----SpannableString来设置超链接、颜色、字体、图片属性
- 6. MySQL数据文件介绍及存放位置
- 【BZOJ 1232】 【Usaco 2008 Nov】安慰奶牛cheer
- hdoj 5210 Delete 【水题】
- Spring事务属性详解
- HighCharts自定义坐标轴刻度
- Android自定义数据库异步操作
- HDU 4742 Pinball Game 3D(CDQ分治)
- AFNetworking 2.0到3.0 迁移指南
- 5.3.1.2 smtpd_check_*函数的ACL验证方法
- Kafka深度解析
- iOS 开发库