当前位置:网站首页>7-8 likes (need to continue to improve)
7-8 likes (need to continue to improve)
2022-07-06 16:44:00 【HBUcs2020】
The subject is very simple , But I feel the program is too complicated , The complexity of time and space is too high
Take a note of it , Find a better way to modify

#include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
int a[1001]={0};
while(n--)
{
int k;
cin>>k;
while(k--)
{
int num;
cin>>num;
a[num]++;
}
}
int max=-1,maxnum;
for(int i=1;i<=1000;i++)
{
// printf("%d ",a[2]);
if(a[i]>=max)
{
maxnum=i;
max=a[i];
// printf(" The number of times is %d ",max);
}
}
printf("%d %d",maxnum,max);
return 0;
}边栏推荐
- (lightoj - 1369) answering queries (thinking)
- LeetCode 1562. Find the latest group of size M
- Local visualization tools are connected to redis of Alibaba cloud CentOS server
- Simple records of business system migration from Oracle to opengauss database
- Basic principles of video compression coding and audio compression coding
- Acwing: the 56th weekly match
- 本地可视化工具连接阿里云centOS服务器的redis
- OneForAll安装使用
- (POJ - 3186) treatments for the cows (interval DP)
- Raspberry pie 4B installation opencv3.4.0
猜你喜欢

第五章 Yarn资源调度器

Install Jupiter notebook under Anaconda

Advancedinstaller installation package custom action open file

Solve the problem that intel12 generation core CPU single thread only runs on small cores

视频压缩编码和音频压缩编码基本原理

第三章 MapReduce框架原理

Codeforces Round #802(Div. 2)A~D

Raspberry pie 4B installation opencv3.4.0

sublime text 代码格式化操作

使用jq实现全选 反选 和全不选-冯浩的博客
随机推荐
Study notes of Tutu - process
Chapter 6 rebalance details
Codeforces Global Round 19
Market trend report, technological innovation and market forecast of double door and multi door refrigerators in China
两个礼拜速成软考中级软件设计师经验
简单尝试DeepFaceLab(DeepFake)的新AMP模型
Chapter 5 namenode and secondarynamenode
LeetCode 1984. Minimum difference in student scores
【锟斤拷】的故事:谈谈汉字编码和常用字符集
Research Report on market supply and demand and strategy of Chinese table lamp industry
第6章 Rebalance详解
< li> dot style list style type
One hundred questions of image processing (11-20)
Remove the border when input is focused
QT realizes window topping, topping state switching, and multi window topping priority relationship
Solve the problem that intel12 generation core CPU single thread only runs on small cores
Oneforall installation and use
LeetCode1556. Thousand separated number
How to insert mathematical formulas in CSDN blog
LeetCode 1552. Magnetic force between two balls