当前位置:网站首页>CCF-201312-1
CCF-201312-1
2022-07-27 14:45:00 【末世灯光】

#include<iostream>
#include<algorithm>
#include<map>
/*样例输入
6
10 1 10 20 30 20
*/
using namespace std;
int main(){
map<int,int> maps;
int n;cin>>n;//给定n个正整数,自行输入的个数
int number[1000];//定义1000个大小的数组
for(int i=0; i<n; i++){
cin>>number[i];
} //手动输入给定的n个数;
sort(number,number+n);
for(int i=0; i<n; i++){
maps[number[i]]++;
} //将map进行记录
int max = maps[number[0]];
int id = 0;
for(int i = 0; i<n; i++){//查找最大出现次数数字
if(maps[number[i]] > max){
max = maps[number[i]];
id = i;
}
}
cout << number[id];
int k;
cin>>k;
return 0;
}
边栏推荐
- Content ambiguity occurs when using transform:translate()
- Text capture picture (Wallpaper of Nezha's demon child coming to the world)
- How PHP changes a two-dimensional array into a one-dimensional array
- 文本截取图片(哪吒之魔童降世壁纸)
- Pychart imports the existing local installation package
- Scratch crawler framework
- MapReduce instance (I): wordcount
- webRTC中的coturn服务安装
- Common problems of mobile terminal H5
- Time series ARIMA model
猜你喜欢

Leetcode 226 翻转二叉树(递归)

Solve mt7620 continuous cycle uboot (LZMA error 1 - must reset board to recover)

Introduction to JWT

Install MySQL using CentOS yum

Flask connects to existing tables in MySQL database

TP5 paging some small points

Nacos

时间序列——使用tsfresh进行分类任务

Pychart imports the existing local installation package

Mapreduce实例(三):数据去重
随机推荐
The difference and use between get request and post request
Common tool classes under JUC package
SolidWorks simulation curve attribute setting
training on multiple GPUs pytorch
Join hands with sifive, Galanz will enter the semiconductor field! Exposure of two self-developed chips
Personal perception of project optimization
Common problems of mobile terminal H5
Const summary
C channel simply implements the publishing and subscription of message queue
Redis简介与使用
Nacos
闲聊技巧
centos上mysql5.7主从热备设置
大数相加
Introduction to JWT
Security software related to wireless network analysis (airtrack ng)
MapReduce instance (III): data De duplication
Sudden! 28 Chinese entities including Hikvision / Dahua / Shangtang / Kuangshi / ITU / iFLYTEK have been blacklisted by the United States
DRF learning notes (I): Data Serialization
Flume incrementally collects MySQL data to Kafka