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

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

//define
#define ALL(a) a.begin(),a.end()
#define REP(i,n) for(int i=0;i<n;i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)
#define debug(x) if(1) cout<<#x<<":"<<x<<endl;
#define DEBUG(x) if(1) cout<<#x<<":"<<x<<endl;
#define ll long long

//constant
const int MOD=1000000007;
const int INF=INT_MAX/3-1;
const double EPS=1e-9;
const int dx4[]={1,0,-1,0};
const int dy4[]={0,1,0,-1};

//typedef
typedef vector<int> vi;
typedef vector<vector<int>> vvi;

bool isRange(int x,int y){
    return 0<=x && x<=60 && 0<=y && y<=60;

}

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

int main(){
    int n,t;
    while(cin>>t>>n,t){
        vvi ob(61,vi(61,0));
        vvi iscan(61,vi(61,0));
        int x,y;
        REP(i,n) cin>>x>>y,ob[x+30][y+30]=1;
        cin>>x>>y;
        queue<tuple<int,int,int>> q;
        q.push(make_tuple(x+30,y+30,0));
        while(!q.empty()){
            auto now=q.front();
            q.pop();
            int x=get<0>(now);
            int y=get<1>(now);
            int turn=get<2>(now);
            iscan[x][y]=1;
            if(turn>=t)
                continue;
            REP(i,6){
             int nx=x+dx[i];
             int ny=y+dy[i];
             if(isRange(nx,ny))
 　　　　if(!ob[nx][ny]&&!iscan[nx][ny])
                q.push(make_tuple(nx,ny,turn+1));
            }
        }
      int cnt=0;
        REP(i,61)
            REP(j,61)
                if(iscan[i][j])
                    cnt++;
        cout<<cnt<<endl;


    }


}


                   

Compiler output:
a.cc:54:2: error: extended character 　 is not valid in an identifier
   54 |  　　　　if(!ob[nx][ny]&&!iscan[nx][ny])
      |  ^
a.cc:54:2: error: extended character 　 is not valid in an identifier
a.cc:54:2: error: extended character 　 is not valid in an identifier
a.cc:54:2: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:54:2: error: '\U00003000\U00003000\U00003000\U00003000if' was not declared in this scope
   54 |  　　　　if(!ob[nx][ny]&&!iscan[nx][ny])
      |  ^~~~~~~~~~
Language: C++

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

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

bool isrange(int x,int y){
    return 0<=x && x<=60 && 0<=y && y<=60;
}
int main()
{
    int t,n;
    while(cin>>t>>n,t){
        vector<vector<int>> ob(61,vector<int>(61,0));
        for(int i=0;i<n;i++){
            int x,y;
            cin>>x>>y;
            x+=30;
            y+=30;
            ob[x][y]=1;
        }
        pair<int,int> s;
        cin>>s.first>>s.second;
        s.first+=30;
        s.second+=30;
        vector<vector<int>> been(61,vector<int>(61,0));
        been[s.first][s.second]=1;
        queue<pair<pair<int,int>,int>> q;
        q.push(make_pair(s,0));
        int cnt=1;
        while(!q.empty()){
            auto ele=q.front();
            q.pop();
            auto p=ele.first;
            int turn=ele.second;
            if(turn==t)
                continue;
            if(turn>t)
                for(;;){}

            for(int i=0;i<6;i++){
                int tox=p.first+dx[i];
                int toy=p.second+dy[i];
                if(isrange(tox,toy) && !ob[tox][toy] && !been[tox][toy]){
                    if(turn==t)
                    continue;
                    been[tox][toy]=1;
                    cnt++;
                    q.push(make_pair(make_pair(tox,toy),turn+1));

                }

            }

        }
        cout<<cnt<<endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:56:25: error: expected '}' at end of input
   56 |         cout<<cnt<<endl;
      |                         ^
a.cc:13:23: note: to match this '{'
   13 |     while(cin>>t>>n,t){
      |                       ^
a.cc:56:25: error: expected '}' at end of input
   56 |         cout<<cnt<<endl;
      |                         ^
a.cc:11:1: note: to match this '{'
   11 | {
      | ^
Language: C++

#include<iostream>
#include<queue>
#include<vector>
#include<utility>
#include<algorithm>

using namespace std;

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

int vec1[]={0,1,-1,1,-1,0};
int vec2[]={1,1,0,0,-1,-1};

int t,n;
int table[200][200];

typedef pair<int,int> pii;
typedef pair<int,pii> piii;
queue<piii> q1;

int ans;

int solve(int y,int x){
	queue<piii> p;
	q1.push(make_pair(0,make_pair(y,x)));
	while(!q1.empty()){
		if(t <= q1.front().first)
			return 0;
		REP(i,6){
			int n_y = q1.front().second.first + vec1[i];
			int n_x = q1.front().second.second + vec2[i];
			if(table[n_y][n_x] = 0){
				ans++;
				table[n_y][n_x] = 1;
				q1.push(make_pair(q1.front().first + 1,make_pair(n_y,n_x)));
			}
		}
		q1.pop();
	}
	return 0;
}


int main(){
	while(cin>>t>>n,t+n){
		ans = 0;
		fill_n(table[0],200*200,0)
		REP(i,n){
			int x,y;
			cin>>x>>y;
			table[100+y][100+x] = 1;
		}
		int x,y;
		cin>>x>>y;
		table[100+y][100+x] = 1;
		solve(100+y,100+x);
		cout<<ans+1<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:43: error: expected ';' before 'for'
   47 |                 fill_n(table[0],200*200,0)
      |                                           ^
      |                                           ;
a.cc:48:21: error: 'i' was not declared in this scope
   48 |                 REP(i,n){
      |                     ^
a.cc:9:30: note: in definition of macro 'REP'
    9 | #define REP(i,n) for(int i=0;i<n;i++)
      |                              ^
Language: C++

#include <iostream>
#include <vector>
#include <queue>
using namespace std;
vector<int> ox; //障害物のx座標
vector<int> oy; //障害物のy座標

class State{
public:
  int x,y,cost;

  State(){}
  State(int _x,int _y,int _cost){
    x = _x;
    y = _y;
    cost = _cost;
  }
};

int Breadth_First_Search(int t, int n, int sx, int sy) {
  static const int dx[] = {-1,-1,0,1,1,0};
  static const int dy[] = {-1,0,1,1,0,-1};
  bool closed[100][100];
  int count = 0;
  queue<State> open;
  open.push(State(sx,sy,0));
  memset(closed,0,sizeof(closed));

  for(int i = 0; i < t; i++){
    closed[ox[i]][oy[i]] = true;
  }

  while(!open.empty()){
    State st = open.front();
    open.pop();

    if(closed[st.x][st.y] || st.cost > n)
      continue;
    closed[st.x][st.y] = true;

    count++;

    for(int i = 0; i < 6; i++) {
      int nx = st.x + dx[i];
      int ny = st.y + dy[i];
      open.push(State(nx, ny, st.cost + 1));
    }
  }

  return count;
}

int main() {
  int t; //ターン数
  int n; //障害物の数
  int sx, sy; //スタートマス

  while(1){
    cin >> t >> n;
    if(t == 0 && n == 0)
      break;

    for(int i = 0; i < n; i++) {
      int X, Y;
      cin >> X >> Y;
      X += 50;
      Y += 50;
      ox.push_back(X);
      oy.push_back(Y);
    }

    cin >> sx >> sy;
    sx += 50;
    sy += 50;

    cout << Breadth_First_Search(t, n, sx, sy) << endl;
  }
  return 0;
}



Compiler output:
a.cc: In function 'int Breadth_First_Search(int, int, int, int)':
a.cc:27:3: error: 'memset' was not declared in this scope
   27 |   memset(closed,0,sizeof(closed));
      |   ^~~~~~
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 <queue>
using namespace std;
vector<int> ox; //障害物のx座標
vector<int> oy; //障害物のy座標

class State{
public:
  int x,y,cost;

  State(){}
  State(int _x,int _y,int _cost){
    x = _x;
    y = _y;
    cost = _cost;
  }
};

int Breadth_First_Search(int t, int n, int sx, int sy) {
  static const int dx[] = {-1,-1,0,1,1,0};
  static const int dy[] = {-1,0,1,1,0,-1};
  bool closed[100][100];
  int count = 0;
  queue<State> open;
  open.push(State(sx,sy,0));
  memset(closed,0,sizeof(closed));

  for(int i = 0; i < t; i++){
    closed[ox[i]][oy[i]] = true;
  }

  while(!open.empty()){
    State st = open.front();
    open.pop();

    if(closed[st.x][st.y] || st.cost > n)
      continue;
    closed[st.x][st.y] = true;

    count++;

    for(int i = 0; i < 6; i++) {
      int nx = st.x + dx[i];
      int ny = st.y + dy[i];
      open.push(State(nx, ny, st.cost + 1));
    }
  }

  return count;
}

int main() {
  int t; //ターン数
  int n; //障害物の数
  int sx, sy; //スタートマス

  while(1){
    cin >> t >> n;
    if(t == 0 && n == 0)
      break;

    for(int i = 0; i < n; i++) {
      int X, Y;
      cin >> X >> Y;
      X += 50;
      Y += 50;
      ox.push_back(X);
      oy.push_back(Y);
    }

    cin >> sx >> sy;
    sx += 50;
    sy += 50;

    cout << Breadth_First_Search(t, n, sx, sy) << endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int Breadth_First_Search(int, int, int, int)':
a.cc:27:3: error: 'memset' was not declared in this scope
   27 |   memset(closed,0,sizeof(closed));
      |   ^~~~~~
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 <queue>
using namespace std;
vector<int> ox; //障害物のx座標
vector<int> oy; //障害物のy座標

class State{
public:
  int x, y, cost;

  State(){}
  State(int _x,int _y,int _cost){
    x = _x;
    y = _y;
    cost = _cost;
  }
};

int Breadth_First_Search(int t, int n, int sx, int sy) {
  static const int dx[] = {-1,-1,0,1,1,0};
  static const int dy[] = {-1,0,1,1,0,-1};
  bool closed[100][100];
  int count = 0;
  queue<State> open;
  open.push(State(sx,sy,0));
  memset(closed,0,sizeof(closed));

  for(int i = 0; i < t; i++){
    closed[ox[i]][oy[i]] = true;
  }

  while(!open.empty()){
    State st = open.front();
    open.pop();

    if(closed[st.x][st.y] || st.cost > n)
      continue;
    closed[st.x][st.y] = true;

    count++;

    for(int i = 0; i < 6; i++) {
      int nx = st.x + dx[i];
      int ny = st.y + dy[i];
      open.push(State(nx, ny, st.cost + 1));
    }
  }

  return count;
}

int main() {
  int t; //ターン数
  int n; //障害物の数
  int sx, sy; //スタートマス

  while(1){
    cin >> t >> n;
    if(t == 0 && n == 0)
      break;

    for(int i = 0; i < n; i++) {
      int X, Y;
      cin >> X >> Y;
      X += 50;
      Y += 50;
      ox.push_back(X);
      oy.push_back(Y);
    }

    cin >> sx >> sy;
    sx += 50;
    sy += 50;

    cout << Breadth_First_Search(t, n, sx, sy) << endl;
  }
  return 0;
}



Compiler output:
a.cc: In function 'int Breadth_First_Search(int, int, int, int)':
a.cc:27:3: error: 'memset' was not declared in this scope
   27 |   memset(closed,0,sizeof(closed));
      |   ^~~~~~
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 <queue>
#include <string.h>
using namespace std;

class State{
public:
  int x,y,cost;

  State(){}
  State(int _x,int _y,int _cost){
    x = _x;
    y = _y;
    cost = _cost;
  }
};

int n,m;
int sx,sy;
bool t[1000][1000];
bool closed[1000][1000];
int dx[] = {0,1,1,0,-1,-1};
int dy[] = {1,1,0,-1,-1,0};

void solve(){
  queue<State> open;
  memset(closed,0,sizeof(closed));
  open.push(State(sx,sy,0));

  int ans = 0;

  while(!open.empty()){
    State st = open.front(); open.pop();
    if(closed[st.x][st.y] || st.cost>n || t[st.y][st.x]) continue;
    closed[st.x][st.y] = true;

    ans++;

    for(int i = 0; i < 6; i++){
      int nx = st.x + dx[i];
      int ny = st.y + dy[i];
      open.push(State(nx,ny,st.cost+1));
    }
  }

  cout<<ans<<endl;
}

int main(){
  while(cin>>n>>m,n||m){
    memset(t,0,sizeof(t));
    for(i = 0; i < m; i++){
      int x,y;
      cin>>x>>y;
      x += 300;
      y += 300;
      t[y][x] = true;
    }

    cin>>sx>>sy;
    sx += 300;
    sy += 300;

    solve();
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:53:9: error: 'i' was not declared in this scope
   53 |     for(i = 0; i < m; i++){
      |         ^
Language: C++

#include "iostream"
#include "random"
#include "ctime"
#include "chrono"
#include "string"
#include "bitset"
#include "algorithm"
#include "map"
#include "queue"
#include "list"

using namespace std;


int main() {
	
	int dir_y[] = { 1,1,0,-1,-1,0 };
	int dir_x[] = { 0,1,1,0,-1,-1 };
	int N, K;
	list<int>ret;
	cin >> N >> K;
	while (N) {
		vector<vector<int>>v(100, vector<int>(100, INT_MAX));
		for (int i = 0; i < K; i++) {
			int y, x;
			cin >> y >> x;
			y += 50;
			x += 50;
			v[y][x] = -1;
		}
		int sy, sx;
		cin >> sy >> sx;
		sy += 50;
		sx += 50;
		queue<pair<int,int>>Q;
		Q.push({ sy,sx });
		v[sy][sx] = 0;
		int cnt = 0;
		while (cnt<=N&&!Q.empty()) {
			int cy = Q.front().first;
			int cx = Q.front().second;
			cnt = max(cnt, v[cy][cx] + 1);
			Q.pop();
			for (int i = 0; i < 6; i++) {
				int ny = cy + dir_y[i];
				int nx = cx + dir_x[i];
				if (v[ny][nx]>cnt) {
					v[ny][nx] = cnt;
					Q.push({ ny,nx });
				}
			}
		}
		int ans = 0;
		for (auto i : v) {
			for (auto j : i) {
				if (j >= 0 && j <= N) {
					ans++;
				}
			}
		}
		ret.push_back(ans);
		cin >> N >> K;
	}
	for (auto i : ret) {
		cout << i << endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:60: error: 'INT_MAX' was not declared in this scope
   23 |                 vector<vector<int>>v(100, vector<int>(100, INT_MAX));
      |                                                            ^~~~~~~
a.cc:11:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   10 | #include "list"
  +++ |+#include <climits>
   11 |
Language: C++

#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <set>
#include <cstring>
#include <cmath>
#include <queue>
using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, k, n) for (int i = (int)(k); i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n)-1; i >= 0; i--)
#define rREP(i, k, n) for (int i = (int)(n)-1; i >= k; i--)

#define debug(x) cerr<<#x<<": "<<x<<endl;

#define fi first
#define se second

#define vi vector<int>
#define pb push_back
#define mp make_pair

#define pcnt __builtin_popcount

typedef long long ll;

const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
const int mid = 35;
const int dx[6] = {1,-1,1,0,-1,0};
const int dy[6] = {1,-1,0,1,0,-1};

bool g[70][70] = {};
int u[70][70] = {};

void bfs(int y,int x,int et){
    queue<int> qx;
    queue<int> qy;
    queue<int> qt;
    qx.push(x);
    qy.push(y);
    qt.push(1);
    u[y+35][x+35]=t;
    while(!qx.empty()){
        x = qx.front();
        y = qy.front();
        t = qt.front();
        qx.pop();qy.pop();qt.pop();
        if(t>et) continue;
        rep(i,6){
            int nx = x+dx[i];
            int ny = y+dy[i];
            if(nx<-30||nx>30||ny<-30||ny>30) continue;
            if(g[ny+35][nx+35]==false){
                u[ny+35][nx+35] = t;
                qx.push(nx);
                qy.push(ny);
                qt.push(t+1);
            }
        }
    }
}

int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    int t,n;

while(cin >> t >> n,t){
    rep(y,70)rep(x,70){g[y][x]=0;u[y][x]=0;}
    rep(i,n){
        int x,y;
        cin >> x >> y;
        g[y+35][x+35] = true;
    }
    int x,y;
    cin >> x >> y;
    bfs(y,x,t);
    int a=0;
    rep(y,70)rep(x,70)if(u[y][x]>0)a++;
    cout << a << endl;
}
    return 0;
}



Compiler output:
a.cc: In function 'void bfs(int, int, int)':
a.cc:46:19: error: 't' was not declared in this scope; did you mean 'qt'?
   46 |     u[y+35][x+35]=t;
      |                   ^
      |                   qt
Language: C++

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

int main(){
  int x,y;
  int dx[] = {1,0,1,-1,0,-1};
  int dy[] = {0,1,1,0,-1,-1};
  int map[200][200];
  int t,n,ans;
  queue<int> qx,qy;

  while(1){
    cin >> t >> n;
    if(!t && !n)break;

    memset(map,0,sizeof(map));
    for(int i=0;i<n;i++){
      cin >> x >> y;
      map[100+y][100+x] = -1;
    }

    cin >> x >> y;
    map[100+y][100+x] = 1;
    qx.push(x);
    qy.push(y);

    ans = 1;
    while(qx.size()){
      x = qx.front();
      y = qy.front();
      qx.pop();
      qy.pop();

      if(map[100+y][100+x]<=t){
	for(int i=0;i<6;i++){
	  if(map[100+y+dy[i]][100+x+dx[i]] == 0){
	    qx.push(x+dx[i]);
	    qy.push(y+dy[i]);
	    map[100+y+dy[i]][100+x+dx[i]] = map[100+y][100+x] + 1;
	    ans++;
	  }
	}
      }
    }
    cout << ans << endl;
  }
}

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

#define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f
#include <cstdio>
#include <iostream>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <cctype>
#include <utility>
 
using namespace std;
 
typedef long long ll;
typedef pair <int,int> P;
typedef pair <int,P > PP;
 
int tx[] = {0,1,1,0,-1,-1};
int ty[] = {1,1,0,-1,-1,0};
 
static const double EPS = 1e-8;

class State{
public:
  int mLife;
  int mX;
  int mY;
  State(int life,int x,int y) : mLife(life), mX(x), mY(y) {}
  bool operator <(const State& s) const{
    return mLife < s.mLife;
  }

  bool operator >(const State& s) const{
    return mLife > s.mLife;
  }
};

int CoundVisitedCell(map<P,int>& stage){
  int count = 0;
  for(int y=-30;y<=30;y++){
    for(int x=-30;x<=30;x++){
      if(stage.find(P(x,y)) == stage.end()) continue;
      if(stage[P(x,y)] >= 0) count++;
    }
  }
  return count;
}


int main(){
  int t,n;
  while(~scanf("%d %d",&t,&n)){

    if(t==0 && n==0) break;

    map<P,int> stage;
    for(int i=0;i<n;i++){
      int x,y;
      scanf("%d %d",&x,&y);
      //0:unvisited
      //1:obstacle
      //2:visited
      stage[P(x,y)] = -1;
    }

    int sx,sy;
    scanf("%d %d",&sx,&sy);

    if(stage.find(P(sx,sy)) != stage.end()
       && stage[P(sx,sy)] == -1) goto last;

    priority_queue<State,vector<State> > que;
    que.push(State(t,sx,sy));
    stage[P(sx,sy)] = t;

    while(!que.empty()){
      State s = que.top();
      que.pop();

      if(s.mLife <= 0) continue;

      for(int i=0;i<6;i++){
	int dx = s.mX + tx[i];
	int dy = s.mY + ty[i];
	if(abs(dx) > 30 || abs(dy) > 30) continue;
	if(stage.find(P(dx,dy)) != stage.end()
	   && stage[P(dx,dy)] == -1) continue;
	if(stage.find(P(dx,dy)) != stage.end() 
	   && stage[P(dx,dy)] <= s.mLife-1) continue;

	stage[P(dx,dy)] = s.mLife-1;
	que.push(State(s.mLife-1,dx,dy));
      }
    }

  last:;
    int res = CoundVisitedCell(stage);
    printf("%d\n",res);
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:106:3: error: jump to label 'last'
  106 |   last:;
      |   ^~~~
a.cc:80:39: note:   from here
   80 |        && stage[P(sx,sy)] == -1) goto last;
      |                                       ^~~~
a.cc:82:42: note:   crosses initialization of 'std::priority_queue<State, std::vector<State> > que'
   82 |     priority_queue<State,vector<State> > que;
      |                                          ^~~
Language: C++


#include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
#include <functional>
#include <utility>
#include <set>
using namespace std;
typedef pair<int,int> pii;
typedef pair<pii,int> piii;
int dx[]={0,1,1,0,-1,-1};
int dy[]={1,1,0,-1,-1,0};
int main()
{
	int t,n;
	while(cin>>t>>n,t!=0){
		vector<pii> jama(n);
		int sx,sy;
		for(int i=0;i<n;i++){
			int x,y;
			cin>>x>>y;
			jama.push_back(pii(x,y));
		}
		cin>>sx>>sy;
		set<pii> visited;
		queue<piii> q;
		q.push(piii(pii(sx,sy),0));
		while(q.front().second<=n){
			piii fr=q.front();
			q.pop();
			if(visited.find(fr.first)!=visited.end())continue;
			for(int i=0;i<6;i++){
				pii cur(fr.first.first+dx[i],fr.first.second+dy[i]);
				if(visited.find(cur)==visited.end()&&jama.find(cur)==jama.end())q.push(piii(cur,fr.second+1));
			}
		}
	}
	
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:75: error: 'class std::vector<std::pair<int, int> >' has no member named 'find'
   35 |                                 if(visited.find(cur)==visited.end()&&jama.find(cur)==jama.end())q.push(piii(cur,fr.second+1));
      |                                                                           ^~~~
Language: C++

#include <cstring>
#include <queue>

using namespace std;

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

class state {
public:
    int x, y, t;
    state(int a, int b, int c) { x = a; y = b; t = c; }
};

int main()
{
    int t, n;

    while (cin >> t >> n, t || n) {
        int map[100][100]; // 0: 未到達   1: 敵    2: 到達済み
        int t_x, t_y, s_x, s_y;
        int ans = 0;
        
        memset(map, 0, sizeof(map));
        for (int i = 0; i < n; i++) {
            cin >> t_x >> t_y;
            map[t_y + base][t_x + base] = 1;
        }
        cin >> s_x >> s_y;

        queue<state> q;
        q.push(state(s_x + base, s_y + base, 0));
        map[s_y + base][s_x + base] = 2;
        ans++;

        while (!q.empty()) {
            state now = q.front();
            q.pop();

            for (int i = 0; i < 6; i++) {
                int nx = now.x + dx[i];
                int ny = now.y + dy[i];

                if (map[ny][nx] == 1 || map[ny][nx] == 2)
                    continue;
                if (now.t + 1 > t)
                    continue;
                map[ny][nx] = 2;
                ans++;
                q.push(state(nx, ny, now.t + 1));
            }
        }

        cout << ans << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:12: error: 'cin' was not declared in this scope
   20 |     while (cin >> t >> n, t || n) {
      |            ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <queue>
  +++ |+#include <iostream>
    3 | 
a.cc:55:9: error: 'cout' was not declared in this scope
   55 |         cout << ans << endl;
      |         ^~~~
a.cc:55:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:55:24: error: 'endl' was not declared in this scope
   55 |         cout << ans << endl;
      |                        ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include <queue>
  +++ |+#include <ostream>
    3 |
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>
#include <array>

using namespace std;

typedef std::array<bool, 63> Line;
typedef std::array<Line, 63> Table;

Table table; // [X][Y]
std::array< std::array<int, 63>, 63> standed; // [X][Y]

int current_x;
int current_y;
int g_count;
int g_turn;
int g_current_turn;

int g_dx[] = { 0, 1, 1, 0, -1, -1 };
int g_dy[] = { 1, 1, 0, -1, -1, 0 };

int calc(int x) {
	return x + 32;
}

void solution() {
	if (standed[calc(current_x)][calc(current_y)] == -1) {
		++g_count;
	} else if (standed[calc(current_x)][calc(current_y)] <= g_current_turn) return;
	
	standed[calc(current_x)][calc(current_y)] = g_current_turn;
	if (g_current_turn >= g_turn) return;

	auto x = current_x;
	auto y = current_y;

	for (int i = 0; i < 6; ++i) {
		if (!table[calc(current_x + g_dx[i])][calc(current_y + g_dy[i])]) {
			current_x += g_dx[i];
			current_y += g_dy[i];

			++g_current_turn;
			solution();
			--g_current_turn;

			current_x = x;
			current_y = y;
		}
	}
}

int main() {
	//freopen("sample.txt", "r", stdin);

	while (true) {
		for_each(table.begin(), table.end(), [](Line & line) {
			line.fill(false);
		});
		for_each(standed.begin(), standed.end(), [](std::array<int, 63> & line) {
			line.fill(-1);
		});
		g_count = 0;
		g_current_turn = 0;

		int n;
		cin >> g_turn >> n;
		if (g_turn == 0) break;

		for (int i = 0; i < n; ++i) {
			int x, y;
			cin >> x >> y;
			table[calc(x)][calc(y)] = true;
		}

		cin >> current_x >> current_y;

		solution();

		cout << g_count << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:17: error: 'for_each' was not declared in this scope
   57 |                 for_each(table.begin(), table.end(), [](Line & line) {
      |                 ^~~~~~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>
#include <array>
#include <algorithm>

using namespace std;

#define SIZE 130
bool table[SIZE][SIZE];
int standed[SIZE][SIZE];

int current_x;
int current_y;
int g_count;
int g_turn;
int g_current_turn;

int g_dx[] = { 0, 1, 1, 0, -1, -1 };
int g_dy[] = { 1, 1, 0, -1, -1, 0 };

int calc(int x) {
	return x + SIZE/2;
}

// 正直幅優先のほうが良い
void solution() {
	if (standed[calc(current_x)][calc(current_y)] == -1) {
		++g_count;
	} else if (standed[calc(current_x)][calc(current_y)] <= g_current_turn) return;
	
	standed[calc(current_x)][calc(current_y)] = g_current_turn;
	if (g_current_turn >= g_turn) return;

	auto x = current_x;
	auto y = current_y;

	for (int i = 0; i < 6; ++i) {
		if (!table[calc(current_x + g_dx[i])][calc(current_y + g_dy[i])]) {
			current_x += g_dx[i];
			current_y += g_dy[i];

			++g_current_turn;
			solution();
			--g_current_turn;

			current_x = x;
			current_y = y;
		}
	}
}

int main() {
	// freopen("sample.txt", "r", stdin);

	while (true) {
		memset(table, false, sizeof(table));
		memset(standed, -1, sizeof(standed));

		g_count = 0;
		g_current_turn = 0;

		int n;
		cin >> g_turn >> n;
		if (g_turn == 0) break;

		for (int i = 0; i < n; ++i) {
			int x, y;
			cin >> x >> y;
			table[calc(x)][calc(y)] = true;
		}

		cin >> current_x >> current_y;

		solution();

		cout << g_count << endl;
	}
}

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

#include <iostream>
#include <vector>
#include <unordered_set>

using namespace std;


int main() {
    while(true) {
        int n; cin >> n;
        if(n == 0) break;
        vector<vector<int>> costs;
        for(int i = 0; i < n; i++) {
            vector<int> cost;
            for(int j = 0; j <= n; j++) {
                int c; cin >> c;
                cost.emplace_back(c);
            }
            costs.emplace_back(cost);
        }
        vector<int> ans(1 << n, INT_MAX);
        ans[0] = 0;
        for(int i = 0; i < (1 << n); i++) {
            for(int next = 0; next < n; next++) {
                if((i & (1 << next)) != 0) continue;
                int cost = costs[next][0];
                for(int item = 0; item < n; item++) {
                    if((i & (1 << item)) != 0 && costs[next][item+1] < cost) {
                        cost = costs[next][item+1];
                    }
                }
                if(ans[i] + cost < ans[i | (1 << next)]) {
                    ans[i | (1 << next)] = ans[i] + cost;
                }
            }
        }
        cout << ans[(1 << n) - 1] << endl;
    }
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:21:33: error: 'INT_MAX' was not declared in this scope
   21 |         vector<int> ans(1 << n, INT_MAX);
      |                                 ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <unordered_set>
  +++ |+#include <climits>
    4 |
Language: C++

#include <iostream>
#include <algorithm>

#define MAX_ 17
#define IF 1600010

#define lengthof(x) (sizeof(x) / sizeof(*(x)))

using namespace std;

int main(int argc, char const *argv[])
{
	int n;
	unsigned int data[MAX_][MAX_];
	unsigned int dp[1<<(MAX_-1)][MAX_];
	unsigned int min_;

	while(1){
		cin>>n;
		if(n==0) break;

		fill((unsigned int*)data,(unsigned int*)(data+lengthof(data)),0);
		fill((unsigned int*)dp,(unsigned int*)(dp+lengthof(dp)),IF);

		//dp[]

		for(int i1=0;i1<n;i1++){
			for(int i2=0;i2<n+1;i2++){
				cin>>data[i1][i2];
			}
		}


		for(int i1=0;i1<n;i1++){
			dp[1<<i1][0]=data[i1][0];
		}


		for(int i1=0;i1<n-1;i1++){
			for(int i2=0;i2<(1<<n);i2++){
				if(dp[i2][i1]!=IF) {
					for(int i3=0;i3<n;i3++){
						//int i4=i2|(1<<i3);
						if((i2>>i3)&1==0){
							
							min_=IF;
							for(int i5=0;i5<n;i5++){
								
								if((i2>>i5)&1)==1) {
									min_=min(min_,data[i3][i5+1]);
									//cout<<"min_ "<<min_<<" "<<data[i3][i5+1]<<endl;
								}
							}
							dp[i2|(1<<i3)][i1+1]=min(dp[i2|(1<<i3)][i1+1],dp[i2][i1]+min_);
							//i3のステージをi2の武器でこす
						}
					}
				}
			}
		}

		/*for(int i1=0;i1<(int)pow(2.0,n);i1++){
			for(int i2=0;i2<n;i2++){
				cout<<dp[i1][i2]<<"  ";
			}
			cout<<endl;
		}*/

		cout<<dp[(1<<n)-1][n-1]<<endl;




	}
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:49:79: error: expected primary-expression before '==' token
   49 |                                                                 if((i2>>i5)&1)==1) {
      |                                                                               ^~
Language: C++

#include <iostream>
#include <algorithm>
#define REP(i,a,b) for (int i = (a); i < (b); i++)
#define rep(i,a) REP(i,0,a)
using namespace std;
const int INF = 1 << 28;

int sp, N;
int t[16][17];
int dp[1 << 16][16];

int rec(int S, int v) {
    if (dp[S][v] > 0) return dp[S][v];
    if (S == (1 << N) - 1 && v == sp) return dp[S][v] = 0;

    int res = INF;
    rep (u, N) {
        if (!(S >> u & 1)) {
            int cost = t[u][0];
            rep(i, N) if (S & 1 << i) cost = min(cost, t[u][i+1]);
            res = min(res, rec(S | 1 << u, u) + cost);
        }
    }
    return dp[S][v] = res;
}

int main(void){
    while (1) {
        cin >> N;
        if (N == 0) break;
        rep(i, N) rep(j, N+1) cin >> t[i][j];
        int ans = INF;
        for (sp = 0; sp < N; sp++) {
            memset(dp, -1, sizeof(dp));
            ans = min(ans, rec(0,sp));
        }
        cout << ans << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:13: error: 'memset' was not declared in this scope
   34 |             memset(dp, -1, sizeof(dp));
      |             ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <algorithm>
  +++ |+#include <cstring>
    3 | #define REP(i,a,b) for (int i = (a); i < (b); i++)
Language: C++

#include <iostream>
#include <algorithm>
#include <stdio.h>
#define REP(i,a,b) for (int i = (a); i < (b); i++)
#define rep(i,a) REP(i,0,a)
using namespace std;
const int INF = 1 << 28;

int sp, N;
int t[16][17];
int dp[1 << 16][16];

int rec(int S, int v) {
    if (dp[S][v] > 0) return dp[S][v];
    if (S == (1 << N) - 1 && v == sp) return dp[S][v] = 0;

    int res = INF;
    rep (u, N) {
        if (!(S >> u & 1)) {
            int cost = t[u][0];
            rep(i, N) if (S & 1 << i) cost = min(cost, t[u][i+1]);
            res = min(res, rec(S | 1 << u, u) + cost);
        }
    }
    return dp[S][v] = res;
}

int main(void){
    while (1) {
        cin >> N;
        if (N == 0) break;
        rep(i, N) rep(j, N+1) cin >> t[i][j];
        int ans = INF;
        for (sp = 0; sp < N; sp++) {
            memset(dp, -1, sizeof(dp));
            ans = min(ans, rec(0,sp));
        }
        cout << ans << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:13: error: 'memset' was not declared in this scope
   35 |             memset(dp, -1, sizeof(dp));
      |             ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <algorithm>
  +++ |+#include <cstring>
    3 | #include <stdio.h>
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <stdio.h>
#define REP(i,a,b) for (int i = (a); i < (b); i++)
#define rep(i,a) REP(i,0,a)
using namespace std;
const int INF = 1 << 28;

int sp, N;
int t[16][17];
int dp[1 << 16][16];

int rec(int S, int v) {
    if (dp[S][v] > 0) return dp[S][v];
    if (S == (1 << N) - 1 && v == sp) return dp[S][v] = 0;

    int res = INF;
    rep (u, N) {
        if (!(S >> u & 1)) {
            int cost = t[u][0];
            rep(i, N) if (S & 1 << i) cost = min(cost, t[u][i+1]);
            res = min(res, rec(S | 1 << u, u) + cost);
        }
    }
    return dp[S][v] = res;
}

int main(void){
    while (1) {
        cin >> N;
        if (N == 0) break;
        rep(i, N) rep(j, N+1) cin >> t[i][j];
        int ans = INF;
        for (sp = 0; sp < N; sp++) {
            memset(dp, -1, sizeof(dp));
            ans = min(ans, rec(0,sp));
        }
        cout << ans << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:13: error: 'memset' was not declared in this scope
   36 |             memset(dp, -1, sizeof(dp));
      |             ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <algorithm>
  +++ |+#include <cstring>
    3 | #include <string>
Language: C++

#include <iostream>
#include <iomanip>
#include <cassert>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cctype>
#include <stack>
#include <queue>
#include <complex>
#include <vector>
#include <set>
#include <map>
#include <algorithm>

using namespace std;

#define all(x) begin(x), end(x)
#define rall(x) (x).rbegin(), (x).rend()
typedef long long ll;
typedef complex<int> P;
typedef pair<int, int> pii;
typedef tuple<int, int, int> tii;
const double EPS = 1e-10;
const double PI = acos(-1.0);


const int nmax = 20;
const int tmax = 100010;

void debug(int& n, vector<vector<int>>& t){
	cout<< n<< endl;
	for(int i=0;i<n;++i) { for(int j=0;j<n+1;++j) cout<< t[i][j]<< " "; cout<< endl; }
}
void debug(vector<vector<int>>& a){
	cout<< a.size()<< " "<< a[0].size()<< endl;
	for(int i=0;i<a.size();++i){
		for(int j=0;j<a[i].size();++j){
			cout<< a[i][j]<< " ";
		}
		cout<< endl;
	}
}

void f(vector<int>& b, int& n, vector<vector<int>>& a){
	if(b.size() == n){
		a.push_back(b);
		return;
	}
	for(int i=0;i<n;i++){
		if(count(all(b), i)) continue;
		vector<int> bb = b;
		bb.push_back(i);
		f(bb, n, a);
	}
}

bool solve(){
	int n;
	cin>> n;
	if(!n) return false;

	vector<vector<int>> t = vector<vector<int>>(n, vector<int>(n+1));
	for(int i=0;i<n;++i){
		for(int j=0;j<n+1;++j){
			cin>> t[i][j];
		}
	}

	vector<vector<int>> a = vector<vector<int>>();
	f(vector<int>(), n, a);

	//debug(n, t);
	//debug(a);

	int ans = nmax * tmax;
	for(int i=0;i<a.size() && i<100;++i){
		int sum = 0;
		vector<int> time(n);
		for(int j=0;j<n;++j) time[j] = t[j][0];
		for(int j=0;j<n;++j){
			int d = a[i][j];
			sum += time[d];
			for(int k=0;k<n;++k){
				time[k] = min(time[k], t[k][d+1]);
			}
		}
		ans = min(ans, sum);
	}
	cout<< ans << endl;
	return true;
}

int main(){
	cout.setf(ios::fixed); cout.precision(10);
	while(solve());
	return 0;
}

Compiler output:
a.cc: In function 'bool solve()':
a.cc:72:11: error: cannot bind non-const lvalue reference of type 'std::vector<int>&' to an rvalue of type 'std::vector<int>'
   72 |         f(vector<int>(), n, a);
      |           ^~~~~~~~~~~~~
a.cc:46:21: note:   initializing argument 1 of 'void f(std::vector<int>&, int&, std::vector<std::vector<int> >&)'
   46 | void f(vector<int>& b, int& n, vector<vector<int>>& a){
      |        ~~~~~~~~~~~~~^
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ct>
#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<memory>
#include<functional>

using namespace std;

#define ALL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define F(i,j,k) fill(i[0],i[0]+j*j,k)
#define P(p) cout<<(p)<<endl;
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define INF 1<<25
#define pb push_back

typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<double> vd;
typedef pair<int,int> pii;
typedef pair<long,long> pll;
typedef long long ll;

#define MAX_N 16

struct P {
    int t, stage;

    bool operator >(const P& p) const {
        return t > p.t;
    }
};

int main()
{
    int n;
    int t[MAX_N][MAX_N+1];
    while (cin >> n, n) {
        fill_n((int *)t, MAX_N*(MAX_N+1), 0);
        rep(i, n) {
            rep(j, n+1) {
                int input;
                cin >> input;
                t[i][j] = input;
            }
        }
        int goal = (1 << n) - 1;
        priority_queue<P, vector<P>, greater<P> > q;
        q.push((P){0, 0});
        while (!q.empty()) {
            P p = q.top(); q.pop();
            // goal
            if (p.stage == goal) {
                cout << p.t << endl;
                break;
            }
            // push
            rep(i, n) {
                if (!(p.stage&(1<<i))) {
                    q.push((P){p.t+t[i][0], p.stage+(1<<i)});
                    REP(j, 1, n+1) {
                        if(p.stage&(1<<(j-1))) q.push((P){p.t+t[i][j], p.stage+(1<<i)});
                    }
                }
            }
        }
    }
    return 0;
}

Compiler output:
a.cc:5:9: fatal error: ct: No such file or directory
    5 | #include<ct>
      |         ^~~~
compilation terminated.
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
int tbl[20][20];
int cleartbl[1<<16][16];
int memo[1<<16];
int n;
int dist(int b){
  if(b==0) return 0;
  if(memo[b]) return memo[b];
  int ret = 1<<28;
  for(int i=0;i<n;++i)
    if((b>>i)&1)
      ret = min(ret,dist(b-(1<<i))+cleartbl[b-(1<<i)][i]);
  return memo[b]=ret;
}
int solve(){
  for(int i=0;i<1<<n;++i){
    for(int j=0;j<n;++j){
      cleartbl[i][j] = tbl[j][0];
      for(int k=0;k<n;++k)
	if((i>>k)&1)
	  cleartbl[i][j] = min(cleartbl[i][j],tbl[j][k+1]);
    }
  }
  memset(memo,0,sizeof(memo));  
  return dist((1<<n)-1);
}
int main(){
  while(cin >> n,n){
    for(int i=0;i<n;++i)
      for(int j=0;j<=n;++j)
	cin >> tbl[i][j];
    cout << solve()<< endl;
  }
  
  return 0;
}

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

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
  int N;
  while(true){
    cin >> N;
    if(N == 0){
      break;
    }
    int time[N][N+1];
    for(int i = 0; i < N; ++i){
      for(int j = 0; j < N+1; ++j){
	cin >> time[i][j];
      }
    }
    int min_time[N][1<<N];
    fill_n((int*) min_time, N*(1<<N), 1<<23);
    for(int i = 0; i < N; ++i){
      min_time[i][0] = time[i][0];
    }
    for(int i = 0; i < N; ++i){
      for(int b = 0; b < (1<<N); ++b){
	for(int j = 0; j < N; ++j){
	  if(((b>>j)&1)==1){
	    continue;
	  }
	  int t = b |(1<<j);
	  min_time[i][t] = min(min_time[i][t], time[i][j+1]);
	}
      }
    }
    /*
    for(int i = 0; i < N; ++i){
      for(int b = 0; b < (1<<N); ++b){
	cout << min_time[i][b] << ", ";
      }
      cout << endl;
    }
    */
    int table[1<<N];
    fill_n(table, 1<<N, 1<<23);
    table[0] = 0;
    for(int i = 0; i < N; ++i){
      table[1<<i] = time[i][0];
    }
    for(int b = 0; b < (1<<N); ++b){
      for(int i = 0; i < N; ++i){
	if(((b>>j)&1)==1){
	  continue;
	}
	int t = b |(1<<i);
	table[t] = min(table[t], table[b]+min_time[i][b]);
      }
      //cout << table[b] << ",";
    }
    //cout << endl;
    cout << table[(1<<N)-1] << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:17: error: 'j' was not declared in this scope
   50 |         if(((b>>j)&1)==1){
      |                 ^
Language: C++

#include <cstdio>
#include <iostream>
#include <cmath>
#include <ctype.h>
#include <string> 
#include <sstream>
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>
#include <set>
#include <iomanip>
#include <stack>
  
using namespace std;

#define pi 3.141592653589793

#define MAX 1000000000

int solve(int i, int n, bool c[], int t[17][17], int cn)
{
	if(cn == n - 1) return 0;
	bool c2[17];
	// trueならばそのステージはすでにクリアしている
	memcpy(c2, c, n);
	c2[i] = true;
	int mint[17] = {};
	// mint[j]: iから今まで手に入れた装備を用いてjまで行く時の最短時間
	for(int j = 1; j < n + 1; j++){
		if(j != i){
			mint[j] = t[j][i];
			for(int k = 1; k < n + 1; k++){
				if(c2[k] && k != j) mint[j] = min(mint[j], t[j][k]);
				// kばんめのステージをすでにクリアしていたらiからjへいく最短時間が変わる可能性あり
			}
		}
	}
	int next[17], nextt = MAX, nextnum = 0;
	for(int j = 1; j < n + 1; j++){
		if(j != i){
			if(mint[j] < nextt && !c2[j]){
				for(int k = 0; k < nextnum; k++){
					next[k] = 0;
				}
				next[0] = j;
				nextnum = 1;
				nextt = mint[j];
			} else if(mint[j] == nextt && !c2[j]){
				next[nextnum] = j;
				nextnum++;
			}
		}
	}
	int minresult = MAX;
	for(int j = 0; j < nextnum; j++){
		minresult = min(minresult, solve(next[j], n, c2, t, cn + 1) + mint[next[j]]);
	}
	return minresult;
}

int main()
{
	int n;
	while(1){
		cin >> n;
		if(n == 0) break;
		int s[17];
		int t[17][17];
		bool iscleared[17];
		for(int i = 1; i < n + 1; i++){
			iscleared[i] = false;
			cin >> s[i];
			for(int j = 1; j < n + 1; j++){
				cin >> t[i][j];
			}
		}
		int result = 0, ans = MAX;
		for(int i = 1; i < n + 1; i++){
			result = solve(i, n, iscleared, t, 0);
			result += s[i];
			// cout << result << endl;
			ans = min(result, ans);
		}
		cout << ans << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int solve(int, int, bool*, int (*)[17], int)':
a.cc:29:9: error: 'memcpy' was not declared in this scope
   29 |         memcpy(c2, c, n);
      |         ^~~~~~
a.cc:17:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   16 | #include <stack>
  +++ |+#include <cstring>
   17 |
Language: C++

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

typedef pair<long long int, long long int> PLL;

int main() {
	int N;
	while( cin >> N, N ) {
		vector<vector<long long int>>D( N, vector<long long int>( N + 1 ) );
		for( size_t i = 0; i < N; i++ ) {
			for( size_t j = 0; j < N + 1; j++ ) {
				cin >> D[i][j];
			}
		}
		priority_queue<PLL, vector<PLL>, greater<PLL>>que;
		que.push( make_pair( 0, 0 ) );
		long long int ans = LLONG_MAX;
		while( que.size() ) {
			auto now = que.top(); que.pop();
			if( now.second == (1 << N) - 1 ) {
				ans = min( ans, now.first );
			}
			if( ans < now.first ) {
				break;
			}
			MLL[now.second] = now.first;
			for( size_t i = 0; i < N; i++ ) {
				if( !((1 << i)&now.second) ) {
					PLL next;
					next.second = (1 << i) | now.second;
					next.first = LLONG_MAX;
					for( size_t j = 0; j < N; j++ ) {
						if( (1 << j)& now.second ) {
							next.first = min( next.first, D[i][j + 1] );
						} else {
							next.first = min( next.first, D[i][0] );
						}
					}
					next.first += now.first;
					que.push( next );
				}
			}
		}
		cout << ans << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:25: error: 'MLL' was not declared in this scope; did you mean 'PLL'?
   26 |                         MLL[now.second] = now.first;
      |                         ^~~
      |                         PLL
Language: C++

#include <cstdio>
#include <iostream>
#include <cmath>
#include <ctype.h>
#include <string> 
#include <sstream>
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>
#include <set>
#include <list>
   
using namespace std;
 

 
int main()
{
    int n;
    while(1){
        cin >> n;
        if(n == 0) break;
        int t[17][17];
        int result[65540];
        memset(result, 100000000, (int)pow(2, n));
        result[0] = 0;
        int mint[17];
        for(int i = 1; i < n + 1; i++){
            for(int j = 0; j < n + 1; j++){
                cin >> t[i][j];
            }
        }
        for(int i = 0; i < (1 << n); i++){
            for(int j = 0; j < n; j++){
                // ?????????j??????????????????????????¢??????
                if((i & (1 << j)) == 1) continue;
                // ?????§???j???????????¢??????????????§?£???°???
                int cost = t[j][0];
                for(int k = 0; k < n; k++){
                    // ????????????????????????
                    if((i & (1 << k)) == 0) continue;
                    // k??????????????????????????\??£?????????????????§?£???°???
                    cost = min(cost, t[j][k + 1]);
                }
                int now = (i | (1 << j));
                // ????????¢?????????
                result[now] = min(result[now], result[i] + cost);
            }
        }
        cout << result[(1<<n) - 1] << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:9: error: 'memset' was not declared in this scope
   29 |         memset(result, 100000000, (int)pow(2, n));
      |         ^~~~~~
a.cc:16:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   15 | #include <list>
  +++ |+#include <cstring>
   16 |
Language: C++

#include <cstdio>
#include <iostream>
#include <cmath>
#include <ctype.h>
#include <string> 
#include <sstream>
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>
#include <set>
#include <list>
#include <cstring>
   
using namespace std;
 

 
int main()
{
    int n;
    while(1){
        cin >> n;
        if(n == 0) break;
        int t[17][17];
        int result[65540];
        vector<int> result(1 << n, 100000000);
        result[0] = 0;
        int mint[17];
        for(int i = 1; i < n + 1; i++){
            for(int j = 0; j < n + 1; j++){
                cin >> t[i][j];
            }
        }
        for(int i = 0; i < (1 << n); i++){
            for(int j = 0; j < n; j++){
                // ?????????j??????????????????????????¢??????
                if((i & (1 << j)) == 1) continue;
                // ?????§???j???????????¢??????????????§?£???°???
                int cost = t[j][0];
                for(int k = 1; k < n + 1; k++){
                    // ????????????????????????
                    if((i & (1 << k)) == 0) continue;
                    // k??????????????????????????\??£?????????????????§?£???°???
                    cost = min(cost, t[j][k]);
                }
                int now = (i | (1 << j));
                // ????????¢?????????
                result[now] = min(result[now], result[i] + cost);
            }
        }
        cout << result[(1<<n) - 1] << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:21: error: conflicting declaration 'std::vector<int> result'
   30 |         vector<int> result(1 << n, 100000000);
      |                     ^~~~~~
a.cc:29:13: note: previous declaration as 'int result [65540]'
   29 |         int result[65540];
      |             ^~~~~~