Language: C++

#include <bits/stdc++.h>
using namespace std;
/*cout <<"Debug"
cout <<x-30<<' '<<y-30<<endl;*/
vector<string>v;
vector<int>ansl;
string s;
int ary[100005] = {0};
int lst[200][200];
int cnt = 0;
int d_x[] = {1, 1, 0, -1, -1, 0};
int d_y[] = {1, 0, -1, -1, 0, 1};
int t;
/*
void dfs(int x,int y,int lpcnt){
  mp[x][y] = 1;
  cout <<"Debug ";
  cout <<x-30<<' '<<y-30<<endl;
  cnt++;
  lpcnt++;
  int watasi = lpcnt;
  int used[6] = {0};
  for(int dx = 0;dx<6;dx++){
    int nx = x+d_x[dx],ny = y+d_y[dx];
    int dft = sqrt((nx-30)*(nx-30)+(ny-30)*(ny-30));
    if((dft<=30)&&(watasi < t)&&(mp[nx][ny] == 0)){
        dfs(nx,ny,watasi);
        used[dx] = 1;
    }
    for(int i = 0;i<6;i++){
      if(used[i]){
        if((nx == x + d_x[i])&&(ny == y + d_y[i])){
          dfs(nx,ny,watasi);
        }
      }
    }
    }
}
*/
int main(){
  int N;

  cin >>N;
  while(N != 0){
    int num = 1,flg = 0 ,ans = 0;
    int roueied[101] = {1000};
    for(int i = 0;i<200;i++){
      for(int j = 0;j<200;j++){
        lst[i][j] = 1000;
      }
    }
    for(int i = 1;i<=N;i++){
      int M;
      cin >>M;
      lst[i][0] = M;
      for(int j = 1;j<=M;j++){
        cin >>lst[i][j];
      }
    }

    int k;
    cin >>k;
    for(int i = 0;i<k;i++){
      cin >>roueied[i];
    }

    for(int i = 1;i<=N;i++){
      if(lst[i][0] < k)continue;

      int visited[101];
      for(int j = 0;j<k;j++){
        visited[j] = 1;
      }

      for(int j = 1;j<=lst[i][0];j++){
        for(int z = 0; z < k ; z++){
          if(lst[i][j] == roueied[z]){
            visited[z] =  0;
          }

        }
      }
      /*for(int j = 0;j<k;j++){
        /*cout <<"Debug visited"<<visited[i]<<endl;*/
      }
      /*cout <<"Debug "<<accumulate(visited,visited+k,0) <<endl;*/
        if((accumulate(visited,visited+k,0) == 0 )&&(flg == 1)){
          ans = -1;
          break;
        }
        if(accumulate(visited,visited+k,0) == 0){
          flg = 1;
          ans = i;
        }

      }
      if((ans == -1)||(flg == 0)){
        ans = -1;
    }
    ansl.push_back(ans);
    cin >>N;
  }


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



Compiler output:
a.cc: In function 'int main()':
a.cc:87:24: error: 'visited' was not declared in this scope
   87 |         if((accumulate(visited,visited+k,0) == 0 )&&(flg == 1)){
      |                        ^~~~~~~
a.cc:91:23: error: 'visited' was not declared in this scope
   91 |         if(accumulate(visited,visited+k,0) == 0){
      |                       ^~~~~~~
a.cc:93:17: error: 'i' was not declared in this scope
   93 |           ans = i;
      |                 ^
a.cc:97:11: error: 'ans' was not declared in this scope; did you mean 'ansl'?
   97 |       if((ans == -1)||(flg == 0)){
      |           ^~~
      |           ansl
a.cc:97:24: error: 'flg' was not declared in this scope
   97 |       if((ans == -1)||(flg == 0)){
      |                        ^~~
a.cc:100:20: error: 'ans' was not declared in this scope; did you mean 'ansl'?
  100 |     ansl.push_back(ans);
      |                    ^~~
      |                    ansl
a.cc: At global scope:
a.cc:105:3: error: expected unqualified-id before 'for'
  105 |   for(int i = 0;i<(int)ansl.size();i++){
      |   ^~~
a.cc:105:17: error: 'i' does not name a type
  105 |   for(int i = 0;i<(int)ansl.size();i++){
      |                 ^
a.cc:105:36: error: 'i' does not name a type
  105 |   for(int i = 0;i<(int)ansl.size();i++){
      |                                    ^
a.cc:108:3: error: expected unqualified-id before 'return'
  108 |   return 0;
      |   ^~~~~~
a.cc:109:1: error: expected declaration before '}' token
  109 | }
      | ^