L1-020 帅到没朋友

 

坑点:

        输出应为 5 个数字,不足 5 个前面补 0 ;

        K 为 1 时,ID 号没有作用。

 

#include<bits/stdc++.h>
using namespace std;

map<int,int> ma;

int main()
{
	int n,t,x,m,k=0;
	cin>>t;
	while(t--){
		cin>>n;
		for(int i=0;i<n;i++){
			cin>>x;
			if(n!=1) ma[x]++;
		}
	}
	cin>>m;
	while(m--){ 
		cin>>x;
		if(ma[x]==0){
			ma[x]++;
			if(k==0){
				printf("%05d",x);
				k=1;
			}
			else printf(" %05d",x);
		}
	}
	if(k==1) cout << endl;
	else cout << "No one is handsome"<<endl;
	return 0;
 } 

相关文章: