当前位置:网站首页>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;
}
边栏推荐
- Kubernetes cluster deployment
- LeetCode 1584. Minimum cost of connecting all points
- Acwing: the 56th weekly match
- CMake Error: Could not create named generator Visual Studio 16 2019解决方法
- Detailed explanation of FLV format
- ByteDance new programmer's growth secret: those glittering treasures mentors
- CMake速成
- OneForAll安装使用
- 提交Spark应用的若干问题记录(sparklauncher with cluster deploy mode)
- MP4格式详解
猜你喜欢
LeetCode 1558. Get the minimum number of function calls of the target array
(lightoj - 1323) billiard balls (thinking)
Native JS realizes the functions of all selection and inverse selection -- Feng Hao's blog
两个礼拜速成软考中级软件设计师经验
Anaconda下安装Jupyter notebook
Log statistics (double pointer)
QT simulates mouse events and realizes clicking, double clicking, moving and dragging
LeetCode 1560. The sector with the most passes on the circular track
使用jq实现全选 反选 和全不选-冯浩的博客
字节跳动新程序员成长秘诀:那些闪闪发光的宝藏mentor们
随机推荐
Two weeks' experience of intermediate software designer in the crash soft exam
Simply try the new amp model of deepfacelab (deepfake)
Installation and configuration of MariaDB
音视频开发面试题
Spark的RDD(弹性分布式数据集)返回大结果集
JS time function Daquan detailed explanation ----- AHAO blog
300th weekly match - leetcode
Basic principles of video compression coding and audio compression coding
Problem - 922D、Robot Vacuum Cleaner - Codeforces
SQL快速入门
875. Leetcode, a banana lover
Market trend report, technological innovation and market forecast of double door and multi door refrigerators in China
Remove the border when input is focused
Study notes of Tutu - process
Spark独立集群动态上线下线Worker节点
One hundred questions of image processing (11-20)
LeetCode 1558. Get the minimum number of function calls of the target array
Advancedinstaller installation package custom action open file
Use JQ to realize the reverse selection of all and no selection at all - Feng Hao's blog
Mp4 format details