[HdOJ]1800 Flying to the Mars
来源:互联网 发布:java list<> 编辑:程序博客网 时间:2024/04/27 17:56
#include <stdio.h>#include <algorithm>using namespace std;int main(){ long int a[3010]; int n,i,count,max; while(scanf("%d",&n)!=EOF) { max=1; for(i=0;i<n;i++) { scanf("%ld",&a[i]); } sort(a,a+n); count=1; for(i=0;i<n-1;i++) // 只进行一次循环就可以找出相同数字的个数了 小心越界 { if(a[i]<a[i+1]) { count=1; } else { count++; } max=max>count?max:count; } printf("%d\n",max); } return 0;}
找出相同的数字最多有多少个
0 0
- HDOJ 1800 Flying to the Mars hash
- hdoj 1800 Flying to the Mars 【贪心】
- HDOJ 1800 Flying to the Mars
- [HdOJ]1800 Flying to the Mars
- hdoj 1800 Flying to the Mars【贪心】
- HDOJ 1800 Flying to the Mars
- hdoj 1800 (Flying to the Mars)
- HDOJ--1800Flying to the Mars!!贪心
- HDOJ Flying to the Mars
- hdoj 1800 Flying to the Mars (字符串哈希函数)
- HDU/HDOJ 1800 Flying to the Mars 搜索
- HDOJ 1800 Flying to the Mars 盲目搜索......................so easy...........
- hdoj 1800 Flying to the Mars 【动态规划】
- HDOJ 1800 Flying to the Mars(LIS)
- hdoj Flying to the Mars 1800 (DP)
- hdoj-1800-Flying to the Mars ELFhash模板
- HDOJ.1800 Flying to the Mars(贪心+map)
- 1800 Flying to the Mars
- 自定义ListView盘点-PullToZoomInListView(29)
- js中的逻辑或(||)操作
- iOS The file “XXX” couldn’t be opened because you don’t have permission to view it.
- Android基于XMPP Smack openfire 开发的聊天室
- 关于MyEclipse集成Maven,在Maven Dependencies 出现tools.jar miss错误解决办法
- [HdOJ]1800 Flying to the Mars
- (513B1)codeforce
- 百度Cafe原理--Android自动化测试学习历程
- 本命年展望
- Android消除Toast延迟显示
- PHP安全方面经常用到的
- Storage框架整理
- 欢迎使用CSDN-markdown编辑器
- Android简洁的ViewHolder写法的一点优化