当前位置:网站首页>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;
}
边栏推荐
- JS time function Daquan detailed explanation ----- AHAO blog
- 音视频开发面试题
- Pull branch failed, fatal: 'origin/xxx' is not a commit and a branch 'xxx' cannot be created from it
- LeetCode 1562. Find the latest group of size M
- SF smart logistics Campus Technology Challenge (no T4)
- Li Kou leetcode 280 weekly match
- 视频压缩编码和音频压缩编码基本原理
- Research Report on market supply and demand and strategy of double drum magnetic separator industry in China
- China tetrabutyl urea (TBU) market trend report, technical dynamic innovation and market forecast
- MariaDB的安装与配置
猜你喜欢
Spark独立集群Worker和Executor的概念
图像处理一百题(1-10)
Raspberry pie 4b64 bit system installation miniconda (it took a few days to finally solve it)
LeetCode 1557. The minimum number of points that can reach all points
Summary of game theory
CMake速成
Tree of life (tree DP)
解决Intel12代酷睿CPU【小核载满,大核围观】的问题(WIN11)
视频压缩编码和音频压缩编码基本原理
Solve the problem of intel12 generation core CPU [small core full, large core onlookers] (win11)
随机推荐
Tree of life (tree DP)
Educational Codeforces Round 122 (Rated for Div. 2)
Spark的RDD(弹性分布式数据集)返回大结果集
Spark independent cluster dynamic online and offline worker node
LeetCode 1561. The maximum number of coins you can get
(lightoj - 1349) Aladdin and the optimal invitation (greed)
Acwing: the 56th weekly match
Tencent interview algorithm question
Hbuilder x format shortcut key settings
(POJ - 3186) treatments for the cows (interval DP)
我在字节跳动「修电影」
Cmake error: could not create named generator visual studio 16 2019 solution
Market trend report, technical innovation and market forecast of tabletop dishwashers in China
LeetCode1556. Thousand separated number
(lightoj - 1369) answering queries (thinking)
300th weekly match - leetcode
Discussion on QWidget code setting style sheet
第6章 DataNode
Browser print margin, default / borderless, full 1 page A4
Codeforces Global Round 19