Language: C++

//OBOG2012E 敵の敵は味方 
#include<iostream>
#include<cstring>
using namespace std;


int nstr;
char strings[40][17];
void init_id(){
	nstr=0;
}
int get_id(char str[]){
	for(int i=0;i<nstr;i++)
		if(strcmp(str,strings[i])==0)return i;
	strcpy(strings[nstr],str);
	return nstr++;
}
/**/
__int64 get_bit(int id){
	return (__int64)1<<id;
}

struct{
	int id;
	int power;
	__int64 neighbor;
}kuni[40];

int search(int i,int n,int power,__int64 neighbor){
	int tmp,max;	
	__int64 a=neighbor;
	for(int j=i;j<n;j++)
		a |= kuni[j].neighbor;
	for(int j=i;j<n;j++){
		if( (get_bit(kuni[j].id) & a)==0){
			power += kuni[j].power;
			neighbor |= get_bit(kuni[j].id);
		}
	}
	max = power;
	for(;i<n;i++){
		if( (get_bit(kuni[i].id) & neighbor)==0 ){
			tmp = search(i+1,n,power+kuni[i].power,neighbor|kuni[i].neighbor);
			if(max < tmp)max = tmp;
		}
	}
	return max;
}
int main(){
	int n;
	while(cin>>n,n){
		init_id();
		for(int i=0;i<n;i++){
			char a[17],d[17];
			int b,c;
			cin>>a>>b>>c;
			kuni[i].id = get_id(a);
			kuni[i].power = b;
			kuni[i].neighbor = 0;
			while(c--){
				cin>>d;
				kuni[i].neighbor |= get_bit(get_id(d));
			}
		}
		cout<<search(1,n,kuni[0].power,kuni[0].neighbor)<<endl;
	}
	return 0;
}

Compiler output:
a.cc:19:1: error: '__int64' does not name a type; did you mean '__int64_t'?
   19 | __int64 get_bit(int id){
      | ^~~~~~~
      | __int64_t
a.cc:26:9: error: '__int64' does not name a type; did you mean '__int64_t'?
   26 |         __int64 neighbor;
      |         ^~~~~~~
      |         __int64_t
a.cc:29:34: error: '__int64' has not been declared
   29 | int search(int i,int n,int power,__int64 neighbor){
      |                                  ^~~~~~~
a.cc: In function 'int search(int, int, int, int)':
a.cc:31:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
   31 |         __int64 a=neighbor;
      |         ^~~~~~~
      |         __int64_t
a.cc:33:17: error: 'a' was not declared in this scope
   33 |                 a |= kuni[j].neighbor;
      |                 ^
a.cc:33:30: error: 'struct<unnamed>' has no member named 'neighbor'
   33 |                 a |= kuni[j].neighbor;
      |                              ^~~~~~~~
a.cc:35:22: error: 'get_bit' was not declared in this scope; did you mean 'get_id'?
   35 |                 if( (get_bit(kuni[j].id) & a)==0){
      |                      ^~~~~~~
      |                      get_id
a.cc:35:44: error: 'a' was not declared in this scope
   35 |                 if( (get_bit(kuni[j].id) & a)==0){
      |                                            ^
a.cc:42:22: error: 'get_bit' was not declared in this scope; did you mean 'get_id'?
   42 |                 if( (get_bit(kuni[i].id) & neighbor)==0 ){
      |                      ^~~~~~~
      |                      get_id
a.cc:43:81: error: 'struct<unnamed>' has no member named 'neighbor'
   43 |                         tmp = search(i+1,n,power+kuni[i].power,neighbor|kuni[i].neighbor);
      |                                                                                 ^~~~~~~~
a.cc: In function 'int main()':
a.cc:59:33: error: 'struct<unnamed>' has no member named 'neighbor'
   59 |                         kuni[i].neighbor = 0;
      |                                 ^~~~~~~~
a.cc:62:41: error: 'struct<unnamed>' has no member named 'neighbor'
   62 |                                 kuni[i].neighbor |= get_bit(get_id(d));
      |                                         ^~~~~~~~
a.cc:62:53: error: 'get_bit' was not declared in this scope; did you mean 'get_id'?
   62 |                                 kuni[i].neighbor |= get_bit(get_id(d));
      |                                                     ^~~~~~~
      |                                                     get_id
a.cc:65:56: error: 'struct<unnamed>' has no member named 'neighbor'
   65 |                 cout<<search(1,n,kuni[0].power,kuni[0].neighbor)<<endl;
      |                                                        ^~~~~~~~