criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cstring>
#include <cstdio>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <bitset>

#define rep(i, n) for(int i = 0; i < (n); i++)
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define all(v) (v).begin(), (v).end()
#define rev(s) (s).rbegin(), (s).rend()
#define MP make_pair
#define X first
#define Y second

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef pair<double, double> dP;

const int INF = 100000000;
const double EPS = 1e-10;

vector<vector<double> > edge;
double dist(P &a, P &b){
	return sqrt(double(a.X-b.X)*(a.X-b.X)+(a.Y-b.Y)*(a.Y-b.Y));
}

bool dfs(vector<P> &c, bitset<20> &b, int hi, int di, double t){
	if(edge[hi][di] <= t+EPS) return false;
	if(b.count() == 20) return true;
	rep(i, c.size()-2){
		if(b[i]) continue;
		if(edge[i][di] <= t+edge[i][hi]+EPS) return false;
	}
	rep(i, c.size()-2){
		if(b[i]) continue;
		b[i] = true;
		if(dfs(c, b, i, di, t+edge[i][hi])) return true;
		b[i] = false;
	}

	return false;
}

int main(){
	while(1){
		int n;
		cin >> n;
		if(!n)break;
		P h, d;
		cin >> h.X >> h.Y >> d.X >> d.Y;
		vector<P> c(n);
		rep(i, n){
			cin >> c[i].X >> c[i].Y;
		}
		bitset<20> bits;
		bits = ~bits;
		rep(i, n){
			bits[i] = false;
		}
		c.push_back(h);
		c.push_back(d);
		edge.resize(n+2);
		rep(i, n+2){
			edge[i].resize(n+2);
		}
		rep(i, n+2){
			for(int j = i; j < n+2; j++){
				if(i == j){
					edge[i][j] = 0;
					continue;
				}
				edge[i][j] = edge[j][i] = dist(c[i], c[j]);
			}
		}

		cout << (dfs(c, bits, n, n+1, 0)?"YES":"NO") << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'double dist(P&, P&)':
a.cc:32:16: error: 'sqrt' was not declared in this scope
   32 |         return sqrt(double(a.X-b.X)*(a.X-b.X)+(a.Y-b.Y)*(a.Y-b.Y));
      |                ^~~~
Language: C++

#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <fstream>
using namespace std;
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string toStr(T x) { ostringstream sout; sout << x; return sout.str();}
typedef vector<int> vi;
typedef vector<vi>  vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n) FOR(i,0,(n)-1)
const double EPS = 1e-12;
const double PI = acos(-1.0);
//const int INF = INT_MAX/10;
const double INF = DBL_MAX/10;

#define LT(x,y) ((x)-(y)<EPS)

#include <complex>
typedef complex<double> P;
typedef vector<double> vd;


int main() {
	int n, hx, hy, dx, dy;
	while(cin >> n >> hx >> hy >> dx >> dy, n) {
		P h(hx, hy), d(dx, dy);
		vector<P> c(n);
		int x, y;
		REP(i, n) {
			cin >> x >> y;
			c[i] = P(x, y);
		}

		vector<vd> dist(n, vd(n, INF));
		REP(i, n) {
			FOR(j, i+1, n-1) {
				dist[i][j] = dist[j][i] = abs(c[i]-c[j]);
			}
		}
		vd sdist(n);
		REP(i, n) {
			sdist[i] = abs(c[i]-h);	
		}

		vector<vd> dp(1<<n, vd(n, INF));
		REP(i, n) {
			if(i == 0) {
				REP(j, n) {
					dp[1<<j][j] = sdist[j];
					if(LT(abs(d-c[j]), dp[1<<j][j])) {
						dp[1<<j][j] = INF;
					}
				}
			} else {
				REP(j, n) {
					if(!(i&(1<<j))) {
						REP(k, n) {
							dp[i|(1<<j)][j] = min(dp[i|(1<<j)][j], dp[i][k]+dist[k][j]);
							if(LT(abs(d-c[j]), dp[i|(1<<j)][j])) {
								dp[i|(1<<j)][j] = INF;
							}
						}
					}
				}
			}
		}

		bool ok = false;
		REP(i, n) {
			if(dp[(1<<n)-1][i] != INF) {
				ok = true;
			}
		}

		cout << (ok ? "YES" : "NO") << endl;
	}

	return 0;
}

Compiler output:
a.cc:35:20: error: 'DBL_MAX' was not declared in this scope
   35 | const double INF = DBL_MAX/10;
      |                    ^~~~~~~
a.cc:20:1: note: 'DBL_MAX' is defined in header '<cfloat>'; this is probably fixable by adding '#include <cfloat>'
   19 | #include <fstream>
  +++ |+#include <cfloat>
   20 | using namespace std;
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;

int main() {
	while(true) {
		int n, hx, hy, dx, dy;
		cin >> n >> hx >> hy >> dx >> dy;

		if(!n && !hx && !hy && !dx && !dy) {
			break;
		}

		vector< pair< int, int > > crys;
		for(int i = 0; i < n; i++) {
			int x, y;
			cin >> x >> y;

			crys.push_back(make_pair(x, y));
		}

		vector< pair< double, double> > u;
		vector< bool > use(n, true);
		int tmp = 1000, idx = 0;
		for(int i = 0; i < n; i++) {
			u.push_back(make_pair(sqrt((double)(crys[i].first - dx) * (crys[i].first - dx) + (double)(crys[i].second - dy) * (crys[i].second - dy)), sqrt((double)(crys[i].first - hx) * (crys[i].first - hx) + (double)(crys[i].second - hy) * (crys[i].second - hy))));
			if(tmp > u[i].first) {
				tmp = u[i].first;
				idx = i;
			}
		}


		sort(u.begin(), u.end());
		use[idx] = false;

		int ans = u[0].first - u[0].second;
		pair< int, int > now;
		now.first = crys[idx].first; now.second = crys[idx].second;

		bool flag = true;
		for(int i = 0; i < n; i++) {
			tmp = 10000;
			vector< pair< double, double> > h;
			for(int j = 0; j < n; j++) {
				if(!use[j]) {
					continue;
				}
				h.push_back(make_pair(sqrt((double)(crys[j].first - now.first) * (crys[j].first - now.first) + (double)(crys[j].second - now.second) * (crys[j].second - now.second)), sqrt((double)(crys[j].first - now.first) * (crys[j].first - now.first) + (double)(crys[j].second - now.second) * (crys[j].second - now.second))));
				if(tmp > h[j].first) {
					tmp = h[j].first;
					idx = i;
				}
			}
			sort(h.begin(), h.end());
			if(!h.size()) {
				break;
			}
			ans += (h[0].first - h[0].second);
			now.first = crys[idx].first; now.second = crys[idx].second;
			
			use[idx] = false;

			if(ans <= 0) {
				cout << "NO" << endl;
				flag = false;
				break;
			}
		}

		if(flag){
			cout << "YES" << endl;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:47: error: 'sqrt' was not declared in this scope
   29 |                         u.push_back(make_pair(sqrt((double)(crys[i].first - dx) * (crys[i].first - dx) + (double)(crys[i].second - dy) * (crys[i].second - dy)), sqrt((double)(crys[i].first - hx) * (crys[i].first - hx) + (double)(crys[i].second - hy) * (crys[i].second - hy))));
      |                                               ^~~~
a.cc:52:55: error: 'sqrt' was not declared in this scope
   52 |                                 h.push_back(make_pair(sqrt((double)(crys[j].first - now.first) * (crys[j].first - now.first) + (double)(crys[j].second - now.second) * (crys[j].second - now.second)), sqrt((double)(crys[j].first - now.first) * (crys[j].first - now.first) + (double)(crys[j].second - now.second) * (crys[j].second - now.second))));
      |                                                       ^~~~
Language: C++

#include<stdio.h>
#include<iostream>
#include<algorithm>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;
const int INF=100000000;


int n;
int hx,hy;
int dx,dy;
int cx[21],cy[21];
bool flag[21];

double dist(int x0,int y0,int x1,int y1) {
	double d = (x0-x1)*(x0-x1) + (y0-y1)*(y0-y1);
	return sqrt(d);
}

int pow2(int a) {
	return a*a;
}

//クリスタルの位置と何日目からとることができるか
bool check(int x,int y,int d) {
	return (pow2(dx-x)+pow2(dy-y)) > pow2(d);
}

//現在位置,何日目
bool dfs(int x,int y,int d,int cnt) {
	//printf("[debug] %d,%d,%d,%d\n",x,y,d,cnt);
	if(cnt==n) return true;
	rep(i,n) {
		if(!flag[i]) {
			flag[i]=true;
			d += (int)dist(x,y,cx[i],cy[i])+1;
			if(check(cx[i],cy[i],d)) {
				return dfs(cx[i],cy[i],d,cnt+1);
			}
			flag[i]=false;
		}
	}
	return false;


}


void solve() {
	rep(i,n) cin>>cx[i]>>cy[i];
	rep(i,21) flag[i]=false;

	if(dfs(hx,hy,0,0)) cout<<"YES"<<endl;
	else cout<<"NO"<<endl;
}

int main() {
	while (cin>>n>>hx>>hy>>dx>>dy)
	{
		if(n+hx+hy+dx+dy==0) return 0;
		solve();
	}

	return 0;
}

Compiler output:
a.cc: In function 'double dist(int, int, int, int)':
a.cc:19:16: error: 'sqrt' was not declared in this scope
   19 |         return sqrt(d);
      |                ^~~~
Language: C++

#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
 
using namespace std;
 
#define MAX 20
#define EPS 1e-9

struct Point{
  double x, y;
  Point(double x = 0,double y = 0) : x(x), y(y) {}
 
  Point operator + (const Point &p)const{
    return Point(x + p.x , y + p.y);
  }
 
  Point operator - (const Point &p)const{
    return Point(x - p.x , y - p.y);
  }
 
  Point operator * (const double &k)const{
    return Point(x * k , y * k);
  }
 
  Point operator / (const double &k)const{
    return Point(x / k , y / k);
  }

  bool operator < (const Point &p)const{
    return x != p.x ? x < p.x : y < p.y;
  }

  double norm(){
    return x*x + y*y;
  }
  double dot(const Point &p)const{
    return x*p.x + y*p.y;
  }
  double Abs(){
    return sqrt(norm());
  }
}; 

typedef Point Vector;
 
struct Segment{
  Vector s, t;
 
  Segment(){}
  Segment(Vector s, Vector t) : s(s), t(t) {}
 
  Point Projection(Point &p){
    Vector base = t - s;
    double t = (p-s).dot(base) / base.norm();
    return s + base*t;
  }
  Point Reflection(Point &p){
    return p + (Projection(p) - p) * 2.0;
  }

  bool intersectSP(Point &p){
    return (((s-p).Abs() + (t-p).Abs() - (t-s).Abs()) < EPS);
  }

  double distanceSP(Point &p){
    Point r = Projection(p);
    if(intersectSP(r)) return (r-p).Abs();
    return min((s-p).Abs(), (t-p).Abs());
  }
};

int N;
Point h, d, crystal[MAX];
 
double dist(Point a, Point b){
  return sqrt(pow(a.x-b.x,2) + pow(a.y-b.y,2));
}

bool used[MAX];
bool rec(int now, double total_dist, int depth){
  if(total_dist >= dist(d, crystal[now])){
    return false;
  }
  if(depth == N){
    return true;
  }
  for(int i = 0 ; i < N ; i++){
    if(!used[i]){
      Segment s = Segment(crystal[now], crystal[i]);
      if(s.distanceSP(d) < 1) return false;
      used[i] = true;
      if(rec(i, total_dist + dist(crystal[now],crystal[i]), depth+1)){
        return true;
      }
      used[i] = false;
    }
  }
  return false;
}

bool solve(){
  for(int i = 0 ; i < N ; i++){
    memset(used, false, sizeof(used));
    if(rec(i, dist(h, crystal[i]), 0)){
      return true;
    }
  }

  return false;
}
 
int main(){
  while(cin >> N >> h.x >> h.y >> d.x >> d.y, (N + h.x + h.y + d.x + d.y)){
    for(int i = 0 ; i < N ; i++){
      cin >> crystal[i].x >> crystal[i].y;
    }
    cout << (solve() ? "YES" : "NO") << endl;
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'bool solve()':
a.cc:105:5: error: 'memset' was not declared in this scope
  105 |     memset(used, false, sizeof(used));
      |     ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <algorithm>
  +++ |+#include <cstring>
    5 |
Language: C++

#include <bits/stdc++.h>
#define EPS (1e-10)
using namespace std;
 
typedef complex<double> P; //Point
typedef pair<P,P> L; //Line, Segment
 
 
namespace std {
  bool operator < (const P& a, const P& b){
    return fabs(real(a)-real(b)) < EPS ? imag(a) < imag(b) : real(a) < real(b);
  }
  bool operator ==(const P& a, const P& b){
    return abs(a.real()-b.real())<EPS&&abs(a.imag()-b.imag())<EPS;
  }
}
 
double dot(P a, P b){ return real(conj(a)*b); }
double cross(P a, P b){ return imag(conj(a)*b); }
 
int ccw(P a, P b, P c){
  b -= a;
  c -= a;
  if(cross(b,c) > EPS) return 1;   // ????????????(b-a)?????????´???????????????(c-a)?????????¨?????????
  if(cross(b,c) < -EPS) return -1; // ????????????(b-a)?????????´???????????????(c-a)?????????¨?????????
  if(dot(b,c) < -EPS) return 2;
  if(norm(b) < norm(c)) return -2;
  return 0;
}
 
bool isIntersect(L s1, L s2){  
  return ( ccw(s1.first,s1.second,s2.first) * ccw(s1.first,s1.second,s2.second) <= 0 &&
           ccw(s2.first,s2.second,s1.first) * ccw(s2.first,s2.second,s1.second) <= 0 );
}
 
P crossPoint(L l, L m){
  double A = cross(l.second - l.first, m.second - m.first);
  double B = cross(l.second - l.first, l.second - m.first);
  if(fabs(A) < EPS && fabs(B) < EPS) return m.first;
  else if(fabs(A) >= EPS) return m.first + B / A * (m.second - m.first);
}
 
bool onEdge(P a){return a.real()==-100||a.real()==100||a.imag()==-100||a.imag()==100;}
 
int Unique(vector<P> &p){
  int res=0;
  for(int i=0;i<(int)p.size();i++){
    int flg=1;
    for(int j=i+1;j<(int)p.size();j++) if(p[i]==p[j]) flg=0;
    res+=flg;
  }  
  return res;
}
 
int main(){
  int n;
  while(cin>>n,n){
    int ans=1;
    vector<L> v;
     
    for(int i=0;i<n;i++){
      int sx,sy,gx,gy;
      cin>>sx>>sy>>gx>>gy;
      L l=L(P(sx,sy),P(gx,gy));
       
      vector<P> p;
      for(int i=0;i<v.size();i++){
    if(!isIntersect(l,v[i]))continue;
    P cp=crossPoint(l,v[i]);
    if(!onEdge(cp))p.push_back(cp);
      }
      ans+=1+Unique(p);
      v.push_back(l);
    }  
    cout<<ans<<endl;
  }
  return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:77:12: error: expected '}' at end of input
   77 |   return 0;
      |            ^
a.cc:55:11: note: to match this '{'
   55 | int main(){
      |           ^
a.cc: In function 'P crossPoint(L, L)':
a.cc:41:1: warning: control reaches end of non-void function [-Wreturn-type]
   41 | }
      | ^
Language: C++

#!/usr/bin/env python

from collections import deque
import itertools as it
import sys
import math

sys.setrecursionlimit(1000000)

def gcd(a, b):
    if b == 0:
        return a
    a1 = b
    b1 = a % b
    return gcd(a1, b1)

while True:
    n = int(input())
    if n == 0:
        break
    line = []
    for loop in range(n):
        x1, y1, x2, y2 = list(map(int, input().split()))
        # ax + by + c = 0
        a = y1 - y2
        b = x2 - x1
        c = -x1 * a - y1 * b
        line.append((a, b, c))
    m = {}
    for i in range(n):
        for j in range(i + 1, n):
            l1 = line[i]
            l2 = line[j]
            det = l1[0] * l2[1] - l1[1] * l2[0]
            deta = int(abs(det))
            if det == 0:
                continue
            x = l2[1] * l1[2] - l1[1] * l2[2]
            y = -l2[0] * l1[2] + l1[0] * l2[2]
            if x > -100 * deta and x < 100 * deta and y > -100 * deta and y < 100 * deta:
                G = gcd(gcd(int(abs(x)), int(abs(y))), int(abs(det)))
                x //= G
                y //= G
                det //= G
                if det < 0:
                    x *= -1
                    y *= -1
                    det *= -1
                m[(x, y, det)] = 1
    print(1 + n + len(m))


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #!
    1 | #!/usr/bin/env python
      |  ^
a.cc:24:11: error: invalid preprocessing directive #ax
   24 |         # ax + by + c = 0
      |           ^~
a.cc:3:1: error: 'from' does not name a type
    3 | from collections import deque
      | ^~~~
a.cc:30:5: error: expected unqualified-id before 'for'
   30 |     for i in range(n):
      |     ^~~
Language: C++

#include <cstdio>
#include <complex>
#include <vector>

using namespace std;
typedef complex<double> P;

bool eq(double d,dopuble e){return abs(d-e)<1e-10;};
bool eqv(P p,P q){return eq(p.real(),q.real()) && eq(p.imag(),q.imag());}

const P nowhere(200,200);
double cross_product(P a, P b) { 
  return (conj(a)*b).imag();
}

P crosspoint(const P& l0, const P& l1,
	     const P& r0, const P& r1) {
    double n = cross_product(r1-r0, r0-l0);
    double d = cross_product(r1-r0, l1-l0);
    return l0 + (l1-l0)*n/d;
}

P ok(P p){
  if(abs(p.real()) > 100-1e-10 || abs(p.imag()) > 100-1e-10)
    return nowhere;
  else
    return p;
}

int n,nl;


int main(){
  while(scanf("%d",&n),n){
    vector<P> ps,qs;
    int ans=1;

    for(int i=0; i<n; i++){
      double x1,y1,x2,y2;
      scanf("%lf %lf %lf %lf",&x1,&y1,&x2,&y2);
      ps.push_back(P(x1,y1)); qs.push_back(P(x2,y2));
    }

    for(int i=0; i<n; i++){
      int count=1;
      vector<P> cs;
      for(int j=0; j<i; j++){
	if(eq(cross_product(ps[i]-qs[i],ps[j]-qs[j]),0)) continue;
	P c = crosspoint(ps[i],qs[i],ps[j],qs[j]);
	if(ok(c)==nowhere) continue;

	bool duplicate=false;
	for(int k=0; k<cs.size(); k++)
	  if(eqv(cs[k],c))
	    duplicate=true;
	if(!duplicate){
	  count++;
	  cs.push_back(c);
	}
      }
      ans += count;
    }

    printf("%d\n",ans);
  }
}

Compiler output:
a.cc:8:18: error: 'dopuble' has not been declared
    8 | bool eq(double d,dopuble e){return abs(d-e)<1e-10;};
      |                  ^~~~~~~
Language: C

//TLE
#include <iostream>
#include <queue>
#include <utility>
#include <algorithm>
#include <string>
#include <cstdio>
using namespace std;

struct packet{
	int tm,pos,dist;
	string name;
	packet(int t,int p,int d,const string&n):
		tm(t),pos(p),dist(d),name(n){}
};
vector<packet> pac;
int len[33][33],to[33][33],bac[33];
int tbl[1001];
const int inf = 1e9;
struct cmp{
	bool operator()	(int x,int y) const
	{
		const packet &a = pac[x], &b = pac[y];
		return a.tm == b.tm
			? to[a.pos][a.dist] > to[b.pos][b.dist]
			: a.tm > b.tm;
	}
};
bool cmp2(int x,int y){
	const packet &a=pac[x], &b = pac[y];
	return a.tm==b.tm ? a.name < b.name: a.tm < b.tm;
}

int main(){
	int n,m,f,t,d,i,j,k,l;
	string name;
	priority_queue<int,vector<int>,cmp> qu;
	for(;cin>>n>>m,n;){
		pac.clear();
		if(**len==1)cout<<endl;

		for(i=0;i<=n;i++){
			for(j=0;j<=m;j++){
				len[i][j]=inf;
				to[i][j]=-1;
			}
			bac[i]=len[i][i]=0;
			to[i][i]=i;
		}

		for(;m--;){
			cin>>f>>d>>t;
			len[f][d] = t;
			len[d][f] = t;
			to[f][d] = d;
			to[d][f] = f;
		}

		for(k=1;k<=n;k++)
			for(i=1;i<=n;i++)
				for(j=1;j<=n;j++){
					t = len[i][k] + len[k][j];
					if( len[i][j] > t ){
						len[i][j] = t;
						to[i][j] = to[i][k];
					}
				}
		cin>>l;
		for(j=0;j<l;j++){
			cin>>f>>d>>t>>name;
			pac.push_back( packet(t,f,d,name) );
			qu.push(j);
		}

		for(;!qu.empty();){
			int pi = qu.top();
			packet *p = &pac[pi];
			t = p->tm;
			f = p->pos;
			if( f == p->dist ){
				qu.pop();
				continue;
			}
			if( t < bac[f] ){
				p->tm = bac[f];
				qu.pop();
				qu.push(pi);
			}else{
				d = to[f][p->dist];
				bac[f] = t + 2 * len[p->pos][d];
				for(;;){
					int qi = qu.top();
					packet*q = &pac[qi];
					if(t==q->tm && f==q->pos && to[q->pos][q->dist] == d){
						qu.pop();
						q->tm = max( q->tm + len[f][d], bac[d] );
						q->pos = d;
						qu.push(qi);
					}
					else break;
				}
			}
		}
//		sort(pac.begin(),pac.end(),cmp2);
//		for(j=0;j<l;j++)cout<<pac[j].name<<' '<<pac[j].tm<<endl;
		for(j=0;j<l;j++)tbl[j]=j;
		sort(tbl,tbl+l,cmp2);
		for(j=0;j<l;j++)printf("%s %d\n",pac[tbl[j]].name.c_str(),pac[tbl[j]].tm);

		**len = 1;
	}
}

Compiler output:
main.c:2:10: fatal error: iostream: No such file or directory
    2 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: Java


import java.io.*;
import java.util.*;

public class GatherMap
{
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		for(;;)
		{
			int N = sc.nextInt();
			if (N == 0) break;
			
			boolean[][] ok = new boolean[N][31];
			for (int i = 0; i < N; i++)
			{
				int f = sc.nextInt();
				for (int j = 0; j < f; j++)
				{
					int d = sc.nextInt();
					ok[i][d] = true;
				}
			}
			
			int[] map = new int[N];
			int all = 0;
			for (int i = 0; i < N; i++)
			{
				all |= (map[i] = 1 << i);
			}
			
			int day = -1;
			for (int d = 1; d <= 30; d++)
			{
				for (int n1 = 0; n1 < N; n1++)
				{
					for (int n2 = n1 + 1; n2 < N; n2++)
					{
						if (ok[n1][d] && ok[n2][d])
						{
							map[n1] = map[n2] = (map[n1] | map[n2]);
							if (map[n1] == all)
							{
								day = d;
							}
						}
					}
				}
				if (day != -1) break;
			}
			System.out.println(day);
		}
	}
}

Compiler output:
Main.java:5: error: class GatherMap is public, should be declared in a file named GatherMap.java
public class GatherMap
       ^
1 error
Language: Java

import java.util.ArrayList;
import java.util.Scanner;
import java.io.PrintWriter;

public class Main {
	static Scanner scan = new Scanner(System.in);
	static PrintWriter out = new PrintWriter(System.out);
	public static void main(String[] args){
		while(true){
			int n = si();
			if(n==0) break;
			ListArray[] lista = new ListArray[30];
			for(int i=0;i<30;i++) lista[i] = new ListArray();
			int[] map = new int[n];
			int res = -1;
			for (int i = 0; i < n; i++) {
				int m = si();
				map[i]=1<<i;
				for (int j = 0 ;j < m ; j++)
					lista[si()-1].list.add(i);
			}
			for (int i = 0; i < 30; i++) {
				int tmp = 0;
				for (Integer e : lista[i].list)
					tmp |= map[e];
				for (Integer e : lista[i].list)
					map[e]=tmp;
				if(tmp==(1<<n)-1){
					res = i+1;
					break;
				}
			}
			out.println(res);
		}
		out.flush();
	}
	static int si(){
		return Integer.parseInt(scan.next());
	}
}

Compiler output:
Main.java:12: error: cannot find symbol
			ListArray[] lista = new ListArray[30];
			^
  symbol:   class ListArray
  location: class Main
Main.java:12: error: cannot find symbol
			ListArray[] lista = new ListArray[30];
			                        ^
  symbol:   class ListArray
  location: class Main
Main.java:13: error: cannot find symbol
			for(int i=0;i<30;i++) lista[i] = new ListArray();
			                                     ^
  symbol:   class ListArray
  location: class Main
3 errors
Language: C++

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

int n;
vector<int> scjl[33];
vector<int> now[55];

int solve();

int main() {
  int i, j, f, x;
  while(1) {
    cin >> n;
    if(n == 0) break;
    for(i = 0; i < n; ++i) {
      cin >> f;
      for(j = 0; j < f; ++j) {
        cin >> x;
        scjl[x].push_back(i);
      }
    }
    for(i = 0; i < n; ++i) now[i].push_back(i);
    cout << solve() << endl;
    for(i = 0; i <= 30; ++i)
      scjl[i].erase(scjl[i].begin(), scjl[i].end());
    for(i = 0; i < n; ++i)
      now[i].erase(now[i].begin(), now[i].end());
  }
  return 0;
}

int solve() {
  int i, j, k;
  for(i = 1; i <= 30; ++i) {
    vector<int> nextv;
    for(j = 0; j < scjl[i].size(); ++j)
      nextv.insert(nextv.begin(), now[scjl[i][j]].begin(),
                   now[scjl[i][j]].end());
    sort(nextv.begin(), nextv.end());
    nextv.erase(unique(nextv.begin(), nextv.end()),
                nextv.end());
    if(nextv.size() == n) return i;
    for(j = 1; j < scjl[i].size(); ++j)
      now[skjl[i][j]] = nextv;
  }
  return -1;
}


Compiler output:
a.cc: In function 'int solve()':
a.cc:44:11: error: 'skjl' was not declared in this scope; did you mean 'scjl'?
   44 |       now[skjl[i][j]] = nextv;
      |           ^~~~
      |           scjl
Language: C++

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

long long N;
//vector<int> A[51];
long long P[51];
vector<int> D[51];

void solve() {
	
	for (int n = 0; n < N; n ++) {
		int F;
		cin >> F;
		for (int f = 0; f < F; f ++) {
			int a;
			cin >> a;
			D[a].push_back(n);
		}
	}
	for (long long n = 0; n < N; n++) {
		P[n] = static_cast<__int64>(1) <<  n;
	}
	for (int d = 0; d < 31; d++) {
		for (auto n2 : D[d]) {
			for (auto n : D[d]) {
				P[n2] = (P[n2] | P[n]);
			}
			if (P[n2] == (static_cast<__int64>(1) <<  N) - 1) {
				cout << d << endl;
				return;
			}
		}
	}
	cout << "-1" << endl;
}
	
int main() {
	cin >> N;
	while (N){
		for (int i = 0; i < 51; i ++) {
			D[i] = {};
		}
		solve();
		cin >> N;
	}
}



Compiler output:
a.cc: In function 'void solve()':
a.cc:21:36: error: '__int64' does not name a type; did you mean '__int64_t'?
   21 |                 P[n] = static_cast<__int64>(1) <<  n;
      |                                    ^~~~~~~
      |                                    __int64_t
a.cc:28:51: error: '__int64' does not name a type; did you mean '__int64_t'?
   28 |                         if (P[n2] == (static_cast<__int64>(1) <<  N) - 1) {
      |                                                   ^~~~~~~
      |                                                   __int64_t
Language: C++

#include <iostream>
#include <vector>
#include <queue>
using namespace std;

int main() {
  int N;
  const int M = 60;
  while (scanf("%d", &N) != EOF && N) {
    bool R[M][M]; // 隣接行列。i日目までに会える人がつながっている。
    fill(&R[0][0], &R[0][0]+M*M, 0);
    vector<int> S[M];
    for (int i=0; i<N; i++) {
      int f;
      scanf("%d", &f);
      for (int j=0; j<f; j++) {
	int t;
	scanf("%d", &t);
	t--;
	S[i].push_back(t);
      }
    }
    for (int i=0; i<30; i++) {
      vector<int> con; // i日目に会える人を格納
      // cerr << "DAY " << i << endl;
      for (int j=0; j<N; j++) {
	// cerr << (int) (find(S[j].begin(), S[j].end(), i) - S[j].begin()) << endl;
	if (find(S[j].begin(), S[j].end(), i) != S[j].end()) {
	  // cerr << j << " attends" << endl;
	  con.push_back(j);
	}
      }
      // i日目に会う人を全員つなぐ。
      for (unsigned int j=0; j<con.size(); j++) {
	for (unsigned int k=0; k<j; k++) {
	  R[con[j]][con[k]] = R[con[k]][con[j]] = true;
	}
      }
      // 0さんから幅優先探索。
      queue<int> Q;
      bool visited[M];
      fill(visited, visited+M, 0);
      Q.push(0);
      int count = 0;
      while (!Q.empty()) {
	int now = Q.front();
	Q.pop();
	if (!visited[now]) {
	  visited[now] = true;
	  count++;
	  for (int j=0; j<N; j++) {
	    if (R[now][j] && !visited[j]) {
	      Q.push(j);
	    }
	  }
	}
      }
      if (count == N) { // 全員巡っていたら終わり。
	printf("%d\n", i+1);
	goto END;
      }
    }
    printf("%d\n", -1); // 30日経ってもダメならダメ。
  END: continue;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:17: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   28 |         if (find(S[j].begin(), S[j].end(), i) != S[j].end()) {
      |             ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:28:17: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   28 |         if (find(S[j].begin(), S[j].end(), i) != S[j].end()) {
      |             ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <queue>
#include <fstream>
 
using namespace std;
 
#define INF 1000000000
#define EPS 1e-9
#define PI acos(-1)
 
typedef long long ll;

#define MAX_N 51
#define MAX_F 31

vector<int> ans_list;

int main(){

  while(true){

    int N;
    bool flag[MAX_N][MAX_F];
    memset(flag, 0, sizeof(flag));
    cin >> N;

    if(N == 0)
      break;

    for(int i = 1; i <= N; i++){
      int m;
      cin >> m;
      for(int j = 0; j < m; j++){
	int t;
	cin >> t;
	flag[i][t] = true;
      }
    }

    int ans = 0;
    ll dp[MAX_N];
    memset(dp, 0, sizeof(dp));

    for(int i = 1; i <= N; i++){
      dp[i] = (1<<i)-1;
    }

    for(ans = 1; ans <= 30; ans++){
      
      ll S = 0;

      for(int i = 1; i <= N; i++){
	if(flag[i][ans]){
	  S |= dp[i];
	}
      }

      if(S == (1 << N) - 1)
	break;

      for(int i = 1; i <= N; i++){
	if(flag[i][ans])
	  dp[tmp[i]] |= S;
      }

    }

    if(ans <= 30)
      ans_list.push_back(ans);
    else
      ans_list.push_back(-1);

  }

  for(int i = 0; i < ans_list.size(); i++){
    cout << ans_list[i] << endl;
  }

  return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:83:14: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   83 |           dp[tmp[i]] |= S;
      |              ^~~
      |              tm
Language: C++

#include<iostream>
#include<vector>
#include<queue>
using namespace std;

class unionFindTree{
  vector<int> par;
  vector<int> rank;
public:
  unionFindTree();
  unionFindTree(int _n){
    par.resize(_n);
    rank.resize(_n);
    for (int i = 0; i < _n; i++) {
      par[i] = i;
      rank[i] = 0;
    }
  }

  int find(int x){
    if(par[x] == x){
      return x;
    }else{
      return par[x] = find(par[x]);
    }
  }
  
  void unite(int x, int y){
    x = find(x);
    y = find(y);
    if(x == y) return;
    if(rank[x] < rank[y]){
      par[x] = y;
    }else{
      par[y] = x;
      if(rank[x] == rank[y])rank[x]++;
    }
  }

  bool same(int x, int y){
    return find(x) == find(y);
  }

  int size(){
    for (int i = 0; i < par.size(); i++) {
      find(i);
    }
    int s[par.size()], res = 0;
    memset(s, 0, sizeof(s));
    
    for (int i = 0; i < par.size(); i++) {
      ///std::cout << "p:" << par[i] << std::endl;
      s[ par[i] ]++;
      res = max(res, s[ par[i] ]);
    }
    return res;
  }
};

int main(int argc, char *argv[]){
  int n;
  cin >> n;
  unionFindTree t(n);
  priority_queue<int, vector<int>, greater<int> > schedule[100];
  int x;
  for (int i = 0; i < n; i++) {
    cin >> x;
    for (int j = x - 1; j >= 0; j--) {
      int tmp;
      cin >> tmp;
      schedule[i].push(tmp);
    }
  }
  int day = 1;
  while(t.size() < n){
    //std::cout << t.size() << std::endl;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if(i == j)continue;
        if(schedule[i].empty() || schedule[j].empty())continue;
        if(schedule[i].top() == day &&
           schedule[j].top() == day){
          t.unite(i, j);
          schedule[i].pop();
          schedule[j].pop();
        }
      }
    }
    day++;
  }
  std::cout << day - 1 << std::endl;
  return 0;
}

Compiler output:
a.cc: In member function 'int unionFindTree::size()':
a.cc:49:5: error: 'memset' was not declared in this scope
   49 |     memset(s, 0, sizeof(s));
      |     ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<queue>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
using namespace std;

class unionFindTree{
  vector<int> par;
  vector<int> rank;
public:
  unionFindTree();
  unionFindTree(int _n){
    par.resize(_n);
    rank.resize(_n);
    for (int i = 0; i < _n; i++) {
      par[i] = i;
      rank[i] = 0;
    }
  }

  int find(int x){
    if(par[x] == x){
      return x;
    }else{
      return par[x] = find(par[x]);
    }
  }
  
  void unite(int x, int y){
    x = find(x);
    y = find(y);
    if(x == y) return;
    if(rank[x] < rank[y]){
      par[x] = y;
    }else{
      par[y] = x;
      if(rank[x] == rank[y])rank[x]++;
    }
  }

  bool same(int x, int y){
    return find(x) == find(y);
  }

  int size(){
    for (int i = 0; i < par.size(); i++) {
      find(i);
    }
    int s[par.size()], res = 0;
    memset(s, 0, sizeof(s));
    
    for (int i = 0; i < par.size(); i++) {
      s[ par[i] ]++;
      res = max(res, s[ par[i] ]);
    }
    return res;
  }
};

int main(int argc, char *argv[]){
  int n;
  cin >> n;
  unionFindTree t(n);
  priority_queue<int, vector<int>, greater<int> > schedule[100];
  int x;
  for (int i = 0; i < n; i++) {
    cin >> x;
    for (int j = x - 1; j >= 0; j--) {
      int tmp;
      cin >> tmp;
      schedule[i].push(tmp);
    }
  }
  int day = 0;
  while(t.size() < n){
    day++;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if(i == j)continue;
        if(schedule[i].empty() || schedule[j].empty())continue;
        if(schedule[i].top() <= day &&
           schedule[j].top() <= day){
          t.unite(i, j);
          schedule[i].pop();
          schedule[j].pop();
        }
      }
    }
  }
  std::cout << day << std::endl;
  return 0;
}

Compiler output:
a.cc: In member function 'int unionFindTree::size()':
a.cc:50:5: error: 'memset' was not declared in this scope
   50 |     memset(s, 0, sizeof(s));
      |     ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include<queue>
  +++ |+#include <cstring>
    5 | using namespace std;
Language: C++

#include<iostream>
#include<cstring>
#include<vector>
#include<algorithm>
#include<queue>
using namespace std;
 
class unionFindTree{
  vector<int> par;
  vector<int> rank;
public:
  unionFindTree();
  unionFindTree(int _n){
    par.resize(_n);
    rank.resize(_n);
    for (int i = 0; i < _n; i++) {
      par[i] = i;
      rank[i] = 0;
    }
  }
 
  int find(int x){
    if(par[x] == x){
      return x;
    }else{
      return par[x] = find(par[x]);
    }
  }
   
  void unite(int x, int y){
    x = find(x);
    y = find(y);
    if(x == y) return;
    if(rank[x] < rank[y]){
      par[x] = y;
    }else{
      par[y] = x;
      if(rank[x] == rank[y])rank[x]++;
    }
  }
 
  bool same(int x, int y){
    return find(x) == find(y);
  }
 
  int size(){
    for (int i = 0; i < par.size(); i++) {
      find(i);
    }
    int s[par.size()], res = 0;
    memset(s, 0, sizeof(s));
     
    for (int i = 0; i < par.size(); i++) {
      s[ par[i] ]++;
      res = max(res, s[ par[i] ]);
    }
    return res;
  }
};
 
int main(int argc, char *argv[]){
  int n;
  cin >> n;
  unionFindTree t(n);
  priority_queue<int, vector<int>, greater<int> > schedule[100];
  int x;
  for (int i = 0; i < n; i++) {
    cin >> x;
    for (int j = x - 1; j >= 0; j--) {
      int tmp;
      cin >> tmp;
      schedule[i].push(tmp);
    }
  }
  int day = 0;
  while(t.size() < n && day <= 30){
    day++;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if(i == j)continue;
        if(schedule[i].empty() || schedule[j].empty())continue;
        if(schedule[i].top() == day &&
           schedule[j].top() == day){
          t.unite(i, j);
          schedule[i].pop();
          schedule[j].pop();
        }
      }
    }
  }
  if(day <= 30)std::cout << day << std::endl;
  else std::cout << 30 << std::endl;
  
  return 0;

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:94:12: error: expected '}' at end of input
   94 |   return 0;
      |            ^
a.cc:61:33: note: to match this '{'
   61 | int main(int argc, char *argv[]){
      |                                 ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;

int main(int argc, char *argv[]){
  int n;
  long long int sche[n];
  memset(sche, 0, sizeof(sche));
  while(cin >> n, n){
    for (int i = 0; i < n; i++) {
      int x;
      cin >> x;
      for (int j = 0; j < x; j++) {
        int tmp;
        cin >> tmp;
        sche[i] |= 1<<(tmp - 1);
      }
    }
    long long int used = 0;
    int day = 0;
    while(used != (1LL<<n) - 1 && day <= 30){
      for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
          if(i == j)continue;
          if((sche[i]&(1LL<<day)) > 0 &&
             (sche[j]&(1LL<<day)) > 0){
            used |= (1LL<<i);
            used |= (1LL<<j);
          }
        }
      }
      day++;
    }
    if(day <= 30)std::cout << day << std::endl;
    else std::cout << -1 << std::endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:8:3: error: 'memset' was not declared in this scope
    8 |   memset(sche, 0, sizeof(sche));
      |   ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<vector>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include<iostream>
#include<cstring>
#include<vector>
using namespace std;

int main(int argc, char *argv[]){
  long long int n;
  while(cin >> n, n){
    long long int sche[n];
    vector<long long int> used(n, 0);
    memset(sche, 0, sizeof(sche));
    for (int i = 0; i < n; i++) {
      used[i] += (1LL << i);
      int x;
      cin >> x;
      for (int j = 0; j < x; j++) {
        int tmp;
        cin >> tmp;
        sche[i] |= 1 << (tmp - 1);
      }
    }

    int day;
    for (day = 0; day <= 30; day++) {
      for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
          if((sche[i]&(1LL << day)) && (sche[j]&(1LL << day))){
            used[i] = used[j] = (used[i] | used[j]);
          }
        }
      }
      if(find(used.begin(), used.end(), (1LL << n) - 1) != used.end()){
        std::cout << day + 1 << std::endl;
        break;
      }
    }
    if(day > 30){
      std::cout << -1 << std::endl;
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:32:14: error: no matching function for call to 'find(std::vector<long long int>::iterator, std::vector<long long int>::iterator, long long int)'
   32 |       if(find(used.begin(), used.end(), (1LL << n) - 1) != used.end()){
      |          ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:32:14: note:   '__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   32 |       if(find(used.begin(), used.end(), (1LL << n) - 1) != used.end()){
      |          ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<cstring>
#include<vector>
#include<algorithm
using namespace std;

int main(int argc, char *argv[]){
  long long int n;
  while(cin >> n, n){
    long long int sche[n];
    vector<long long int> used(n, 0);
    memset(sche, 0, sizeof(sche));
    for (int i = 0; i < n; i++) {
      used[i] += (1LL << i);
      int x;
      cin >> x;
      for (int j = 0; j < x; j++) {
        int tmp;
        cin >> tmp;
        sche[i] |= 1 << (tmp - 1);
      }
    }

    int day;
    for (day = 0; day <= 30; day++) {
      for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
          if((sche[i]&(1LL << day)) && (sche[j]&(1LL << day))){
            used[i] = used[j] = (used[i] | used[j]);
          }
        }
      }
      if(find(used.begin(), used.end(), (1LL << n) - 1) != used.end()){
        std::cout << day + 1 << std::endl;
        break;
      }
    }
    if(day > 30){
      std::cout << -1 << std::endl;
    }
  }
  return 0;
}

Compiler output:
a.cc:4:19: error: missing terminating > character
    4 | #include<algorithm
      |                   ^
Language: C++

#include <vector>
#include <numeric>
#include <iostream>

using namespace std;

int n, f, r;

int main()
{
    scanf("%d", &n);
    
    vector<vector<bool> > c(n, vector<bool>(30, false));
    
    for(int i = 0; i < n; i++)
    {
        scanf("%d", &f);
        
        for(int j = 0; j < f; j++)
        {
            scanf("%d", &r);
            
            c[i][r - 1] = true;
        }
    }
    
    vector<vector<int> > D(n, vector<int>(n, -1)));
    
    for(int i = 0; i < n; i++)
    {
        for(int j = i + 1; j < n; j++)
        {
            for(int k = 0; k < 30; k++)
            {
                if(c[i][k] == true && c[j][k] == true)
                {
                    D[i][j] = k; break;
                }
            }
        }
    }
    
    vector<int> d(n); iota(d.begin(), d.end(), 0);
    
    for(int i = 0; i < 30; i++)
    {
        for(int j = 0; j < n; j++)
        {
            for(int k = j + 1; k < n; k++)
            {
                if(D[j][k] == i)
                {
                    for(int l = 0; l < n; l++)
                    {
                        if(d[l] == d[k] && k != l)
                        {
                            d[l] = d[j];
                        }
                    }
                    
                    d[k] = d[j];
                }
            }
        }
        
        bool ok = true;
        
        for(int i = 0; i < n; i++) ok = ok && (d[i] == 0);
        
        if(ok)
        {
            printf("%d\n", i + 1); return 0;
        }
    }
    
    printf("-1\n");
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:50: error: expected ',' or ';' before ')' token
   27 |     vector<vector<int> > D(n, vector<int>(n, -1)));
      |                                                  ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main()
{
  int n;
  while(cin >> n, n){
    bool schedule[51][31];
    fill(schedule[0], schedule[51], false);
    for(int i = 0; i < n; i++){
      int f; cin >> f;
      for(int j = 0; j < f; j++){
	int d; cin >> d;
	schedule[i][d] = true;#include <bits/stdc++.h>

using namespace std;

int main()
{
  int n;
  while(cin >> n, n){
    bool schedule[51][31];
    fill(schedule[0], schedule[51], false);
    for(int i = 0; i < n; i++){
      int f; cin >> f;
      for(int j = 0; j < f; j++){
	int d; cin >> d;
	schedule[i][d] = true;
      }
    }
    long long dp[51];
    fill(dp, dp + 51, 0LL);
    int ans = -1;
    for(int i = 0; i < n; i++) dp[i] |= 1LL << i;
    for(int i = 1; i <= 30; i++){
      long long p = 0LL;
      for(int j = 0; j < n; j++){
	if(schedule[j][i]) p |= dp[j];
      }
      for(int j = 0; j < n; j++){
	if(schedule[j][i]) dp[j] = p;
      }
      if(p == (1LL << n) - 1){
	ans = i;
	break;
      }
    }
    cout << ans << endl;
  }
  return 0;
}

      }
    }
    long long dp[51];
    fill(dp, dp + 51, 0LL);
    int ans = -1;
    for(int i = 0; i < n; i++) dp[i] |= 1LL << i;
    for(int i = 1; i <= 30; i++){
      long long p = 0LL;
      for(int j = 0; j < n; j++){
	if(schedule[j][i]) p |= dp[j];
      }
      for(int j = 0; j < n; j++){
	if(schedule[j][i]) dp[j] = p;
      }
      if(p == (1LL << n) - 1){
	ans = i;
	break;
      }
    }
    cout << ans << endl;
  }
  return 0;
}

Compiler output:
a.cc:15:31: error: stray '#' in program
   15 |         schedule[i][d] = true;#include <bits/stdc++.h>
      |                               ^
a.cc: In function 'int main()':
a.cc:15:32: error: 'include' was not declared in this scope
   15 |         schedule[i][d] = true;#include <bits/stdc++.h>
      |                                ^~~~~~~
a.cc:15:41: error: 'bits' was not declared in this scope
   15 |         schedule[i][d] = true;#include <bits/stdc++.h>
      |                                         ^~~~
a.cc:15:46: error: 'stdc' was not declared in this scope; did you mean 'std'?
   15 |         schedule[i][d] = true;#include <bits/stdc++.h>
      |                                              ^~~~
      |                                              std
a.cc:17:1: error: expected primary-expression before 'using'
   17 | using namespace std;
      | ^~~~~
a.cc:19:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   19 | int main()
      |         ^~
a.cc:19:9: note: remove parentheses to default-initialize a variable
   19 | int main()
      |         ^~
      |         --
a.cc:19:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:20:1: error: a function-definition is not allowed here before '{' token
   20 | {
      | ^
Language: C++

#include<vector>
#include<algorithm>
using namespace std;
int main(){
  int n,m,a;
  cin >> n;
  while(n!=0){
    int i,j,k,l;
    int v[51][31]={{}};
    for(i=0;i<n;i++){
      cin >> m;
      for(j=0;j<m;j++){
	cin >> a;
	v[i][a]=1;
      }
    }
    vector <int> g[51];
    vector <int> p[51];
    for(i=0;i<n;i++) g[i].push_back(i);
    bool f =false,x;
    for(i=1;i<31;i++){
      //cout << "day" << i << endl;
      for(k=0;k<n;k++) {
	sort(g[i].begin(),g[i].end());
	g[i].erase(unique(g[i].begin(), g[i].end()), g[i].end());
	p[k].clear();
	for(l=0;l<g[k].size();l++) p[k].push_back(g[k][l]);
	//for(l=0;l<p[k].size();l++) cout << p[k][l] << " ";
	//cout << endl;
      }
      for(j=0;j<n;j++){
	if(v[j][i]==0) continue;
	for(k=j+1;k<n;k++){
	  if(v[k][i]==0) continue;
	  //cout << i << ":" << j << ":" << k << endl;
	  for(l=0;l<p[j].size();l++) g[k].push_back(p[j][l]);
	  for(l=0;l<p[k].size();l++) g[j].push_back(p[k][l]);
	}
      }
      bool li[51];
      for(j=0;j<n;j++) {
	for(k=0;k<n;k++) li[k]=false;
	for(k=0;k<g[j].size();k++) {
	  //cout << g[j][k] << " ";
	  li[g[j][k]]=true;
	}
	//cout << endl;
	x=true;
	for(k=0;k<n;k++) if(!li[k]) x=false;
	if(x){
	  f=true;
	  break;
	}
      }
      if(f) {
	cout << i << endl;
	break;
      }
    }
    if(!f) cout << -1 << endl;
    cin >> n;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> n;
      |   ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include<algorithm>
  +++ |+#include <iostream>
    3 | using namespace std;
a.cc:56:9: error: 'cout' was not declared in this scope
   56 |         cout << i << endl;
      |         ^~~~
a.cc:56:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:56:22: error: 'endl' was not declared in this scope
   56 |         cout << i << endl;
      |                      ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include<algorithm>
  +++ |+#include <ostream>
    3 | using namespace std;
a.cc:60:12: error: 'cout' was not declared in this scope
   60 |     if(!f) cout << -1 << endl;
      |            ^~~~
a.cc:60:12: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:60:26: error: 'endl' was not declared in this scope
   60 |     if(!f) cout << -1 << endl;
      |                          ^~~~
a.cc:60:26: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define pi M_PI
#define EPS 1e-6
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

int main() {
    int n, m = 32;
    while (cin >> n && n && loop--){
        int f[50][32] = {};
        REP(i,n){
            int a;
            cin >> a;
            while (a--){
                int x;
                cin >> x;
                f[i][x-1] = 1;
            }
        }
        bool imp = 1;
        VL dp(n);
        REP(i,n) dp[i] = 1LL<<i;
        REP(j,m){
            ll x = 0;
            REP(i,n){
                if (f[i][j]) x |= dp[i];
            }
            REP(i,n){
                if (f[i][j]) dp[i] = x;
            }

            if (x == (1<<n)-1){
                cout << j+1 << endl;
                imp = 0;
                break;
            }
        }
        if (imp) cout << -1 << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:29: error: 'loop' was not declared in this scope
   30 |     while (cin >> n && n && loop--){
      |                             ^~~~