Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>
#include<stack>

using namespace std;

//typedef long long Int;
//typedef vector<int> vint;
//typedef pair<int,int> pint;
//typedef vector<string> vstring;
//typedef vector<pint> vpint;

//struct Edge{int to,from,cost;};

//#ifdef DEBUGLOCAL
//#define debug cout
//#else
//stringstream __ss__;
//#define debug __ss__
//#endif

//template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) debug << *i << " "; debug << endl; }
//template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
//template<class T> void chmax(T &t, T f) { if (t < f) t = f; }

//#define rep(i,n) for(int i=0;i<(n);++i)
//#define repd(i,n) for(int i=(n)-1;i>=0;+--)
//#define repn(i,m,n) for(int i=(m);i<=(n);++i)
//#define repnd(i,m,n) for(int i=(n)-1;i>=(m);+--)
//#define rep0(i,n) for(i=0;i<(n);++i)
//#define all(n) n.begin(),n.end()
//#define sz(n) ((int)(n).size())
//#define mp make_pair
//#define pb push_back
//#define ss stringstream
//#define PUTLINE debug<<"LINE:"<<__LINE__<<endl;

const int INF = 2147483647;
//const double EPS = 1e-10;
//const double PI = acos(-1.0);

//const int dx[]={1,-1,0,0,1,-1,1,-1,0};
//const int dy[]={0,0,1,-1,1,-1,-1,1,0};

map<int,string> name;
int time[40][40];
int pt[40][40];

int main() {
	int n;
	for(;;){
		cin>>n;
		if(n==0)break;
		name.clear();
		memset(time,0,sizeof(time));
		memset(pt,0,sizeof(pt));
		for(int i=0;i<n;++i){
			string nm;
			cin>>nm;
			name[i]=nm;
			int m;
			cin>>m;
			for(int j=0;j<m;++j){
				int x;
				cin>>x;
				time[i][x]=1;
			}
		}
		for(int i=0;i<n;++i){
			for(int j=0;j<30;++j){
				if(time[i][j]==0)continue;
				int count=0;
				for(int k=0;k<n;++k){
					count+=time[k][j];
				}
				pt[i][j]=n+1-count;
			}
		}
		int mn=INF,res=0;
		for(int i=0;i<n;++i){
			int count=0;
			for(int j=0;j<30;++j)count+=pt[i][j];
			if(mn>count){
				res=i;
				mn=count;
			}else if(mn==count){
				if(name[res]>name[i]){
					res=i;
				}
			}
		}
		cout<<mn<<" "<<name[res]<<endl;
	}
	return 0;
}

Compiler output:
a.cc:61:16: error: 'int time [40][40]' redeclared as different kind of entity
   61 | int time[40][40];
      |                ^
In file included from /usr/include/pthread.h:23,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
                 from /usr/include/c++/14/ext/atomicity.h:35,
                 from /usr/include/c++/14/bits/ios_base.h:39,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:6:
/usr/include/time.h:76:15: note: previous declaration 'time_t time(time_t*)'
   76 | extern time_t time (time_t *__timer) __THROW;
      |               ^~~~
a.cc: In function 'int main()':
a.cc:70:38: error: ISO C++ forbids applying 'sizeof' to an expression of function type [-fpermissive]
   70 |                 memset(time,0,sizeof(time));
      |                                     ~^~~~~
a.cc:70:24: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'void*' [-fpermissive]
   70 |                 memset(time,0,sizeof(time));
      |                        ^~~~
      |                        |
      |                        time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept}
In file included from /usr/include/c++/14/cstring:43,
                 from a.cc:3:
/usr/include/string.h:61:28: note:   initializing argument 1 of 'void* memset(void*, int, size_t)'
   61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
      |                      ~~~~~~^~~
a.cc:81:39: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   81 |                                 time[i][x]=1;
      |                                       ^
a.cc:81:42: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   81 |                                 time[i][x]=1;
      |                                          ^
a.cc:81:43: error: assignment of read-only location '*(time + (((sizetype)i) + ((sizetype)x)))'
   81 |                                 time[i][x]=1;
      |                                 ~~~~~~~~~~^~
a.cc:86:42: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   86 |                                 if(time[i][j]==0)continue;
      |                                          ^
a.cc:86:45: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   86 |                                 if(time[i][j]==0)continue;
      |                                             ^
a.cc:89:54: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   89 |                                         count+=time[k][j];
      |                                                      ^
a.cc:89:57: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   89 |                                         count+=time[k][j];
      |                                                         ^
a.cc:89:46: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   89 |                                         count+=time[k][j];
      |                                         ~~~~~^~~~~~~~~~~~
a.cc:89:46: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'int' [-fpermissive]
   89 |                                         count+=time[k][j];
      |                                         ~~~~~^~~~~~~~~~~~
      |                                              |
      |                                              time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept}