codeforces 862A Mahmoud and Ehab and the MEX
来源:互联网 发布:淘宝毛衣什么材质好 编辑:程序博客网 时间:2024/06/03 20:24
题目大意:构造一个数组,使0到x-1都出现,x不能出现
#include<bits/stdc++.h>using namespace std;int num[110];int main(){int n,x;cin>>n>>x;while(n--){int a;cin>>a;num[a]++;}int ans=0;for(int i=x-1;i>=0;i--){if(!num[i]) ans++;}if(num[x]!=0) ans+=num[x];cout<<ans<<endl;}
阅读全文
0 0
- codeforces 862A Mahmoud and Ehab and the MEX
- codeforces 862A Mahmoud and Ehab and the MEX
- Codeforces 862A Mahmoud and Ehab and the MEX
- codeforces 862A 之 Mahmoud and Ehab and the MEX
- CodeForces 862A Mahmoud and Ehab and the MEX
- Codeforces Round #435 A. Mahmoud and Ehab and the MEX
- Codeforces Round #435 A. Mahmoud and Ehab and the MEX
- Codeforces --- Mahmoud and Ehab and the MEX
- A. Mahmoud and Ehab and the MEX
- 862A. Mahmoud and Ehab and the MEX
- 862A Mahmoud and Ehab and the MEX (水)
- CF 862A. Mahmoud and Ehab and the MEX
- Codeforces Round #435 (Div. 2) A. Mahmoud and Ehab and the MEX(思路)
- Mahmoud and Ehab and the MEX
- Mahmoud and Ehab and the xor CodeForces
- Mahmoud and Ehab and the bipartiteness CodeForces
- Mahmoud and Ehab and the xor CodeForces
- codeforces Mahmoud and Ehab and the bipartiteness
- databinding基本使用
- 【备忘】 绝密资料 达内2017Java全套最新价值2万元视频教程
- [cocos2dx_Lua]quick中的节点事件
- 消息推送的细节回顾
- java 取消文件下载报异常org.mortbay.jetty.EofException
- codeforces 862A Mahmoud and Ehab and the MEX
- Eclipse Maven环境搭建
- python操作数据库
- laya之坑--简单的加载机智 制
- 关闭终端-使jenkins在后台继续执行
- 《C++ Concurrency in Action》笔记10 选择合适的lock粒度
- Memcache 笔记
- 详解Hibernate Session & Transaction
- jsp时间