1 Star 0 Fork 0

匿名者/C++高阶

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
pta.L1-034点赞.cpp 517 Bytes
Copy Edit Raw Blame History
匿名者 authored 2024-04-15 09:21 . pta点赞
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int n;
int ans[1005];
int ret ;
int main()
{
cin>>n;
while(n--)
{
cin>>ret;
while(ret--)
{
int a;
cin>>a;
ans[a]++;
}
}
int _Max =0;
int opj=0;
for(int i=1;i<1001;i++)
{
if(ans[i]>=_Max)
{
_Max = ans[i];
opj =i;
}
}
cout << opj << " " << _Max;
return 0;
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/adexiur/c-higher-order.git
git@gitee.com:adexiur/c-higher-order.git
adexiur
c-higher-order
C++高阶
master

Search