啊巴啊巴啊巴啊巴啊
  • 板块P5886 Hello, 2020!
  • 楼主dtrthg
  • 当前回复3
  • 已保存回复3
  • 发布时间2022/1/24 22:07
  • 上次更新2023/10/28 11:15:28
查看原帖
啊巴啊巴啊巴啊巴啊
379113
dtrthg楼主2022/1/24 22:07

调不动了QaQ

#include <bits/stdc++.h>
using namespace std;
const int Maxn=1e6+10;
int a[Maxn],ans[Maxn];
int main()
{
	int n,m,p;cin>>n>>m>>p; 
	for(int i=1;i<=n;i++)
	{
		int k;cin>>k;
		for(int j=1;j<=k;j++)
		{
			int x;cin>>x;
			a[x]++;
		}
	}//读入
	 
	long long cnt=0;//cnt用于统计获奖总数 
	for(int i=1;i<=m;i++)
	{
		if(a[i]==p) ans[++cnt]=i;
//	如果恰好被提到p次,则获奖总数+1并把获奖人数存入数组ans中 
	}
	cout<<cnt<<endl;
	sort(ans+1,ans+cnt+1);//排序 
	for(int i=1;i<=cnt;i++)
	{
		cout<<ans[i]<<endl;
	}
	return 0;
}
2022/1/24 22:07
加载中...