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

#include <algorithm>
#include <iostream>
#include <list>
#include <vector>
#include <string>
#include <map>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>

using namespace std;

typedef long long Board;

const int N = 9;
const Board GOAL = 0x087654321;

struct state {
    Board board;
    int count;
};

list<state> q;
map<Board,char> history;

inline void swap(int numpos, int spacepos, Board& board) {
    long long num = (board >> (numpos*4)) & 15;
    board |= num << (spacepos*4);
    board &= ~(15LL << (numpos*4));
}

inline int swap_and_check(int numpos, int spacepos, state s) {
    swap(numpos, spacepos, s.board);
    map<Board,char>::iterator it = history.find(s.board);
    if (it != history.end()) {
        return -1;
    }
    history.insert(make_pair(s.board, ' '));
//    for (list<state>::iterator it = q.begin(); it != q.end(); ++it) {
//        if (it->board == s.board) {
//            return -1;
//        }
//    }
    ++s.count;
    if (s.board == GOAL) {
        return s.count;
    }
    q.push_back(s);
    return -1;
}

void print(Board b) {
    for (int i = 0; i < N; ++i) {
        printf("%2lld", (b >> (i*4) & 15));
    }
    printf("\n");
}

int main(void) {

    Board board = 0;
    for (int i = 0; i < N; ) {
        char ch;
        scanf("%c", &ch);
        if (isdigit(ch)) {
            board |= static_cast<long long>((ch - '0')) << (i*4);
            ++i;
        }
    }

    if (board == GOAL) {
        goto END;
    }

//    print(GOAL);
//    print(board);

    q.push_back({ board, 0 });
    int count = 0;
    while (!q.empty()) {
        state s = q.front();
        q.pop_front();
        // ?????????????????????
        int pos;
        for (pos = 0; pos < N; ++pos) {
            if (((s.board >> (pos*4)) & 15) == 0) {
                break;
            }
        }

        if (pos < 6) {
            if ((count = swap_and_check(pos + 3, pos, s)) > 0) {
                break;
            }
        }
        if (pos > 2) {
            if ((count = swap_and_check(pos - 3, pos, s)) > 0) {
                break;
            }
        }
        if (pos % 3 < 2) {
            if ((count = swap_and_check(pos + 1, pos, s)) > 0) {
                break;
            }
        }
        if (pos % 3 > 0) {
            if ((count = swap_and_check(pos - 1, pos, s)) > 0) {
                break;
            }
        }
    }

END:
    printf("%d\n", count);

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:115:1: error: jump to label 'END'
  115 | END:
      | ^~~
a.cc:74:14: note:   from here
   74 |         goto END;
      |              ^~~
a.cc:81:9: note:   crosses initialization of 'int count'
   81 |     int count = 0;
      |         ^~~~~
Language: C++

#include<cstdio>
#include<iostream>
#include<stack>
#include<vector>
#include<algorithm>
#include<cstring>
#include<cstdlib>
#define _USE_MATH_DEFINES // M_PI????????????????????????
#include<math.h>
#include<queue>
#include<map>
#pragma warning(disable:4996)
using namespace std;

#define N 3
#define N2 9

struct Puzzle{
	int f[N2];
	int space;
	string path;

	bool operator < ( const Puzzle &p ) const {
		for(int i=0; i<N2; i++){
			if( f[i]==p.f[i] ) continue;
			return f[i] > p.f[i];
		}
		return false;
	}
};

static const int dx[4]={-1, 0, 1, 0};
static const int dy[4]={0, -1, 0, 1};
static const char dir[4]={'u', 'l', 'd', 'r'}

bool isTarget(Puzzle p){
	for(int i=0; i<N2; i++)
		if( p.f[i]!=(i+1) ) return false;
	return true;
}

string bfs(Puzzle s){
	queue<Puzzle> Q;
	map<Puzzle,bool> V;
	Puzzle u,v;
	s.puth = "";
	Q.psuh(s);
	V[s] = true;

	while( !Q.empty() ){
		u = Q.front();
		Q.pop();
		if( isTarget(u) ) return u.push;
		int sx = u.space / N;
		int sy = u.space % N;
		for(int r=0; r<4; r++){
			int tx = sx + dx[r];
			int ty = sy + dy[r];
			if( tx<0 || ty<0 || tx>=N || ty>=N ) continue;
			v = u;
			swap(v.f[u.space], v.f[tx*N+ty]);
			v.space = tx * N + ty;
			if( !V[v] ){
				V[v] = true;
				v.path += dir[r];
				Q.push(v);
			}
		}
	}
	return "unsolvable";
}

int main(){
	Puzzle in;

	for(int i=0; i<N2; i++){
		cin >> in.f[i];
		if( in.f[i]==0 ){
			in.f[i] = N2;
			in.space = i;
		}
	}
	string ans = bfs(in);
	cout << ans.size() << "\n";

	return 0;
}

Compiler output:
a.cc:36:1: error: expected ',' or ';' before 'bool'
   36 | bool isTarget(Puzzle p){
      | ^~~~
a.cc: In function 'std::string bfs(Puzzle)':
a.cc:46:11: error: 'struct Puzzle' has no member named 'puth'; did you mean 'path'?
   46 |         s.puth = "";
      |           ^~~~
      |           path
a.cc:47:11: error: 'class std::queue<Puzzle>' has no member named 'psuh'; did you mean 'push'?
   47 |         Q.psuh(s);
      |           ^~~~
      |           push
a.cc:53:21: error: 'isTarget' was not declared in this scope
   53 |                 if( isTarget(u) ) return u.push;
      |                     ^~~~~~~~
a.cc:53:44: error: 'struct Puzzle' has no member named 'push'
   53 |                 if( isTarget(u) ) return u.push;
      |                                            ^~~~
Language: C++

#include<iostream>
#include<cmath>
#include<string>
#include<map>
#include<queue>
using namespace std;
#define N 3
#define N29

struct Puzzle{
  int f[N2];
  int space;
  string path;

  bool operator<(const Puzzle &p)const{
    for(int i=0;i<N2;i++){
      if(f[i]==p.f[i])continue;
      return f[i]>p.f[i];
    }
    return false;
  }
};
static const int dx[4]={-1,0,1,0};
static const int dy[4]={0,-1,0,1};
static const char dir[4]={'u','i','d','r'};
bool isTarget(Pizzle p){
  queue<Puzzle> Q;
  map<Puzzle,bool> V;
  Puzzle u,v;
  s.path="";
  Q.push(s);
  V[s]=true;

  while(!=Q.empty()){
    u=Q.front();Q.pop();
    is(isTarget(u))return u.path;
    int sx=u.space/N;
    int sy=u.space%N;
    for(int r=0;r<4;r++){
      int tx=sx+dx[r];
      int ty=sy+dy[r];
      if(tx<0||ty<0||tx>=N||ty>=N)continue;
      v=u;
      swap(v.f[u.space],v.f[tx*N+ty]);
      v.space=tx*N+ty;
      if(!V[v]){
	V[v]=true;
	v.path+=dir[r];
	Q.push(v);
      }
    }
  }
  return "unsolvable";
}

int main(){
  Puzzle in;
  for(int i=0;i<N2;i++){
    cin>>in.f[i];
    if(in.f[i]==0){
      in.f[i]=N2;
      in.space=i;
    }
  }
  string ans=bfs(in);
  cout<<ans.size()<<endl;
  return 0;
}

Compiler output:
a.cc:11:9: error: 'N2' was not declared in this scope; did you mean 'N29'?
   11 |   int f[N2];
      |         ^~
      |         N29
a.cc: In member function 'bool Puzzle::operator<(const Puzzle&) const':
a.cc:16:19: error: 'N2' was not declared in this scope; did you mean 'N29'?
   16 |     for(int i=0;i<N2;i++){
      |                   ^~
      |                   N29
a.cc:17:10: error: 'f' was not declared in this scope
   17 |       if(f[i]==p.f[i])continue;
      |          ^
a.cc:17:18: error: 'const struct Puzzle' has no member named 'f'
   17 |       if(f[i]==p.f[i])continue;
      |                  ^
a.cc:18:14: error: 'f' was not declared in this scope
   18 |       return f[i]>p.f[i];
      |              ^
a.cc:18:21: error: 'const struct Puzzle' has no member named 'f'
   18 |       return f[i]>p.f[i];
      |                     ^
a.cc: At global scope:
a.cc:26:15: error: 'Pizzle' was not declared in this scope; did you mean 'Puzzle'?
   26 | bool isTarget(Pizzle p){
      |               ^~~~~~
      |               Puzzle
a.cc: In function 'int main()':
a.cc:58:17: error: 'N2' was not declared in this scope; did you mean 'N29'?
   58 |   for(int i=0;i<N2;i++){
      |                 ^~
      |                 N29
a.cc:59:13: error: 'struct Puzzle' has no member named 'f'
   59 |     cin>>in.f[i];
      |             ^
a.cc:60:11: error: 'struct Puzzle' has no member named 'f'
   60 |     if(in.f[i]==0){
      |           ^
a.cc:61:10: error: 'struct Puzzle' has no member named 'f'
   61 |       in.f[i]=N2;
      |          ^
a.cc:65:14: error: 'bfs' was not declared in this scope
   65 |   string ans=bfs(in);
      |              ^~~
Language: C++

#include<iostream>
#include<cmath>
#include<string>
#include<map>
#include<queue>
using namespace std;
#define N 3
#define N2 9

struct Puzzle{
  int f[N2];
  int space;
  string path;

  bool operator<(const Puzzle &p)const{
    for(int i=0;i<N2;i++){
      if(f[i]==p.f[i])continue;
      return f[i]>p.f[i];
    }
    return false;
  }
};
static const int dx[4]={-1,0,1,0};
static const int dy[4]={0,-1,0,1};
static const char dir[4]={'u','i','d','r'};
bool isTarget(Pizzle p){
  queue<Puzzle> Q;
  map<Puzzle,bool> V;
  Puzzle u,v;
  s.path="";
  Q.push(s);
  V[s]=true;

  while(!=Q.empty()){
    u=Q.front();Q.pop();
    is(isTarget(u))return u.path;
    int sx=u.space/N;
    int sy=u.space%N;
    for(int r=0;r<4;r++){
      int tx=sx+dx[r];
      int ty=sy+dy[r];
      if(tx<0||ty<0||tx>=N||ty>=N)continue;
      v=u;
      swap(v.f[u.space],v.f[tx*N+ty]);
      v.space=tx*N+ty;
      if(!V[v]){
	V[v]=true;
	v.path+=dir[r];
	Q.push(v);
      }
    }
  }
  return "unsolvable";
}

int main(){
  Puzzle in;
  for(int i=0;i<N2;i++){
    cin>>in.f[i];
    if(in.f[i]==0){
      in.f[i]=N2;
      in.space=i;
    }
  }
  string ans=bfs(in);
  cout<<ans.size()<<endl;
  return 0;
}

Compiler output:
a.cc:26:15: error: 'Pizzle' was not declared in this scope; did you mean 'Puzzle'?
   26 | bool isTarget(Pizzle p){
      |               ^~~~~~
      |               Puzzle
a.cc: In function 'int main()':
a.cc:65:14: error: 'bfs' was not declared in this scope
   65 |   string ans=bfs(in);
      |              ^~~
Language: C++

#include<iostream>
#include<cmath>
#include<string>
#include<map>
#include<queue>
using namespace std;
#define N 3
#define N2 9

struct Puzzle{
  int f[N2];
  int space;
  string path;

  bool operator<(const Puzzle &p)const{
    for(int i=0;i<N2;i++){
      if(f[i]==p.f[i])continue;
      return f[i]>p.f[i];
    }
    return false;
  }
};
static const int dx[4]={-1,0,1,0};
static const int dy[4]={0,-1,0,1};
static const char dir[4]={'u','i','d','r'};
bool isTarget(Puzzle p){
  queue<Puzzle> Q;
  map<Puzzle,bool> V;
  Puzzle u,v;
  s.path="";
  Q.push(s);
  V[s]=true;

  while(!=Q.empty()){
    u=Q.front();Q.pop();
    is(isTarget(u))return u.path;
    int sx=u.space/N;
    int sy=u.space%N;
    for(int r=0;r<4;r++){
      int tx=sx+dx[r];
      int ty=sy+dy[r];
      if(tx<0||ty<0||tx>=N||ty>=N)continue;
      v=u;
      swap(v.f[u.space],v.f[tx*N+ty]);
      v.space=tx*N+ty;
      if(!V[v]){
	V[v]=true;
	v.path+=dir[r];
	Q.push(v);
      }
    }
  }
  return "unsolvable";
}

int main(){
  Puzzle in;
  for(int i=0;i<N2;i++){
    cin>>in.f[i];
    if(in.f[i]==0){
      in.f[i]=N2;
      in.space=i;
    }
  }
  string ans=bfs(in);
  cout<<ans.size()<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'bool isTarget(Puzzle)':
a.cc:30:3: error: 's' was not declared in this scope
   30 |   s.path="";
      |   ^
a.cc:34:9: error: expected primary-expression before '!=' token
   34 |   while(!=Q.empty()){
      |         ^~
a.cc:36:5: error: 'is' was not declared in this scope
   36 |     is(isTarget(u))return u.path;
      |     ^~
a.cc: In function 'int main()':
a.cc:65:14: error: 'bfs' was not declared in this scope
   65 |   string ans=bfs(in);
      |              ^~~
Language: C++

#include<iostream>
#include<cmath>
#include<string>
#include<map>
#include<queue>
using namespace std;
#define N 3
#define N2 9

struct Puzzle{
int f[N2];
int space;
string path;

bool operator < (const Puzzle &p) const{
for(int i = 0; i < N2; i++){
if(f[i] == p.f[i]) continue;
return f[i] > p.f[i];
}
return false;
}
};

static const int dx[4] = {-1,0,1,0};
static const int dy[4] = {0,-1,0,1};
static const char dir[4] = {'u','l','d','r'};

bool isTarget(Puzzle p){
for(int i = 0; i < N2; i++)
if(p.f[i] != (i + 1)) return false;
return true;
}

string bfs(Puzzle s){
queue<Puzzle> Q;
map<Puzzle, bool> V;
Puzzle u, v;
s.path = "";
Q.push(s);
V[s] = true;

while(!Q.empty()){
u = Q.front(); Q.pop();
if(isTarget(u)) return u.path;
int sx = u.space / N;
int sy = u.space % N;
for(int r = 0; r < 4; r++){
int tx = sx + dx[r];
int ty = sy + dy[r];
if(tx < 0 || ty < 0 || tx >= N || ty >= N) continue;
v = u;
swap(v.f[u.space], v.f[tx * N + ty]);
v.space = tx * N + ty;
if(!V[v]){
V[v] = true;
v.path += dir[r];
Q.push(v);
}
}
}
return "unsolvable";
}

int main(){
Puzzle in;
for(int i = 0; i < N2; i++){
cin >> in.f[i];
if(in.f[i] == 0){
in.f[i] = N2;
in.space = i;
}
}
string ans = bfs(in);
cout << ans.sizu() << endl;

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:74:13: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'sizu'; did you mean 'size'?
   74 | cout << ans.sizu() << endl;
      |             ^~~~
      |             size
Language: C++

#include<iostream>
#include<cmath>
#include<string>
#include<map>
#include<queue>
using namespace std;
#define N 3
#define N2 9
 
struct Puzzle{
  int i,f[N2];
  int space;
  string path;
 
  bool operator < (const Puzzle &p) const{

    for(i = 0;i < N2;i ++)
      {
	if(f[i] == p.f[i]) continue;
	return f[i] > p.f[i];
      }
    return false;
  }
};
 
static const int dx[4] = {-1, 0, 1, 0};
static const int dy[4] = {0, -1, 0, 1};
static const char dir[4] = {'u', 'l', 'd', 'r'};
 
 
int main(){

  Puzzle in;

  int i;

  string ans;
  
  for(i = 0;i < N2;i ++)
    {
      cin >> in.f[i];
      if(in.f[i] == 0)
	{
	  in.f[i] = N2;
	  in.space = i;
	}
    }
  ans = bfs(in);

  cout << ans.size() << endl;
 
  return 0;
}

bool isTarget(Puzzle p){

  int i;
  
  for(i = 0;i < N2;i ++)
    {
      if(p.f[i] != (i + 1)) return false;
    }
  
  return true;
}
 
string bfs(Puzzle s){

  int sx,sy,tx,ty,r;
  
  queue<Puzzle> Q;

  map<Puzzle, bool> V;

  Puzzle u, v;

  s.path = "";

  Q.push(s);

  V[s] = true;
 
  while(!Q.empty()){

    u = Q.front();

    Q.pop();

    if(isTarget(u))return u.path;

    sx = u.space / N;
    sy = u.space % N;

    for(r = 0;r < 4;r ++)
      {
	tx = sx + dx[r];
	ty = sy + dy[r];

	if(tx < 0 || ty < 0 || tx >= N || ty >= N)continue;
       
	v = u;
      
	swap(v.f[u.space], v.f[tx * N + ty]);
      
	v.space = tx * N + ty;
      
	if(!V[v]){
	  V[v] = true;
	  v.path += dir[r];
	  Q.push(v);
	}
      }
  }
 
  return "unsolvable";
}

Compiler output:
a.cc: In member function 'bool Puzzle::operator<(const Puzzle&) const':
a.cc:17:11: error: assignment of member 'Puzzle::i' in read-only object
   17 |     for(i = 0;i < N2;i ++)
      |         ~~^~~
a.cc:17:22: error: increment of member 'Puzzle::i' in read-only object
   17 |     for(i = 0;i < N2;i ++)
      |                      ^
a.cc: In function 'int main()':
a.cc:48:9: error: 'bfs' was not declared in this scope
   48 |   ans = bfs(in);
      |         ^~~
Language: C++

#include<iostream>
#include<cmath>
#include<string>
#include<map>
#include<queue>
using namespace std;
#define N 3
#define N2 9

bool isTarget(Puzzle );
string bfs(Puzzle );

struct Puzzle{
  int i,f[N2];
  int space;
  string path;
 
  bool operator < (const Puzzle &p) const{

    for(i = 0;i < N2;i ++)
      {
	if(f[i] == p.f[i]) continue;
	return f[i] > p.f[i];
      }
    return false;
  }
};
 
static const int dx[4] = {-1, 0, 1, 0};
static const int dy[4] = {0, -1, 0, 1};
static const char dir[4] = {'u', 'l', 'd', 'r'};
 
 
int main(){

  Puzzle in;

  int i;

 
  for(i = 0;i < N2;i ++)
    {
      cin >> in.f[i];
      if(in.f[i] == 0)
	{
	  in.f[i] = N2;
	  in.space = i;
	}
    }
 string ans = bfs(in);

  cout << ans.size() << endl;
 
  return 0;
}

bool isTarget(Puzzle p){

  int i;
  
  for(i = 0;i < N2;i ++)
    {
      if(p.f[i] != (i + 1)) return false;
    }
  
  return true;
}
 
string bfs(Puzzle s){

  int sx,sy,tx,ty,r;
  
  queue<Puzzle> Q;

  map<Puzzle, bool> V;

  Puzzle u, v;

  s.path = "";

  Q.push(s);

  V[s] = true;
 
  while(!Q.empty()){

    u = Q.front();

    Q.pop();

    if(isTarget(u))return u.path;

    sx = u.space / N;
    sy = u.space % N;

    for(r = 0;r < 4;r ++)
      {
	tx = sx + dx[r];
	ty = sy + dy[r];

	if(tx < 0 || ty < 0 || tx >= N || ty >= N)continue;
       
	v = u;
      
	swap(v.f[u.space], v.f[tx * N + ty]);
      
	v.space = tx * N + ty;
      
	if(!V[v]){
	  V[v] = true;
	  v.path += dir[r];
	  Q.push(v);
	}
      }
  }
 
  return "unsolvable";
}

Compiler output:
a.cc:10:15: error: 'Puzzle' was not declared in this scope
   10 | bool isTarget(Puzzle );
      |               ^~~~~~
a.cc:11:12: error: 'Puzzle' was not declared in this scope
   11 | string bfs(Puzzle );
      |            ^~~~~~
a.cc: In member function 'bool Puzzle::operator<(const Puzzle&) const':
a.cc:20:11: error: assignment of member 'Puzzle::i' in read-only object
   20 |     for(i = 0;i < N2;i ++)
      |         ~~^~~
a.cc:20:22: error: increment of member 'Puzzle::i' in read-only object
   20 |     for(i = 0;i < N2;i ++)
      |                      ^
a.cc: In function 'int main()':
a.cc:50:18: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (Puzzle&)'
   50 |  string ans = bfs(in);
      |               ~~~^~~~
a.cc: At global scope:
a.cc:57:23: error: 'bool isTarget(Puzzle)' redeclared as different kind of entity
   57 | bool isTarget(Puzzle p){
      |                       ^
a.cc:10:6: note: previous declaration 'bool isTarget'
   10 | bool isTarget(Puzzle );
      |      ^~~~~~~~
a.cc:69:20: error: 'std::string bfs(Puzzle)' redeclared as different kind of entity
   69 | string bfs(Puzzle s){
      |                    ^
a.cc:11:8: note: previous declaration 'std::string bfs'
   11 | string bfs(Puzzle );
      |        ^~~
a.cc: In function 'std::string bfs(Puzzle)':
a.cc:91:16: error: 'isTarget' cannot be used as a function
   91 |     if(isTarget(u))return u.path;
      |        ~~~~~~~~^~~
Language: C++

#include <iostream>
#include <cmath>
#include <string>
#include <map>
#include <queue>
using namespace std;
#define N 3
#define N2 9

struct Puzzle {
  int f[N2];
  int space;
  string path;

  bool operator < (const Puzzle &p) const {
    for(int i=0; i<N2; i++){
      if(f[i] == p.f[i]) continue;
      return f[i] > p.f[i];
    }
    return false;
  }
};

static const int dx[4] = {-1, 0, 1, 0};
static const int dy[4] = {0, -1, 0, 1);
static const char dir[4] = {'u', 'l', 'd','r'};

bool isTarget(Puzzle p) {
  for(int i=0; i<N2; i++)
    if(p.f[o] != (i+1)) return false;
  return true;
}

string bfs(Puzzle s){
  queue<Puzzle> Q;
  map<Puzzle, bool> V;
  Puzzle u, v;
  s.path = "";
  Q.push(s);
  V[s] = true;

  while(!Q.empty()){
    u = Q.front(); Q.pop();
    if(isTarget(u)) return u.path;
    int sx = u.space/N;
    int sy u.space%N;
    for(int r=0; r<4; r++){
      int tx = sx+dx[r];
      int ty = sy+dy[r];
      if(tx<0 || ty<0 || tx>=N || ty>=N) continue;
      v=u;
      swap(v.f[u.space], v.f[tx*N+ty]);
      v.space = tx*N+ty;
      if(!V[v]){
        V[v] = true;
        v.path += dir[r];
        Q.push(v);
      }
    }
  }
  return "usdolvable";
}

int main(){
  Puzzle in;

  for(int i=0; i<N2; i++){
    cin >> in.f[i];
    if(in.f[i] == 0){
      in.f[i] = N2;
      in .space = i;
    }
  }

  string ans = bfs(in);
  cout << ans.size() << endl;

  return 0;
}

Compiler output:
a.cc:25:38: error: expected '}' before ')' token
   25 | static const int dy[4] = {0, -1, 0, 1);
      |                          ~           ^
a.cc:25:38: error: expected ',' or ';' before ')' token
a.cc: In function 'bool isTarget(Puzzle)':
a.cc:30:12: error: 'o' was not declared in this scope
   30 |     if(p.f[o] != (i+1)) return false;
      |            ^
a.cc: In function 'std::string bfs(Puzzle)':
a.cc:46:12: error: expected initializer before 'u'
   46 |     int sy u.space%N;
      |            ^
a.cc:49:16: error: 'sy' was not declared in this scope; did you mean 'ty'?
   49 |       int ty = sy+dy[r];
      |                ^~
      |                ty
Language: C++

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

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef vector<ll> Vector;
typedef vector<vector<ll>> DVector;

#define fi          first
#define se          second
#define pb          push_back
#define INF         INT_MAX/3
#define bcnt        __builtin_popcount
#define all(x)      (x).begin(),(x).end()
#define dbg(x)      cout<<#x"="<<x<<endl
#define ub(x,y)     upper_bound(all(x),y)-x.begin()
#define lb(x,y)     lower_bound(all(x),y)-x.begin()
#define uni(x)      x.erase(unique(all(x)),x.end())
#define rep(i,n)    repl(i,0,n-1)
#define repl(i,a,b) for(ll i=(ll)(a);i<=(ll)(b);i++)
#define mmax(x,y)   (x>y?x:y)
#define mmin(x,y)   (x<y?x:y)
#define maxch(x,y)  x=mmax(x,y)
#define minch(x,y)  x=mmin(x,y)
#define exist(x,y)  (find(all(x),y)!=x.end())
#define each(itr,v) for(auto itr:v)
#define usort(x)    sort(all(x))
#define dsort(x)    sort(all(x),greater<int>())
#define mkp(x,y)    make_pair(x,y)
#define N 3


ll seach_count = 0;

int h0(DVector tmp){
  return 0;
}

int h1(DVector &tmp){
  int ct = 0;
  rep(i,N)rep(j,N)if(amp[i][j] != tmp[i][j] && tmp[i][j] != 0 )ct++;
  return ct;
}

int h2(int n){

}

bool as(){

}


int main(){
  cin.sync_with_stdio(false);
  int mp[N][N];
  create_puzzle(mp);
}

Compiler output:
a.cc:2:10: fatal error: puzzle.h: No such file or directory
    2 | #include "puzzle.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

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

#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define INF INT_MAX/3
#define N 3
#define LIMIT_TIME 180000
typedef pair<int, int> P;

struct State {
    int g, h;
    string state;
    P blank;
    string path;
    bool operator<(const State &a) const {
        return g + h > a.g + a.h;
    }
};

int d[5] = {-1, 0, 1, 0, -1};
string r[4] = {"D", "R", "U", "L"};
string ans_str = "";
int ans[N][N], puzzle0[N][N], puzzle1[N][N];
set<string> s;
priority_queue<State> next_state;
string path;

bool range(int y, int x) {return 0 <= y && y < N && 0 <= x && x < N;}

int h0() {
    int find = -1;
    while(next_state.size()) {
        auto end = chrono::system_clock::now();
        auto dur = end - start;
        auto msec = chrono::duration_cast<chrono::milliseconds>(dur).count();
        if (msec > LIMIT_TIME) break;

        State state = next_state.top();
        next_state.pop();
        if (s.count(state.state)) continue; // already search
        s.insert(state.state); // visited

        P blank = state.blank;
        rep(i, 4) {
            int y = d[i] + blank.first, x = d[i + 1] + blank.second; // next blank position
            if (range(y, x)) { // can be replaced
                string tmp = state.state; // next state (string)
                int p = blank.first * N + blank.second, q = y * N + x;
                if (N < 4) swap(tmp[p], tmp[q]);
                else swap(tmp[2 * p], tmp[2 * q]), swap(tmp[2 * p + 1], tmp[2 * q + 1]);
                if (s.count(tmp)) continue; // already search

                if (tmp == ans_str) { // answer
                    find = state.g + 1;
                    path = state.path + r[i];
                    break;
                }

                next_state.push(State{state.g + 1, 0, tmp, P(y, x), state.path + r[i]});
            }
        }
        if (find != -1) break; // find an answer
    }
    return find;
}

int main(){
    rep(i, N)rep(j, N) cin >> puzzle0[i][j];

    string state = "";
    P blank;
    int manhattan = 0, wrong_place = 0;
    rep(i, N)rep(j, N) {
        // cout << puzzle0[i][j] << ((j % N == N - 1) ? "\n" : "\t");

        if (N * N - 1 > 9 && puzzle0[i][j] < 10) state += "0";
        state += to_string(puzzle0[i][j]);
        if (N * N - 1 > 9 && ans[i][j] < 10) ans_str += "0";
        ans_str += to_string(ans[i][j]);

        if(puzzle0[i][j] == 0) blank = P(i, j);
        else {
            int num = puzzle0[i][j] - 1;
            manhattan += (abs(num / N - i) + abs(num % N - j));
            if (puzzle0[i][j] != ans[i][j]) wrong_place++;
        }
    }

    if (manhattan == 0) { // the answer
        cout << 0 << endl;
    } else {
        s.clear();
        next_state = priority_queue<State>();
        next_state.push(State{0, manhattan, state, blank, ""});
        int steps = h0();
        cout << steps << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int h0()':
a.cc:35:26: error: 'start' was not declared in this scope
   35 |         auto dur = end - start;
      |                          ^~~~~
Language: C++

#include<iostream>
#include<cmath>
#include<string>
#include<map>
#include<queue>
using namespace std;
#define N 3
#define N2 9

struct Puzzle {
  int f[N2];
  int space;
  string path;

  bool operator < ( const Puzzle &p ) const {
    for ( int i = 0; i < N2; i++ ) {
      if ( f[i] == p.f[i] ) continue;
      return f[i] > p.f[i];
    }
    return false;
  }
};

static const int dx[4] = {-1, 0, 1, 0};
static const int dy[4] = {0, -1, 0, 1};
static const char dir[4] = {'u', 'l', 'd', 'r'};

bool isTarget(Puzzle p) {
  for ( int i = 0; i < N2; i++ )
    if ( p.f[i] != (i + 1) ) return false;
  return true;
}

string bfs(Puzzle p) {
  queue<Puzzle> Q;
  map<Puzzle, bool> V;
  Puzzle u, v;
  s.path = "";
  Q.push(s);
  V[s] = true;

  while ( !Q.empty() ) {
    u = Q.front(); Q.pop();
    if ( isTarget(u) ) return u.path;
    int sx = u.space / N;
    int sy = u.space % N;
    for ( int r = 0; r < 4; r++ ) {
      int tx = sx + dx[r];
      int ty = sy + dy[r];
      if ( tx < 0 || ty < 0 || tx >= N || ty >= N ) continue;
      v = u;
      swap(v.f[u.space], v.f[tx * N + ty]);
      v.space = tx * N + ty;
      if ( !V[v] ) {
        V[v] = true;
        v.path += dir[r];
        Q.push(v);
      }
    }
  }

  return "unsolvable";
}

int main() {
  Puzzle in;

  for ( int i = 0; i < N2; i++ ) {
    cin >> in.f[i];
    if ( in.f[i] == 0 ) {
      in.f[i] = N2;  // set space
      in.space = i;
    }
  }
  string ans = bfs(in);
  cout << ans.size() << endl;

  return 0;
}


Compiler output:
a.cc: In function 'std::string bfs(Puzzle)':
a.cc:38:3: error: 's' was not declared in this scope
   38 |   s.path = "";
      |   ^
Language: C++

#include <bits/stdc++.h>

using namespace std;


static const int dx[4] = {-1, 0, 1, 0};
static const int dy[4] = {0, -1, 0, 1};
static const char dir[4] = {'u', 'l', 'd', 'r'};
#define N 3
#define N2 9

int main()
{
    8puzzle in;
    for (int i = 0; i < N2; i++)
    {
        cin >> in.f[i];
        if (in.f[i] == 0)
        {
            in.f[i] = N2;
            in.space = i;
        }
    }
    string ans = bfs(in);
    cout << ans.size() << endl;

    return 0;
}

struct 8puzzle
{
    int f[N2];
    int space;
    string path;

    bool operator<(const 8puzzle & p) const
    {
        for (int i = 0; i < N2; i++)
        {
            if (f[i] == p.f[i])
                continue;
            return f[i] > p.f[i];
        }
        return false;
    }
};


bool isTarget(8puzzle p)
{
    for (int i = 0; i < N2; i++)
        if (p.f[i] != (i + 1))
            return false;
    return true;
}

string bfs(8puzzle s)
{
    queue<8puzzle> Q;
    map<8puzzle, bool> V;
    8puzzle u, v;
    s.path = "";
    Q.push(s);
    V[s] = true;

    while (!Q.empty())
    {
        u = Q.front();
        Q.pop();
        if (isTarget(u))
            return u.path;
        int sx = u.space / N;
        int sy = u.space % N;
        for (int r = 0; r < 4; r++)
        {
            int tx = sx + dx[r];
            int ty = sy + dy[r];
            if (tx < 0 || ty < 0 || tx >= N || ty >= N)
                continue;
            v = u;
            swap(v.f[u.space], v.f[tx * N + ty]);
            v.space = tx * N + ty;
            if (!V[v])
            {
                V[v] = true;
                v.path += dir[r];
                Q.push(v);
            }
        }
    }
    return "";
}



Compiler output:
a.cc: In function 'int main()':
a.cc:14:5: error: unable to find numeric literal operator 'operator""puzzle'
   14 |     8puzzle in;
      |     ^~~~~~~
a.cc:17:16: error: 'in' was not declared in this scope; did you mean 'i'?
   17 |         cin >> in.f[i];
      |                ^~
      |                i
a.cc:24:22: error: 'in' was not declared in this scope; did you mean 'yn'?
   24 |     string ans = bfs(in);
      |                      ^~
      |                      yn
a.cc:24:18: error: 'bfs' was not declared in this scope; did you mean 'ffs'?
   24 |     string ans = bfs(in);
      |                  ^~~
      |                  ffs
a.cc: At global scope:
a.cc:30:8: error: expected identifier before numeric constant
   30 | struct 8puzzle
      |        ^~~~~~~
a.cc:30:8: error: expected unqualified-id before numeric constant
a.cc:49:15: error: unable to find numeric literal operator 'operator""puzzle'
   49 | bool isTarget(8puzzle p)
      |               ^~~~~~~
a.cc:57:12: error: unable to find numeric literal operator 'operator""puzzle'
   57 | string bfs(8puzzle s)
      |            ^~~~~~~
a.cc:58:1: error: expected ',' or ';' before '{' token
   58 | {
      | ^
Language: C++

#include <bits/stdc++.h>

using namespace std;


static const int dx[4] = {-1, 0, 1, 0};
static const int dy[4] = {0, -1, 0, 1};
static const char dir[4] = {'u', 'l', 'd', 'r'};
#define N 3
#define N2 9

struct 8puzzle
{
    int f[N2];
    int space;
    string path;

    bool operator<(const 8puzzle & p) const
    {
        for (int i = 0; i < N2; i++)
        {
            if (f[i] == p.f[i])
                continue;
            return f[i] > p.f[i];
        }
        return false;
    }
};


bool isTarget(8puzzle p)
{
    for (int i = 0; i < N2; i++)
        if (p.f[i] != (i + 1))
            return false;
    return true;
}

string bfs(8puzzle s)
{
    queue<8puzzle> Q;
    map<8puzzle, bool> V;
    8puzzle u, v;
    s.path = "";
    Q.push(s);
    V[s] = true;

    while (!Q.empty())
    {
        u = Q.front();
        Q.pop();
        if (isTarget(u))
            return u.path;
        int sx = u.space / N;
        int sy = u.space % N;
        for (int r = 0; r < 4; r++)
        {
            int tx = sx + dx[r];
            int ty = sy + dy[r];
            if (tx < 0 || ty < 0 || tx >= N || ty >= N)
                continue;
            v = u;
            swap(v.f[u.space], v.f[tx * N + ty]);
            v.space = tx * N + ty;
            if (!V[v])
            {
                V[v] = true;
                v.path += dir[r];
                Q.push(v);
            }
        }
    }
    return "";
}

int main()
{
    8puzzle in;
    for (int i = 0; i < N2; i++)
    {
        cin >> in.f[i];
        if (in.f[i] == 0)
        {
            in.f[i] = N2;
            in.space = i;
        }
    }
    string ans = bfs(in);
    cout << ans.size() << endl;

    return 0;
}



Compiler output:
a.cc:12:8: error: expected identifier before numeric constant
   12 | struct 8puzzle
      |        ^~~~~~~
a.cc:12:8: error: expected unqualified-id before numeric constant
a.cc:31:15: error: unable to find numeric literal operator 'operator""puzzle'
   31 | bool isTarget(8puzzle p)
      |               ^~~~~~~
a.cc:39:12: error: unable to find numeric literal operator 'operator""puzzle'
   39 | string bfs(8puzzle s)
      |            ^~~~~~~
a.cc:40:1: error: expected ',' or ';' before '{' token
   40 | {
      | ^
a.cc: In function 'int main()':
a.cc:78:5: error: unable to find numeric literal operator 'operator""puzzle'
   78 |     8puzzle in;
      |     ^~~~~~~
a.cc:81:16: error: 'in' was not declared in this scope; did you mean 'i'?
   81 |         cin >> in.f[i];
      |                ^~
      |                i
a.cc:88:22: error: 'in' was not declared in this scope; did you mean 'yn'?
   88 |     string ans = bfs(in);
      |                      ^~
      |                      yn
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define N 3
#define N2 9

int main()
{
    8puzzle in;
    for (int i = 0; i < N2; i++)
    {
        cin >> in.f[i];
        if (in.f[i] == 0)
        {
            in.f[i] = N2;
            in.space = i;
        }
    }
    string ans = bfs(in);
    cout << ans.size() << endl;

    return 0;
}

struct 8puzzle
{
    int f[N2];
    int space;
    string path;

    bool operator<(const 8puzzle & p) const
    {
        for (int i = 0; i < N2; i++)
        {
            if (f[i] == p.f[i])
                continue;
            return f[i] > p.f[i];
        }
        return false;
    }
};

static const int dx[4] = {-1, 0, 1, 0};
static const int dy[4] = {0, -1, 0, 1};
static const char dir[4] = {'u', 'l', 'd', 'r'};

bool isTarget(8puzzle p)
{
    for (int i = 0; i < N2; i++)
        if (p.f[i] != (i + 1))
            return false;
    return true;
}

string bfs(8puzzle s)
{
    queue<8puzzle> Q;
    map<8puzzle, bool> V;
    8puzzle u, v;
    s.path = "";
    Q.push(s);
    V[s] = true;

    while (!Q.empty())
    {
        u = Q.front();
        Q.pop();
        if (isTarget(u))
            return u.path;
        int sx = u.space / N;
        int sy = u.space % N;
        for (int r = 0; r < 4; r++)
        {
            int tx = sx + dx[r];
            int ty = sy + dy[r];
            if (tx < 0 || ty < 0 || tx >= N || ty >= N)
                continue;
            v = u;
            swap(v.f[u.space], v.f[tx * N + ty]);
            v.space = tx * N + ty;
            if (!V[v])
            {
                V[v] = true;
                v.path += dir[r];
                Q.push(v);
            }
        }
    }
    return "";
}



Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: unable to find numeric literal operator 'operator""puzzle'
   10 |     8puzzle in;
      |     ^~~~~~~
a.cc:13:16: error: 'in' was not declared in this scope; did you mean 'i'?
   13 |         cin >> in.f[i];
      |                ^~
      |                i
a.cc:20:22: error: 'in' was not declared in this scope; did you mean 'yn'?
   20 |     string ans = bfs(in);
      |                      ^~
      |                      yn
a.cc:20:18: error: 'bfs' was not declared in this scope; did you mean 'ffs'?
   20 |     string ans = bfs(in);
      |                  ^~~
      |                  ffs
a.cc: At global scope:
a.cc:26:8: error: expected identifier before numeric constant
   26 | struct 8puzzle
      |        ^~~~~~~
a.cc:26:8: error: expected unqualified-id before numeric constant
a.cc:48:15: error: unable to find numeric literal operator 'operator""puzzle'
   48 | bool isTarget(8puzzle p)
      |               ^~~~~~~
a.cc:56:12: error: unable to find numeric literal operator 'operator""puzzle'
   56 | string bfs(8puzzle s)
      |            ^~~~~~~
a.cc:57:1: error: expected ',' or ';' before '{' token
   57 | {
      | ^
Language: C++

#include<bits/stdc++.h>

using namespace std;
#define N 3
#define N2 9
  
struct 8puzzle{
int f[N2];
int space;
string path;
  
bool operator < (const 8puzzle &p) const{
for(int i = 0; i < N2; i++){
if(f[i] == p.f[i]) continue;
return f[i] > p.f[i];
}
return false;
}
};
  
static const int dx[4] = {-1,0,1,0};
static const int dy[4] = {0,-1,0,1};
static const char dir[4] = {'u','l','d','r'};
  
bool isTarget(8puzzle p){
for(int i = 0; i < N2; i++)
if(p.f[i] != (i + 1)) return false;
return true;
}
  
string bfs(8puzzle s){
queue<8puzzle> Q;
map<8puzzle, bool> V;
8puzzle u, v;
s.path = "";
Q.push(s);
V[s] = true;
  
while(!Q.empty()){
u = Q.front(); Q.pop();
if(isTarget(u)) return u.path;
int sx = u.space / N;
int sy = u.space % N;
for(int r = 0; r < 4; r++){
int tx = sx + dx[r];
int ty = sy + dy[r];
if(tx < 0 || ty < 0 || tx >= N || ty >= N) continue;
v = u;
swap(v.f[u.space], v.f[tx * N + ty]);
v.space = tx * N + ty;
if(!V[v]){
V[v] = true;
v.path += dir[r];
Q.push(v);
}
}
}
return "";
}
  
int main(){
8puzzle in;
for(int i = 0; i < N2; i++){
cin >> in.f[i];
if(in.f[i] == 0){
in.f[i] = N2;
in.space = i;
}
}
string ans = bfs(in);
cout << ans.size() << endl;
  
return 0;
}


Compiler output:
a.cc:7:8: error: expected identifier before numeric constant
    7 | struct 8puzzle{
      |        ^~~~~~~
a.cc:7:8: error: expected unqualified-id before numeric constant
a.cc:25:15: error: unable to find numeric literal operator 'operator""puzzle'
   25 | bool isTarget(8puzzle p){
      |               ^~~~~~~
a.cc:31:12: error: unable to find numeric literal operator 'operator""puzzle'
   31 | string bfs(8puzzle s){
      |            ^~~~~~~
a.cc:31:22: error: expected ',' or ';' before '{' token
   31 | string bfs(8puzzle s){
      |                      ^
a.cc: In function 'int main()':
a.cc:62:1: error: unable to find numeric literal operator 'operator""puzzle'
   62 | 8puzzle in;
      | ^~~~~~~
a.cc:64:8: error: 'in' was not declared in this scope; did you mean 'i'?
   64 | cin >> in.f[i];
      |        ^~
      |        i
a.cc:70:18: error: 'in' was not declared in this scope; did you mean 'yn'?
   70 | string ans = bfs(in);
      |                  ^~
      |                  yn
Language: C++

#include<iostream>
#include<cmath>
#include<string>
#include<map>
#include<queue>

#include<bits/stdc++.h>

using namespace std;
#define N 3
#define N2 9
  
struct 8puzzle{
int f[N2];
int space;
string path;
  
bool operator < (const 8puzzle &p) const{
for(int i = 0; i < N2; i++){
if(f[i] == p.f[i]) continue;
return f[i] > p.f[i];
}
return false;
}
};
  
static const int dx[4] = {-1,0,1,0};
static const int dy[4] = {0,-1,0,1};
static const char dir[4] = {'u','l','d','r'};
  
bool isTarget(8puzzle p){
for(int i = 0; i < N2; i++)
if(p.f[i] != (i + 1)) return false;
return true;
}
  
string bfs(8puzzle s){
queue<8puzzle> Q;
map<8puzzle, bool> V;
8puzzle u, v;
s.path = "";
Q.push(s);
V[s] = true;
  
while(!Q.empty()){
u = Q.front(); Q.pop();
if(isTarget(u)) return u.path;
int sx = u.space / N;
int sy = u.space % N;
for(int r = 0; r < 4; r++){
int tx = sx + dx[r];
int ty = sy + dy[r];
if(tx < 0 || ty < 0 || tx >= N || ty >= N) continue;
v = u;
swap(v.f[u.space], v.f[tx * N + ty]);
v.space = tx * N + ty;
if(!V[v]){
V[v] = true;
v.path += dir[r];
Q.push(v);
}
}
}
return "";
}
  
int main(){
8puzzle in;
for(int i = 0; i < N2; i++){
cin >> in.f[i];
if(in.f[i] == 0){
in.f[i] = N2;
in.space = i;
}
}
string ans = bfs(in);
cout << ans.size() << endl;
  
return 0;
}


Compiler output:
a.cc:13:8: error: expected identifier before numeric constant
   13 | struct 8puzzle{
      |        ^~~~~~~
a.cc:13:8: error: expected unqualified-id before numeric constant
a.cc:31:15: error: unable to find numeric literal operator 'operator""puzzle'
   31 | bool isTarget(8puzzle p){
      |               ^~~~~~~
a.cc:37:12: error: unable to find numeric literal operator 'operator""puzzle'
   37 | string bfs(8puzzle s){
      |            ^~~~~~~
a.cc:37:22: error: expected ',' or ';' before '{' token
   37 | string bfs(8puzzle s){
      |                      ^
a.cc: In function 'int main()':
a.cc:68:1: error: unable to find numeric literal operator 'operator""puzzle'
   68 | 8puzzle in;
      | ^~~~~~~
a.cc:70:8: error: 'in' was not declared in this scope; did you mean 'i'?
   70 | cin >> in.f[i];
      |        ^~
      |        i
a.cc:76:18: error: 'in' was not declared in this scope; did you mean 'yn'?
   76 | string ans = bfs(in);
      |                  ^~
      |                  yn
Language: C++


#include<iostream>
#include<cmath>
#include<string>
#include<map>
#include<queue>

using namespace std;

#define N 3
#define N2 9

struct Puzzle {
  int f[N2];
  int space;
  string path;

  bool operator < (const Puzzle& p) const {
    for (int i = 0; i < N2; i++) {
      if (f[i] == p.f[i]) {
        continue;
      }
      return f[i] > p.f[i];
    }
    return false;
  }
};

static const int dx[4] = {-1, 0, 1, 0};
static const int dy[4] = {0, -1, 0, 1};
static const char dir[4] = {'u', 'l', 'd', 'r'};

bool isTarget(Puzzle p) {
  for (int i = 0; i < N2; i++) {
    if (p.f[i] != (i + 1)) {
      return false;
    }
  }
  return true;
}

string bfs(Puzzle s) {
  queue<Puzzle> Q;
  map<Puzzle, bool> V;
  Puzzle u, v;
  s.path = "";
  Q.push(s);
  V[s] = true;

  while (!Q.empty()) {
    u = Q.front(); Q.pop();
    if (isTarget(u)) {
      return u.path;
    }
    int sx = u.space / N;
    int sy = u.space % N;
    for (int r = 0; r < 4; r++) {
      int tx = sx + dx[r];
      int ty = sy + dy[r];
      if (tx < 0 || ty < 0 || tx >= || ty >= N) {
        continue;
      }
      v = u;
      swap(v.f[u.space], v.f[tx * N + ty]);
      v.space = tx * N + ty;
      if (!V[v]) {
        V[v] = true;
        v.path += dir[r];
        Q.push(v);
      }
    }
  }
  return "unsolvable";
}

int main(){
  Puzzle in;

  for (int i = 0; i < N2; i++) {
    cin >> in.f[i];
    if (in.f[i] == 0) {
      in.f[i] = N2; // set space
      in.space = i;
    }
  }

  string ans = bfs(in);
  cout << and.size() << endl;

  return 0;
}



Compiler output:
a.cc: In function 'std::string bfs(Puzzle)':
a.cc:60:37: error: expected primary-expression before '||' token
   60 |       if (tx < 0 || ty < 0 || tx >= || ty >= N) {
      |                                     ^~
a.cc: In function 'int main()':
a.cc:88:14: error: expected identifier before '.' token
   88 |   cout << and.size() << endl;
      |              ^
Language: C++

#include<iostream>
#include<cmath>
#include<string>
#include<map>
#include<queue>

using namespace std;

#define N 3
#define N2 9

struct Puzzle {
  int f[N2];
  int space;
  string path;

  bool operator < (const Puzzle& p) const {
    for (int i = 0; i < N2; i++) {
      if (f[i] == p.f[i]) {
        continue;
      }
      return f[i] > p.f[i];
    }
    return false;
  }
};

static const int dx[4] = {-1, 0, 1, 0};
static const int dy[4] = {0, -1, 0, 1};
static const char dir[4] = {'u', 'l', 'd', 'r'};

bool isTarget(Puzzle p) {
  for (int i = 0; i < N2; i++) {
    if (p.f[i] != (i + 1)) {
      return false;
    }
  }
  return true;
}

string bfs(Puzzle s) {
  queue<Puzzle> Q;
  map<Puzzle, bool> V;
  Puzzle u, v;
  s.path = "";
  Q.push(s);
  V[s] = true;

  while (!Q.empty()) {
    u = Q.front(); Q.pop();
    if (isTarget(u)) {
      return u.path;
    }
    int sx = u.space / N;
    int sy = u.space % N;
    for (int r = 0; r < 4; r++) {
      int tx = sx + dx[r];
      int ty = sy + dy[r];
      if (tx < 0 || ty < 0 || tx >= || ty >= N) {
        continue;
      }
      v = u;
      swap(v.f[u.space], v.f[tx * N + ty]);
      v.space = tx * N + ty;
      if (!V[v]) {
        V[v] = true;
        v.path += dir[r];
        Q.push(v);
      }
    }
  }
  return "unsolvable";
}

int main(){
  Puzzle in;

  for (int i = 0; i < N2; i++) {
    cin >> in.f[i];
    if (in.f[i] == 0) {
      in.f[i] = N2; // set space
      in.space = i;
    }
  }

  string ans = bfs(in);
  cout << ans.size() << endl;

  return 0;
}



Compiler output:
a.cc: In function 'std::string bfs(Puzzle)':
a.cc:59:37: error: expected primary-expression before '||' token
   59 |       if (tx < 0 || ty < 0 || tx >= || ty >= N) {
      |                                     ^~
Language: Java

import java.util.HashMap;
    import java.util.Scanner;
    private static int n;
    private static int limit;
    private static String ans;
    private static final int[] d = {4, -4, -1, 1};
    private static HashMap<String, Integer> hm;
    public class Main {
        public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);
            n = 16;
            char[] s = new char[n];
            for (int i = 0; i < n; i++) {
                s[i] = (char)('0' + sc.nextInt());
            }
            ans = "123456789:;<=>?0";
            for (int i = 0; i < 46; i++) {
                hm = new HashMap<String, Integer>();
                limit = i;
                dfs(new Panel(toString(s), 0));
            }
            sc.close();
        }
        private static void dfs(Panel u) {
            if (u.s.equals(ans)) {
                System.out.println(u.count);
                System.exit(0);
            }
            if (u.count + u.min > limit) {
                return;
            }
            hm.put(u.s, u.count);
            StringBuffer str = new StringBuffer(u.s);
            int zero = str.indexOf("0");
            assert (zero != -1);
            for (int i = 0; i < d.length; i++) {
                if (zero + d[i] >= 0 && zero + d[i] < n && !(d[i] == -1 && (zero + d[i]) % 4 == 3) && !(d[i] == 1 && (zero + d[i]) % 4 == 0)) {
                    str.setCharAt(zero, str.charAt(zero + d[i]));
                    str.setCharAt(zero + d[i], '0');
                    String tmps = str.toString();
                    if (!hm.containsKey(tmps) || hm.get(tmps) > u.count + 1) {
                        dfs(new Panel(tmps, u.count + 1));
                    }
                    str.setCharAt(zero + d[i], str.charAt(zero));
                    str.setCharAt(zero, '0');
                }
            }
        }

        private static class Panel {
            String s;
            int count;
            int min;
            Panel (String s, int count) {
                this.s = s;
                this.count = count;
                this.min = getMin(s);
            }
            private int getMin(String s) {
                char[] c = s.toCharArray();
                int ret = 0;
                for (int i = 0; i < c.length; i++) {
                    int tmp = c[i] - '0';
                    if (tmp != 0) {
                        int x = (tmp - 1) % 4;
                        int y = (tmp - 1) / 4;
                        ret += Math.abs(x - i % 4) + Math.abs(y - i / 4);
                    }
                }
                return ret;
            }
        }
        private static String toString(char[] s) {
            String ret = "";
            for (int i = 0; i < s.length; i++) {
                ret += s[i];
            }
            return ret;
        }
    }


Compiler output:
Main.java:3: error: unnamed classes are a preview feature and are disabled by default.
    private static int n;
                   ^
  (use --enable-preview to enable unnamed classes)
1 error