[NOIP 2007]统计数字
来源:互联网 发布:儿童英语音乐软件 编辑:程序博客网 时间:2024/06/11 12:27
代码
#include <cstdio>#include <iostream>#include <algorithm>using namespace std;int n,a[200005];int main(){ scanf("%d",&n); for(int i=1;i<=n;i++){ scanf("%d",&a[i]); } sort(a+1,a+1+n); int cnt(1); for(int i=1;i<n;i++){ if(a[i+1]!=a[i]){ printf("%d %d\n",a[i],cnt); cnt=0; } cnt++; } if(a[n]!=a[n-1]) { printf("%d %d",a[n],1); }else{ printf("%d %d",a[n],cnt); }}
0 0
- [NOIP 2007]统计数字
- 2007 NOIP 统计数字
- 2007年NOIP提高组 统计数字
- codevs 1164 || NOIP 2007 统计数字 模拟 解题报告
- 07noip 统计数字 解题报告
- 统计数字
- 统计数字
- 统计数字
- 统计数字
- 统计数字
- 统计数字
- 统计数字
- 统计数字
- 统计数字
- 统计数字
- 统计数字
- 2007年分区联赛提高组之一 统计数字
- 2007年分区联赛提高组之一 统计数字
- c++中怎么把string转化为数组
- 网络通信(Telematik)-传输层协议(Transportprotokolle)1
- 逆矩阵在3D游戏向量中的重要作用
- AChartEngine 简介
- Ajax 简介(一)
- [NOIP 2007]统计数字
- LeetCode Implement Stack using Queues 栈&队列
- python 类的继承,内置函数(1)
- 细数JDK里的设计模式
- [NOIP 2005]谁拿了最多奖学金 模拟
- ROC曲线的解释(很形象)
- 蓝懿ioS 技术内容和心得交流 11.1 正反向
- arcGIS Engine控件介绍
- web应用想要达到完全的线程安全,需要注意哪些地方?