Alyona and Mex
来源:互联网 发布:数据分析需要的技能 编辑:程序博客网 时间:2024/06/05 11:50
点击打开链接
题意分析:读懂题意后其实是很水很水的一道题。给定一串数字,每个数字都可以任意变小,再经过任意次变化(也可以不做改变)求在这串数字中缺少的最小的数字的最大值。
错因:题意理解错了
#include<cstdio>#include<string>#include<cstdlib>#include<cmath>#include<iostream>#include<cstring>#include<set>#include<queue>#include<string>#include <algorithm>#include<vector>using namespace std;const int maxn = 100010;int main(){ int a[maxn]; int n,m; scanf("%d",&n); for(int i = 0; i < n; i++) scanf("%d",&a[i]); sort(a, a+n); int ans = 0; for(int i = 0; i < n; i++) { if(a[i] > ans) ans++; } printf("%d\n",ans+1); return 0;}
0 0
- Alyona and Mex
- B. Alyona and Mex
- codeforces739A. Alyona and mex
- codeforces379a Alyona and mex
- codeforce B. Alyona and Mex
- C - Alyona and Mex CF682B
- Codeforces 358 . B Alyona and Mex
- CodeForces 682B Alyona and Mex
- CodeForces 682B Alyona and Mex
- Codeforces Round #381C. Alyona and mex
- Codeforces 739A Alyona and mex(构造)
- 【39.66%】【codeforces 740C】Alyona and mex
- Codeforces #381 C. Alyona and mex
- C. Alyona and mex--思维水题
- CodeForces 740C - Alyona and mex(思维)
- 740C.Alyona and mex codeforces
- CodeForces 682B Alyona and Mex
- Codeforces Round #358 (Div. 2) B. Alyona and Mex
- 大话设计模式c++实现---建造者模式
- 超级星计划
- (Android日常)从.xml中获取数组中的@drawable
- SEO优化
- Irrlicht学习笔记(10)--PerPixelLighting
- Alyona and Mex
- linux xfs和ext4的区别
- TabLayout学习
- Spring的发布处理器(BeanPostProcessor)
- DELPHI获取网卡MAC地址
- E - 排序 Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u
- 【MyBatis框架】mapper配置文件-关于动态sql
- 卷积神经网络
- UVA-123