1 solutions

  • 0
    @ 2022-8-28 19:13:37

    这道题其实没有什么的,就是考验思维,感觉没什么好说的直接看代码吧

    #include<bits/stdc++.h>
    using namespace std;
    
    typedef long long ll;
    #define lowbits(x) ((-x)&x)
    
    const int N = 1e7+5;
    
    int pp[N],mp[N];
    
    int main()
    {
    	int n,m,p;
    	scanf("%d %d %d",&n,&m,&p);
    	for(int i=1; i<=n; i++){
    		scanf("%d",&mp[i]);
    		for(int j=1; j<=mp[i]; j++){
    			int x;
    			scanf("%d",&x);
    			pp[x]++;
    		}
    	}
    	int ans=0;
    	for(int i=1;i<=m;i++)
    	{
    		if(pp[i]==p){
    		ans++;
    		}
    	}
    	cout<<ans<<endl;
    	for(int i=1;i<=m;i++)
    	{
    		if(pp[i]==p){
    			cout<<i<<" ";
    		}
    	}
    	return 0;
    }
    
    • 1

    Information

    ID
    6538
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    7
    Tags
    (None)
    # Submissions
    69
    Accepted
    15
    Uploaded By