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

#include<iostream>
#include<queue>
#include<vector>

using namespace std;

class Puzzle{

public:
  vector<vector<int> > p;
  int lastorder;//1 ???  3?????? 5 ??????
  int ordernum;

  Puzzle(){
    this->p.resize(2);

    for(int i=0;i<2;i++){
      this->p[i].resize(4);
    }

    this->lastorder = 60;
    this->ordernum = 0;

  }

  Puzzle& operator=(const Puzzle& p1){
    for(int i=0;i<2;i++){
      for(int j=0;j<4;j++){
        this->p[i][j] = p1.p[i][j];
      }
    }
    this->lastorder = p1.lastorder;
    this->ordernum = p1.ordernum;
  }

  ~Puzzle(){


    vector<int>().swap(p);
  }

};

int main(){

  while(!cin.eof()){

    queue<Puzzle> q;

    Puzzle Start;

    for(int i=0;i < 2; i++){
      for(int j=0;j < 4; j++){
        cin >> Start.p[i][j];
      }
    }


    q.push(Start);

    while(1){

      Puzzle tmp;
      tmp = q.front();
      q.pop();

      bool ok = true;

      for(int i=0;i < 2; i++){
        for(int j=0;j < 4; j++){
          if(tmp.p[i][j] != (i*4 + j)){
            ok = false;
            break;
          }
        }
      }

      if(ok){
          cout << tmp.ordernum << endl;
          break;
      }

      int x,y;

      for(int i=0;i < 2; i++){
        for(int j=0;j < 4; j++){
          if(tmp.p[i][j] == 0){
            x = j;
            y = i;
          }
        }
      }

      tmp.ordernum++;

      Puzzle Beforetmp = tmp;

      //int beforeorder = tmp.lastorder;


      if(x != 3 && Beforetmp.lastorder != 3){
        swap(tmp.p[y][x],tmp.p[y][x+1]);
        tmp.lastorder = 1;
        q.push(tmp);
        tmp = Beforetmp;
      }

      if(x != 0 && Beforetmp.lastorder !=  1){
        swap(tmp.p[y][x],tmp.p[y][x-1]);
        tmp.lastorder = 3;
        q.push(tmp);
        tmp = Beforetmp;
      }

      if(Beforetmp.lastorder !=  5){
        swap(tmp.p[0][x],tmp.p[1][x]);
        tmp.lastorder = 5;
        q.push(tmp);
      }



    }

  }


    return 0;
}

Compiler output:
a.cc: In member function 'Puzzle& Puzzle::operator=(const Puzzle&)':
a.cc:34:3: warning: no return statement in function returning non-void [-Wreturn-type]
   33 |     this->ordernum = p1.ordernum;
  +++ |+  return *this;
   34 |   }
      |   ^
a.cc: In destructor 'Puzzle::~Puzzle()':
a.cc:39:24: error: cannot convert 'std::vector<std::vector<int> >' to 'std::vector<int>&'
   39 |     vector<int>().swap(p);
      |                        ^
      |                        |
      |                        std::vector<std::vector<int> >
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/queue:63,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:1588:20: note:   initializing argument 1 of 'void std::vector<_Tp, _Alloc>::swap(std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>]'
 1588 |       swap(vector& __x) _GLIBCXX_NOEXCEPT
      |            ~~~~~~~~^~~
Language: C++

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

class SP{
public:
    int p[2][4];
    int n;
    
    bool finish(){
    	p[0][0]==0 && p[0][1]==1 && p[0][2]==2 && p[0][3]==3&&
    	p[1][0]==4 && p[1][1]==5 && p[1][2]==6 && p[1][3]==7;
	}
	
	void move_right(int x,int y){
		if(x!=3)
			swap(p[y][x],p[y][x+1])
	}	
	
	void move_left(int x,int y){
		if(x!=0)
			swap(p[y][x],p[y][x-1])
	}	
	
	void move_up(int x,int y){
		if(y!=0)
			swap(p[y][x],p[y+1][x])
	}	
	
	void move_down(int x,int y){
		if(y!=1)
			swap(p[y][x],p[y-1][x])
	}		
}    
      
int main()
{
	SP sp;
	sp.n=0;
	
	int zx,zy;
	
	for(y=0;y<2;y++){
		for(x=0;x<4;x++){
			cin>>sp.p[y][x];
			if(sp.p[y][x]==0){
				zx=x;
				zy=y;
			}
		}
	}
	
	queue<SP> que;
	que.push(sp);
	
	while(!que.empty()){
		sp=que.front();
		que.pop();
		
		if(sp.finish()){
			cout<<sp.n<<endl;
			break;
		}
	
	SP sp1=sp; sp1.move_right(zx,zy); sp1.n++; que.push(sp1);	
	SP sp2=sp; sp2.move_left(zx,zy);  sp2.n++; que.push(sp2);
	SP sp3=sp; sp3.move_up(zx,zy);    sp3.n++; que.push(sp3);
	SP sp4=sp; sp4.move_down(zx,zy);  sp4.n++; que.push(sp4);
			
    return 0;
}      	

Compiler output:
a.cc:35:2: error: expected ';' after class definition
   35 | }
      |  ^
      |  ;
a.cc: In member function 'bool SP::finish()':
a.cc:14:9: warning: no return statement in function returning non-void [-Wreturn-type]
   14 |         }
      |         ^
a.cc: In member function 'void SP::move_right(int, int)':
a.cc:19:9: error: expected ';' before '}' token
   19 |         }
      |         ^
a.cc: In member function 'void SP::move_left(int, int)':
a.cc:24:9: error: expected ';' before '}' token
   24 |         }
      |         ^
a.cc: In member function 'void SP::move_up(int, int)':
a.cc:29:9: error: expected ';' before '}' token
   29 |         }
      |         ^
a.cc: In member function 'void SP::move_down(int, int)':
a.cc:34:9: error: expected ';' before '}' token
   34 |         }
      |         ^
a.cc: In function 'int main()':
a.cc:44:13: error: 'y' was not declared in this scope; did you mean 'zy'?
   44 |         for(y=0;y<2;y++){
      |             ^
      |             zy
a.cc:45:21: error: 'x' was not declared in this scope; did you mean 'zx'?
   45 |                 for(x=0;x<4;x++){
      |                     ^
      |                     zx
a.cc:72:2: error: expected '}' at end of input
   72 | }
      |  ^
a.cc:38:1: note: to match this '{'
   38 | {
      | ^
Language: C++

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

class SP{
public:
    int p[2][4];
    int n;
    
    bool finish(){
    	p[0][0]==0 && p[0][1]==1 && p[0][2]==2 && p[0][3]==3&&
    	p[1][0]==4 && p[1][1]==5 && p[1][2]==6 && p[1][3]==7;
	}
	
	void move_right(int x,int y){
		if(x!=3)
			swap(p[y][x],p[y][x+1])
	}	
	
	void move_left(int x,int y){
		if(x!=0)
			swap(p[y][x],p[y][x-1])
	}	
	
	void move_up(int x,int y){
		if(y!=0)
			swap(p[y][x],p[y+1][x])
	}	
	
	void move_down(int x,int y){
		if(y!=1)
			swap(p[y][x],p[y-1][x])
	}		
};
      
int main()
{
	SP sp;
	sp.n=0;
	
	int zx,zy;
	
	for(y=0;y<2;y++){
		for(x=0;x<4;x++){
			cin>>sp.p[y][x];
			if(sp.p[y][x]==0){
				zx=x;
				zy=y;
			}
		}
	}
	
	queue<SP> que;
	que.push(sp);
	
	while(!que.empty()){
		sp=que.front();
		que.pop();
		
		if(sp.finish()){
			cout<<sp.n<<endl;
			break;
		}
	
	SP sp1=sp; sp1.move_right(zx,zy); sp1.n++; que.push(sp1);	
	SP sp2=sp; sp2.move_left(zx,zy);  sp2.n++; que.push(sp2);
	SP sp3=sp; sp3.move_up(zx,zy);    sp3.n++; que.push(sp3);
	SP sp4=sp; sp4.move_down(zx,zy);  sp4.n++; que.push(sp4);
			
    return 0;
}      	

Compiler output:
a.cc: In member function 'bool SP::finish()':
a.cc:14:9: warning: no return statement in function returning non-void [-Wreturn-type]
   14 |         }
      |         ^
a.cc: In member function 'void SP::move_right(int, int)':
a.cc:19:9: error: expected ';' before '}' token
   19 |         }
      |         ^
a.cc: In member function 'void SP::move_left(int, int)':
a.cc:24:9: error: expected ';' before '}' token
   24 |         }
      |         ^
a.cc: In member function 'void SP::move_up(int, int)':
a.cc:29:9: error: expected ';' before '}' token
   29 |         }
      |         ^
a.cc: In member function 'void SP::move_down(int, int)':
a.cc:34:9: error: expected ';' before '}' token
   34 |         }
      |         ^
a.cc: In function 'int main()':
a.cc:44:13: error: 'y' was not declared in this scope; did you mean 'zy'?
   44 |         for(y=0;y<2;y++){
      |             ^
      |             zy
a.cc:45:21: error: 'x' was not declared in this scope; did you mean 'zx'?
   45 |                 for(x=0;x<4;x++){
      |                     ^
      |                     zx
a.cc:72:2: error: expected '}' at end of input
   72 | }
      |  ^
a.cc:38:1: note: to match this '{'
   38 | {
      | ^
Language: C++

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

class SP{
public:
    int p[2][4];
    int n;
    
    bool finish(){
    	p[0][0]==0 && p[0][1]==1 && p[0][2]==2 && p[0][3]==3&&
    	p[1][0]==4 && p[1][1]==5 && p[1][2]==6 && p[1][3]==7;
	}
	
	void move_right(int x,int y){
		if(x!=3)
			swap(p[y][x],p[y][x+1]);
	}	
	
	void move_left(int x,int y){
		if(x!=0)
			swap(p[y][x],p[y][x-1]);
	}	
	
	void move_up(int x,int y){
		if(y!=0)
			swap(p[y][x],p[y+1][x]);
	}	
	
	void move_down(int x,int y){
		if(y!=1)
			swap(p[y][x],p[y-1][x]);
	}		
};    
      
int main()
{
	SP sp;
	sp.n=0;
	
	int zx,zy;
	
	for(y=0;y<2;y++){
		for(x=0;x<4;x++){
			cin>>sp.p[y][x];
			if(sp.p[y][x]==0){
				zx=x;
				zy=y;
			}
		}
	}
	
	queue<SP> que;
	que.push(sp);
	
	while(!que.empty()){
		sp=que.front();
		que.pop();
		
		if(sp.finish()){
			cout<<sp.n<<endl;
			break;
		}
	
	SP sp1=sp; sp1.move_right(zx,zy); sp1.n++; que.push(sp1);	
	SP sp2=sp; sp2.move_left(zx,zy);  sp2.n++; que.push(sp2);
	SP sp3=sp; sp3.move_up(zx,zy);    sp3.n++; que.push(sp3);
	SP sp4=sp; sp4.move_down(zx,zy);  sp4.n++; que.push(sp4);
			
    return 0;
}      	

Compiler output:
a.cc: In member function 'bool SP::finish()':
a.cc:14:9: warning: no return statement in function returning non-void [-Wreturn-type]
   14 |         }
      |         ^
a.cc: In function 'int main()':
a.cc:44:13: error: 'y' was not declared in this scope; did you mean 'zy'?
   44 |         for(y=0;y<2;y++){
      |             ^
      |             zy
a.cc:45:21: error: 'x' was not declared in this scope; did you mean 'zx'?
   45 |                 for(x=0;x<4;x++){
      |                     ^
      |                     zx
a.cc:72:2: error: expected '}' at end of input
   72 | }
      |  ^
a.cc:38:1: note: to match this '{'
   38 | {
      | ^
Language: C++

#include <iostream>
#include <map>
#include <string>

using namespace std;

void swap(char *a,char *b){
  char temp = *a;
  *a = *b;
  *b = temp;
}
 
int main(){
  int dx[] = {+1,-1,+4,-4};
 
  string start = "01234567";
 
  queue<string> que;
  map<string,int> d;
  que.push(start);
  d[start] = 0;
 
  while(que.size()){
    string q = que.front(); que.pop();
    int x = q.find("0");
    for(int i=0;i<4;i++){
      int next = x + dx[i];
      if( next>=0 && next<=7 && !(x==3&&next==4) && !(x==4&&next==3) ){
        string nextq = q;
        swap(&nextq[x],&nextq[next]);
        if(d.find(nextq)==d.end()){
          que.push(nextq);
          d[nextq] = d[q] + 1;
        }
      }
    }
  }
 
  while(1){
    string input = "";
    char temp;
    for(int i=0;i<8;i++){
      if(cin >> temp){
        input.push_back(temp);
      }else{
        return 0;
      }
    }
    cout << d[input] << endl;
  }
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:3: error: 'queue' was not declared in this scope
   18 |   queue<string> que;
      |   ^~~~~
a.cc:3:1: note: 'std::queue' is defined in header '<queue>'; this is probably fixable by adding '#include <queue>'
    2 | #include <map>
  +++ |+#include <queue>
    3 | #include <string>
a.cc:18:15: error: expected primary-expression before '>' token
   18 |   queue<string> que;
      |               ^
a.cc:18:17: error: 'que' was not declared in this scope
   18 |   queue<string> que;
      |                 ^~~
Language: C++

#include<iostream>
#include<queue>
#include<algorithm>
using namespace std;
 
class SevenPuzzle{
public:
	int p[2][4];
	int n;
	int zero_x,zero_y;

	bool finish(){
		return p[0][0]==0&&p[0][1]==1&&p[0][2]==2&&p[0][3]==3&&
			p[1][0]==4&&p[1][1]==5&&p[1][2]==6&&p[1][3]==7;
	}
	
	void move_right(int x,int y){
		if(zero_x!=3){
			swap(p[y][x],p[y][x+1]);
			zero_x=x+1;
		}
	}	

	void move_left(int x,int y){
		if(zero_x!=0){
			swap(p[y][x],p[y][x-1]);
			zero_x=x-1;
		}
	}	

	void move_up(int x,int y){
		if(zero_y!=0){
			swap(p[y][x],p[y-1][x]);
			zero_y=y-1;
		}
	}	

	void move_down(int x,int y){
		if(zero_y!=1){
			swap(p[y][x],p[y+1][x]);
			zero_y=y+1;
		}
	}	

};

int main(){
	
	for(int a=0;a<1000;a++){
		SevenPuzzle SP;;
		SP.n=0;

		for(int i=0;i<2;i++){A
			for(int j=0;j<4;j++){
				cin>>SP.p[i][j];
				if(SP.p[i][j]==0){
					SP.zero_x=j; SP.zero_y=i;
				}
			}
		}

		queue<SevenPuzzle> que;
		que.push(SP);

		while(!que.empty()){
			SP=que.front(); que.pop();

			if(SP.finish()){
				cout<<SP.n<<endl;
				break;
			}
	
			SevenPuzzle next1=SP; next1.move_right(next1.zero_x,next1.zero_y); next1.n++; que.push(next1);//????§????

			SevenPuzzle next2=SP; next2.move_left(next2.zero_x,next2.zero_y); next2.n++; que.push(next2);//????§????

			SevenPuzzle next3=SP; next3.move_up(next3.zero_x,next3.zero_y); next3.n++; que.push(next3);//????§????
	
			SevenPuzzle next4=SP; next4.move_down(next4.zero_x,next4.zero_y); next4.n++; que.push(next4);//????§????
		}
	}

	return 0;
}
	

Compiler output:
a.cc: In function 'int main()':
a.cc:53:38: error: 'A' was not declared in this scope
   53 |                 for(int i=0;i<2;i++){A
      |                                      ^
a.cc:54:37: error: 'j' was not declared in this scope
   54 |                         for(int j=0;j<4;j++){
      |                                     ^
Language: C++

#include<iostream>
#include<queue>
#include<vector>

using namespace std;

bool checker[8][8][8][8][8][8][8];

class Puzzle{

public:
  short** p;
  short lastorder;//1 ???  3?????? 5 ??????
  short ordernum;

  Puzzle(){
    p = new short*[2];
    for(int i=0; i<2; i++){
      p[i] = new short[4];
    }
    this->lastorder = 8;
    this->ordernum = 0;
  }

  Puzzle(const Puzzle* puzzle){
    p = new short*[2];
    for(int i=0; i<2; i++){
      p[i] = new short[4];
    }
    for(int i=0;i<2;i++){
      for(int j=0;j<4;j++){
        p[i][j] = puzzle->p[i][j];
      }
    }
    this->lastorder = puzzle->lastorder;
    this->ordernum = puzzle->ordernum;
  }

  ~Puzzle(){
    for(int i=0; i<2; i++){
      delete[] p[i];
    }
    delete[] p;
  }

  inline bool check(){
    return(checker[p[0][0]][p[0][1]][p[0][2]][p[0][3]][p[1][0]][p[1][1]][p[1][2]]);

  }

};




int main(){

  for(int a=0;a<8;a++){
    for(int b=0;b<8;b++){
      for(int c=0;c<8;c++){
        for(int d=0;d<8;d++){
          for(int e=0;e<8;e++){
            for(int f=0;f<8;f++){
              for(int g=0;g<8;g++){
                checker[a][b][c][[d]][e][f][g] = false;
              }
            }
          }
        }
      }
    }
  }

  while(1){

    queue<Puzzle*> q;

    Puzzle* Start;
    Start = new Puzzle;

    for(short i=0;i < 2; i++){
      for(short j=0;j < 4; j++){
        cin >> Start->p[i][j];
      }
    }
    if(cin.eof()){
      break;
    }

    q.push(Start);

    while(!q.empty()){

      Puzzle* tmp;
      tmp = q.front();
      q.pop();

      bool ok = false;


      if(tmp->p[0][0] == 0 && tmp->p[0][1] == 1 && tmp->p[0][2] == 2 && tmp->p[0][3] == 3 && tmp->p[1][0] == 4 && tmp->p[1][1] == 5 && tmp->p[1][2] == 6)
        ok = true;

      if(ok){
          cout << tmp->ordernum << endl;
          delete tmp;
          while(!q.empty()){
            tmp = q.front();
            q.pop();
            delete tmp;
          }
          break;
      }

      short x,y;

      for(short i=0;i < 2; i++){
        for(short j=0;j < 4; j++){
          if(tmp->p[i][j] == 0){
            x = j;
            y = i;
          }
        }
      }

      tmp->ordernum++;

      short Beforeorder = tmp->lastorder;

      Puzzle* puzzle;
      puzzle = new Puzzle(tmp);


      if(x != 3 && Beforeorder != 3 && puzzle->check()){
        swap(puzzle->p[y][x],puzzle->p[y][x+1]);
        puzzle->lastorder = 1;
        q.push(puzzle);
        puzzle = new Puzzle(tmp);
      }

      if(x != 0 && Beforeorder !=  1 && puzzle->check()){
        swap(puzzle->p[y][x],puzzle->p[y][x-1]);
        puzzle->lastorder = 3;
        q.push(puzzle);
        puzzle = new Puzzle(tmp);
      }

      if(Beforeorder !=  5  && puzzle->check()){
        swap(puzzle->p[0][x],puzzle->p[1][x]);
        puzzle->lastorder = 5;
        q.push(puzzle);
      }

      delete tmp;

    }

  }


    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:65:33: error: two consecutive '[' shall only introduce an attribute before '[' token
   65 |                 checker[a][b][c][[d]][e][f][g] = false;
      |                                 ^
Language: C++

#include <iostream>
#include <cstdio>
#include <cstring>
#include <queue>
#include <stack>
#include <fstream>
#include <vector>
#include <map>
#include <set>
#include <cmath>
#include <algorithm>
#include <functional>
#define inf 0x3f3f3f3f
#define inff -30000000
using namespace std;
typedef long long ll;
const int MAXN=1e5+10;
const int MAX=20+10;
typedef pair<string,int>P;
map<string,int>save;
string s[MAX];
int d[5]={-1,1,-4,4};
void bfs(){
    queue<P>q;
    q.push(P("01234567",0));
    save["01234567"]=0;
    while(!q.empty()){
        P t=q.front();
        q.pop();
        int flag=t.second;
        for(int i=0;i<4;i++){
            if((flag==3&&d[i]==1||(flag==4&&d[i]==-1))||flag+d[i]<0||flag+d[i]>=8)
                continue;
            string str=t.first;
            swap(str[flag],str[flag+d[i]]);
            if(save.find(str)==save.end()){
                save[str]=save[t.first]+1;
                q.push(P(str,flag+d[i]));
            }
        }
    }
}
int main(){
    #ifdef SIYU
    freopen("in.txt","r",stdin);
    #endif // SIYU
    bfs();
    char ch[50],chh[50];
    while(gets(ch)){
        string siyu;
        int j=0;
        for(int i=0;i<strlen(ch);i++){
            if(ch[i]!=' '){
                chh[j++]=ch[i];
            }
        }
        chh[8]='\0';
        siyu=chh;
        cout<<save[siyu]<<endl;

    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:11: error: 'gets' was not declared in this scope; did you mean 'getw'?
   49 |     while(gets(ch)){
      |           ^~~~
      |           getw
Language: C++

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

string swp(string s, const int& a, const int &b) {
  swap(s[a],s[b]); return s;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);

  string s = "01234567";

  queue<string> q;
  map<string, int> m;

  q.push(s);
  m[s] = 0;

  while (!q.empty()) {
    string t = q.front(); q.pop();
    int idx = t.find('0');
    string u;
    if (idx-1 >= 0 && idx != 4) {
      u = swp(t, idx, idx-1);
      if (m.find(u) == m.end()) {
        m[u] = m[t] + 1;
        q.push(u);
      }
    }
    if (idx + 1 < 8 && idx != 3) {
      u = swp(t, idx, idx+1);
      if (m.find[u] == m.end()) {
        m[u] = m[t] + 1;
        q.push(u);
      }
    }
    if (idx - 4 >= 0) {
      u = swp(t, idx, idx-4);
      if (m.find(u) == m.end()) {
        m[u] = m[t] + 1;
        m.push(u);
      }
    }
    if (idx + 4 < 0) {
      u = swp(t, idx, idx+4);
      if (m.find(u) == m.end()) {
        m[u] = m[t] + 1;
        q.push(u);
      }
    }
  }

  string line; stringstream ss;
  while (getline(cin, line)) {
    ss << line;
    string t = "";
    for (int i = 0; i < 8; ++i) {
      char c; ss >> c; t += c;
    }
    cout << m[t] << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:17: error: no match for 'operator[]' (operand types are '<unresolved overloaded function type>' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   33 |       if (m.find[u] == m.end()) {
      |                 ^
a.cc:42:11: error: 'class std::map<std::__cxx11::basic_string<char>, int>' has no member named 'push'
   42 |         m.push(u);
      |           ^~~~
Language: C++

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

using namespace std;

typedef pair<int,string> P;

int main(){
  int d[4] = {-1,1,-4,4};
  map<string,int> ans;
  ans["01234567"] = 0;
  queue<P> que;
  que.push(P(0,"01234567"));

  while(que.size()){
    P p = que.front(); que.pop();
    int k = ans[p.second];
    for(int i = 0;i < 4;i++){
      int n = p.first + d[i];
      if(i == 0 && n == 3)continue;
      if(i == 1 && n == 4)continue;
      if(n >= 0 && n < 8){
	       string tmp;
	       tmp = p.second
	       tmp[p.first] = tmp[n];
         tmp[n] = '0';
         if(ans.find(tmp) == ans.end()){
	          ans[tmp] = k + 1;
	          que.push(P(n,tmp));
	        }
        }
      }
    }
  string s;
  char t;
  while(cin >> t){
    s += t;
    for(int i = 0;i < 7;i++){
      cin >> t;
      s += t;
    }
    cout << ans[s] << endl;
    s.clear();
  }

  return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:30: error: expected ';' before 'tmp'
   24 |                tmp = p.second
      |                              ^
      |                              ;
   25 |                tmp[p.first] = tmp[n];
      |                ~~~
Language: C++

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <queue>
#include <cmath>
#include <map>
#include <algorithm>
#include <stack>
#include <set>
//反向bfs
using namespace std;
map<string ,int> t;
int num;
int mv[]={-4,4,1,-1};//上下右左
void bfs(string st)
{
    queue<string> q;
    t[st]=1;
    q.push(st);
    while(!q.empty())
    {

       s=q.front(),q.pop();
//        int nu=st.find('0');
//        for(int i=0;i<4;i++)
//        {
//            int tn=nu+mv[i];
//            if(tn<0||tn>7||tn==3&&mv[i]==1||tn==4&&mv[i]==-1)
//                continue;
//                string tp=st;
//            swap(tp[nu],tp[nu+mv[i]]);
//            if(!t[tp])
//            {
//                    q.push(tp);
//                    t[tp]=t[st]+1;
//            }
//
//
//        }
//        }
//
  
   // t[st]=1;q.push(st); //起始状?
  //  while(!q.empty())
  //  {
        //st=q.front();q.pop();
        int num=st.find('0');//找到空格位置
        for(int i=0;i<4;++i)
        {
            int tn=num+mv[i];//可能??的数?
            if(tn<0||tn>7||num==3&&mv[i]==1||num==4&&mv[i]==-1)
            //空格在3的?候，4不能??，因?3 4 不相?，反之同理
            {
                continue;
            }
            string tp=st;
            swap(tp[num],tp[num+mv[i]]);//移?物?
            if(!t[tp])//未出??的状?
            {
                q.push(tp);
                t[tp]=t[st]+1;
            }
        }
    }
}

int main()
{
    string st="01234567";
    bfs(st);
    while(scanf("%d",&num)!=EOF)
    {
        st[0]=num+'0';
        for(int i=1;i<8;i++)
        {
            scanf("%d",&num);
            st[i]=num+'0';
        }
        cout<<t[st]-1<<endl;
    }

}

Compiler output:
a.cc: In function 'void bfs(std::string)':
a.cc:25:8: error: 's' was not declared in this scope
   25 |        s=q.front(),q.pop();
      |        ^
Language: C++

#include<stdio.h>
#include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<stack>
#include<map>
#include<cstring>
#include<algorithm>
#define cdebug() freopen("C:\\Users\\netmaster.ASUS\\Desktop\\123.txt","r",stdin)
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rev(i,a,b) for(int i=(a);i>=(b);i--)
#define clr(a,x) memset(a,x,sizeof a)
#define inf 0x3f3f3f3f
typedef long long LL;
using namespace std;
 
const int mod=1e9 +7;
const int maxn=2005;
const int maxm=4005;
 
int done[8][8][8][8][8][8][8];
struct node
{
    int d[8],w,dir;
    node()
    {
 
    }
    node(int dd[],int di,int ww)
    {
        rep(i,0,8)
        d[i]=dd[i];
        dir=di;
        w=ww;
    }
};
inline int& gbool(int dd[])
{
    return done[dd[0]][dd[1]][dd[2]][dd[3]][dd[4]][dd[5]][dd[6]];
}
int dx[][3]={1,4,-1,0,2,5,1,3,6,2,7,-1,0,5,-1,1,4,6,2,5,7,3,6,-1};
void bfs()
{
    int dd[8];
    queue<node>q;
    clr(done,0);
    rep(i,0,8)
    dd[i]=i;
    q.push(node(dd,0,0));
    gbool(dd)=1;
    while(!q.empty())
    {
        node x=q.front();q.pop();
        rep(i,0,3)
        if(dx[x.dir][i]!=-1)
        {
            node cur=x;
            swap(cur.d[x.dir],cur.d[dx[x.dir][i]]);
            cur.dir=dx[x.dir][i];
            cur.w++;
            if(!gbool(cur.d))
            {
                gbool(cur.d)=x.w+1;
                q.push(cur);
            }
        }
    }
}
int da[8];
int main()
{bfs();
    while(~scanf("%d",&da[0]))
    {
        int sum=0;
        rep(i,1,8)
        scanf("%d",&da[i]),sum+=abs(i-da[i]);
 
        if(!sum)
        {
            puts("0");
            continue;
        }
        printf("%d\n",gbool(da));
    }
    return 0;
}

Compile Error Logs:
You are not authorized to see the message.

Status
Judge: 1/1	C++	CPU: 00.00 sec	Memory: 9500 KB	Length: 1682 B	2015-03-22 19:41	2015-03-22 19:41
Results for testcases
Case #	Verdict	CPU Time	Memory	In	Out	Case Name
Case #1:	: Accepted	00.00 sec	9500 KB			

< prev |	1	/	1	| next >	 		 : Accepted        00.00 sec        9500 KB
 
Judge Input #1 ( in1.txt | 16 B)		Judge Output #1 ( out1.txt | 16 B)
In preparation.
In preparation.
Comments
 
 Under Construction.
 
Categories
 
 
Free Tags
 
 

Compiler output:
a.cc:95:6: error: stray '#' in program
   95 | Case #  Verdict CPU Time        Memory  In      Out     Case Name
      |      ^
a.cc:96:6: error: stray '#' in program
   96 | Case #1:        : Accepted      00.00 sec       9500 KB
      |      ^
a.cc:100:13: error: stray '#' in program
  100 | Judge Input #1 ( in1.txt | 16 B)                Judge Output #1 ( out1.txt | 16 B)
      |             ^
a.cc:100:62: error: stray '#' in program
  100 | Judge Input #1 ( in1.txt | 16 B)                Judge Output #1 ( out1.txt | 16 B)
      |                                                              ^
a.cc:89:1: error: 'Compile' does not name a type
   89 | Compile Error Logs:
      | ^~~~~~~
Language: C++

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

char str[8];
char fin[8]={0,1,2,3,4,5,6,7};
int dir[4]={-1,1,-4,4};

struct stat{
    char temp[8];
    int num;
    stat(char* tt, int nn){
        for(int i=0; i<8; i++) temp[i]==tt[i];
        num =nn;
    }
}
bool equal(char* p1, char* p2){
    for(int i=0; i<8; i++){
            if(p1[i]!=p2[i]) return false;
    }
    return true;
}

int bfs(char* s){
    queue<stat> q;
    q.push(stat(s, 0));
    
    while(q.size()){
        stat cur=q.front(); q.pop();
        if(equal(cur.temp,fin)) return cur.step;
        int zx;
        for(int i=0; i<8; i++){ if(cur.temp[i]=='0') {zx=i; break;}}
        for(int i=0; i<4; i++){
            int nx = zx+dir[i];
            if(nx>=0&& nx<8){
                char t[8];
                strcpy(t, cur.temp);
                char a=t[zx]; t[zx]=t[nx]; t[nx]=a;
                q.push(stat(t, cur.step+1));
            }
        }
    }
}

int main(){
    while(cin>>str){
        cout<<bfs(str)<<endl;
    }   
}


Compiler output:
a.cc:17:2: error: expected ';' after struct definition
   17 | }
      |  ^
      |  ;
a.cc: In function 'int bfs(char*)':
a.cc:31:44: error: 'struct stat' has no member named 'step'
   31 |         if(equal(cur.temp,fin)) return cur.step;
      |                                            ^~~~
a.cc:38:17: error: 'strcpy' was not declared in this scope
   38 |                 strcpy(t, cur.temp);
      |                 ^~~~~~
a.cc:4:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <queue>
  +++ |+#include <cstring>
    4 | using namespace std;
a.cc:40:36: error: 'struct stat' has no member named 'step'
   40 |                 q.push(stat(t, cur.step+1));
      |                                    ^~~~
Language: C++

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

char str[8];
char fin[8] = { 0, 1, 2, 3, 4, 5, 6, 7 };
int dir[4] = { -1, 1, -4, 4 };

struct point{
	char temp[8];
	int num;
	point(char* tt, int nn){
		strcpy(temp, tt);
		num = nn;
	}
};

bool equal(char* p1, char* p2){
	for (int i = 0; i<8; i++){
		if (p1[i] != p2[i]) return false;
	}
	return true;
}

int bfs(char* s){
	queue<point> q;
	q.push(point(s, 0));

	while (q.size()){
		point cur = q.front(); q.pop();
		if (equal(cur.temp, fin)) return cur.num;
		int zx;
		for (int i = 0; i<8; i++){ if (cur.temp[i] == '0') { zx = i; break; } }
		for (int i = 0; i<4; i++){
			int nx = zx + dir[i];
			if (nx >= 0 && nx<8){
				char t[8];
				strcpy(t, cur.temp);
				char a = t[zx]; t[zx] = t[nx]; t[nx] = a;
				q.push(point(t, cur.num + 1));
			}
		}
	}
}

int main(){
	while (cin >> str){
		cout << bfs(str) << endl;
	}
}


Compiler output:
a.cc: In constructor 'point::point(char*, int)':
a.cc:14:17: error: 'strcpy' was not declared in this scope
   14 |                 strcpy(temp, tt);
      |                 ^~~~~~
a.cc:4:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <queue>
  +++ |+#include <cstring>
    4 | using namespace std;
a.cc: In function 'int bfs(char*)':
a.cc:39:33: error: 'strcpy' was not declared in this scope
   39 |                                 strcpy(t, cur.temp);
      |                                 ^~~~~~
a.cc:39:33: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:45:1: warning: control reaches end of non-void function [-Wreturn-type]
   45 | }
      | ^
Language: C++

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

using namespace std;

map<string, int> dp;
int dx[4]={-1, 1, 4, -4};

void bfs(){
    string now="01234567";
    dp[now]=0;
    queue<string> q;
    q.push(now);
    while(q.size()){
        now=q.front(); q.pop();
        int z;
        for(int i=0; i<8; i++)
            if(now[i]=='0') z=i;
        for(int i=0; i<4; i++){
            int n=z+dx[i];
            if(n>=0&& n<8 &&(!(z==3&&i==1))&&(!(z==4&&i==0))){
                string next=now;
                swap(next[n], next[z]);
                if(dp.find(next)==dp.end()){
                    dp[next]=dp[now]+1;
                    q.push(next);
                }
            }
        }
    }
}
int main(){
    bfs();
    string line;
    while(getline(cin, line)){
        line.erase(remove(line.begin(), line.end(), " "), line.end());
        cout<<dp[line]<<endl;
    }
}


Compiler output:
In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
                 from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Iter_equals_val<_Value>::operator()(_Iterator) [with _Iterator = __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >; _Value = const char [2]]':
/usr/include/c++/14/bits/stl_algobase.h:2180:13:   required from '_ForwardIterator std::__remove_if(_ForwardIterator, _ForwardIterator, _Predicate) [with _ForwardIterator = __gnu_cxx::__normal_iterator<char*, __cxx11::basic_string<char> >; _Predicate = __gnu_cxx::__ops::_Iter_equals_val<const char [2]>]'
 2180 |         if (!__pred(__first))
      |              ~~~~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:798:30:   required from '_FIter std::remove(_FIter, _FIter, const _Tp&) [with _FIter = __gnu_cxx::__normal_iterator<char*, __cxx11::basic_string<char> >; _Tp = char [2]]'
  798 |       return std::__remove_if(__first, __last,
      |              ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
  799 |                 __gnu_cxx::__ops::__iter_equals_val(__value));
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:39:26:   required from here
   39 |         line.erase(remove(line.begin(), line.end(), " "), line.end());
      |                    ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/predefined_ops.h:270:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
  270 |         { return *__it == _M_value; }
      |                  ~~~~~~^~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0); cin.tie(0);
using namespace std;
int main(){_
    map<string,int> vis;
    map<string,int> step;
    queue<string> qu;
    vis["01234567"] = 1;
    step["01234567"] = 0;
    qu.push("01234567");
    while(!qu.empty()){
        string now = qu.front();
        qu.pop();
        int poi;
        for(int i = 0; i < 8; i++)
            if(now[i] == '0'){
                poi = i;
                break;
            }
        if(poi >= 0 && poi <= 3){ //down
            string next = now;
            int pl = next[poi];
            next[poi] = next[poi + 4];
            next[poi + 4] = pl;
            if(!vis[next]){
                qu.push(next);
                step[next] = step[now] + 1;
                vis[next] = 1;
            }
        }
        if(poi >= 4 && poi <= 7){ //up
            string next = now;
            int pl = next[poi];
            next[poi] = next[poi - 4];
            next[poi - 4] = pl;
            if(!vis[next]){
                qu.push(next);
                step[next] = step[now] + 1;
                vis[next] = 1;
            }
        }
        if(poi % 4 != 0){ //left
            string next = now;
            int pl = next[poi];
            next[poi] = next[poi - 1];
            next[poi - 1] = pl;
            if(!vis[next]){
                qu.push(next);
                step[next] = step[now] + 1;
                vis[next] = 1;
            }
        }
        if(poi % 4 != 3){ //right
            string next = now;
            int pl = next[poi];
            next[poi] = next[poi + 1];
            next[poi + 1] = pl;
            if(!vis[next]){
                qu.push(next);
                step[next] = step[now] + 1;
                vis[next] = 1;
            }
        }
    }
    //
    char ch[20];
    while(gets(ch)){
        for(int i = 0; i <15; i++)
            ch[i] = ch[i*2];
        ch[8] = '\0';
        string str = ch;
        printf("%d\n",step[str]);
    }


    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:67:11: error: 'gets' was not declared in this scope; did you mean 'getw'?
   67 |     while(gets(ch)){
      |           ^~~~
      |           getw
Language: C++

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

map<string, int> res;
int d[4] = {1, -1, 4, -4};

void bfs() {
  queue<string> que;
  que.push("01234567");
  res["01234567"] = 0;
  while (!que.empty()) {
    string s = que.front();
    que.pop();
    int pos = 0;
    while (s[pos] != '0') pos++;
    for (int i = 0; i < 4; i++) {
      int npos = pos + d[i];
      if (0 <= npos && npos < 8 && !(npos == 3 && i == 0) &&
          !(npos == 4 && i == 1)) {
        string ns = s;
        swap(ns[pos], ns[npos]);
        if (res.find(ns) == res.end()) {
          res[ns] = res[s] + 1;
          que.push(ns);
        }
      }
    }
  }
}
int main() {
  bfs();
  string line;
  while (getline(cin, line)) {
    line.erase(remove(line.begin(), line.end(), ' '),
               line.end());  // remove white spaces
    cout << res[line] << endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:33: error: cannot convert 'std::__cxx11::basic_string<char>::iterator' to 'const char*'
   37 |     line.erase(remove(line.begin(), line.end(), ' '),
      |                       ~~~~~~~~~~^~
      |                                 |
      |                                 std::__cxx11::basic_string<char>::iterator
In file included from /usr/include/c++/14/cstdio:42,
                 from /usr/include/c++/14/ext/string_conversions.h:45,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdio.h:158:32: note:   initializing argument 1 of 'int remove(const char*)'
  158 | extern int remove (const char *__filename) __THROW;
      |                    ~~~~~~~~~~~~^~~~~~~~~~
Language: C++

#include<stdio.h>
#include<queue>
#include<bitset>
using namespace std;

const int N = 8;
const int SHIFT_BITS = 3;

unsigned Swap3Bits(unsigned x, int b1, int b2)
{
	unsigned a,b,s;
	b1 *= SHIFT_BITS;
	b2 *= SHIFT_BITS;
	a = (x& (07<<b1));
	b = (x& (07<<b2));
	s = (a>>b1<<b2) | (b>>b2<<b1);
	return (x&~a&~b)|s;
}

int Ans(int initField)
{
	int ans, i;
	unsigned field;
	set<unsigned> his;
	static bitset<16777216> bitHis;
	queue<unsigned> q;
	unsigned int NEXT_COUNT = 0xffffffff;

	ans = 0;
	bitHis.reset();
	q.push(initField);
	q.push(NEXT_COUNT);
	for(;;)
	{
		field = q.front();
		q.pop();
		if(field == NEXT_COUNT)
		{
			++ans;
			q.push(NEXT_COUNT);
			continue;
		}
		if(bitHis[field])
			continue;
		if(field == 001234567)
			break;
		bitHis[field] = true;

		int zi = 0;
		for(i = 0; i < N; ++i)
		{
			if( (field & (07<<i*SHIFT_BITS)) == 00)
			{
				zi = i;
				break;
			}
		}
		
		q.push( Swap3Bits(field, zi, (zi<4?zi+4:zi-4)) );
		if((zi&0x3) != 0x3)
			q.push( Swap3Bits(field, zi, zi+1) );
		if((zi&0x3) != 0x0)
			q.push( Swap3Bits(field, zi,zi-1) );
	}
	return ans;
}

int main(void)
{
	int a[N], i;

	for(;;)
	{
		unsigned field = 0;
		for(i = 0; i < N; ++i)
		{
			if(scanf("%d",&a[i])!=1) return 0;
			field |= (a[i] << ( (N-i-1)*SHIFT_BITS) );
		}
		printf("%d\n",Ans(field));
	}
	return 1;
}

Compiler output:
a.cc: In function 'int Ans(int)':
a.cc:24:9: error: 'set' was not declared in this scope
   24 |         set<unsigned> his;
      |         ^~~
a.cc:4:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>'
    3 | #include<bitset>
  +++ |+#include <set>
    4 | using namespace std;
a.cc:24:13: error: expected primary-expression before 'unsigned'
   24 |         set<unsigned> his;
      |             ^~~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <queue>
#include <map>
#define FOR(a,start,end) for(I64 a=(start);a<(end);a++)
using namespace std;
int main(){
	int vec[4] = {-1, 1, 4, -4};
	queue<string> que;
	que.push("01234567");
	map<string, int> d;
	d["01234567"] = 0;
	while(!que.empty()){
		string str = que.front();
		que.pop();
		int zero = str.find('0');
		FOR(i, 0, 4){
			int next_z;
			next_z = zero + vec[i];
			if(next_z >= 0 && next_z <= 7){
				string str2 = str;
				swap(str2[zero], str2[next_z]);
				if(d.find(str2) == d.end()){
					que.push(str2);
					d[str2] = d[str] + 1;
				}
			}
		}
	}
	string num;
	while(getline(cin, num)){
		string::iterator end_it = remove(num.begin(), num.end(), ' ');
		num.erase(end_it, num.end());
		cout << d[num] << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:30: error: 'I64' was not declared in this scope
    5 | #define FOR(a,start,end) for(I64 a=(start);a<(end);a++)
      |                              ^~~
a.cc:17:17: note: in expansion of macro 'FOR'
   17 |                 FOR(i, 0, 4){
      |                 ^~~
a.cc:17:21: error: 'i' was not declared in this scope
   17 |                 FOR(i, 0, 4){
      |                     ^
a.cc:5:44: note: in definition of macro 'FOR'
    5 | #define FOR(a,start,end) for(I64 a=(start);a<(end);a++)
      |                                            ^
a.cc:32:59: error: cannot convert 'std::__cxx11::basic_string<char>::iterator' to 'const char*'
   32 |                 string::iterator end_it = remove(num.begin(), num.end(), ' ');
      |                                                  ~~~~~~~~~^~
      |                                                           |
      |                                                           std::__cxx11::basic_string<char>::iterator
In file included from /usr/include/c++/14/cstdio:42,
                 from /usr/include/c++/14/ext/string_conversions.h:45,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdio.h:158:32: note:   initializing argument 1 of 'int remove(const char*)'
  158 | extern int remove (const char *__filename) __THROW;
      |                    ~~~~~~~~~~~~^~~~~~~~~~
Language: C++

#include <iostream>
#include <cmath>
#include <string>
#include <queue>
#include <set>
#include <map>
#define I64 long long int
#define FOR(a,start,end) for(I64 a=(start);a<(end);a++)
using namespace std;

int main(){
	int vec[4] = {-1, 1, 4, -4};
	queue<string> que;
	que.push("01234567");
	map<string, int> d;
	d["01234567"] = 0;
	while(!que.empty()){
		string str = que.front();
		que.pop();
		int zero = str.find('0');
		FOR(i, 0, 4){
			int next_z;
			next_z = zero + vec[i];
			if(next_z >= 0 && next_z <= 7){
				string str2 = str;
				swap(str2[zero], str2[next_z]);
				if(d.find(str2) == d.end()){
					que.push(str2);
					d[str2] = d[str] + 1;
				}
			}
		}
	}
	string num;
	while(getline(cin, num)){
		string::iterator end_it = remove(num.begin(), num.end(), ' ');
		num.erase(end_it, num.end());
		cout << d[num] << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:59: error: cannot convert 'std::__cxx11::basic_string<char>::iterator' to 'const char*'
   36 |                 string::iterator end_it = remove(num.begin(), num.end(), ' ');
      |                                                  ~~~~~~~~~^~
      |                                                           |
      |                                                           std::__cxx11::basic_string<char>::iterator
In file included from /usr/include/c++/14/cstdio:42,
                 from /usr/include/c++/14/ext/string_conversions.h:45,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdio.h:158:32: note:   initializing argument 1 of 'int remove(const char*)'
  158 | extern int remove (const char *__filename) __THROW;
      |                    ~~~~~~~~~~~~^~~~~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <queue>
#include <map>
#define INF 10000000
#define I64 long long int
#define FOR(a,start,end) for(I64 a=(start);a<(end);a++)
using namespace std;

typedef pair<string, int> P;

int main(){
	//4ûüpzñ
	int vec[] = {1, -1, 4, -4};
	queue<string> que;
	que.push("01234567");

	//TõÏÝe[u
	map<string, int> d;

	//"01234567"©çtü«ÉDæTõµÈªçTõÏÝe[uðßé
	while(!que.empty()){
		string str = que.front();
		que.pop();
		int zero = str.find("0");

		string str2;
		FOR(i, 0, 4){
			int next_z;
			next_z = zero + vec[i];
			if(next_z >= 0 && next_z <= 7 && !((zero == 3 && next_4) || (zero == 4 && next_z == 3))){
				str2 = str;
				swap(str2[zero], str2[next_z]);
				if(d.find(str2) == d.end()){
					que.push(str2);
					d[str2] = d[str] + 1;
				}
			}
		}
	}

	//üÍ©ç' 'ð¢ÄTõÏÝe[u©ç¦ðoÍ
	string num;
	while(getline(cin, num)){
		string::iterator end_it = remove(num.begin(), num.end(), ' ');
		num.erase(end_it, num.end());
		cout << d[num] << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:74: error: 'next_4' was not declared in this scope; did you mean 'next_z'?
   32 |                         if(next_z >= 0 && next_z <= 7 && !((zero == 3 && next_4) || (zero == 4 && next_z == 3))){
      |                                                                          ^~~~~~
      |                                                                          next_z
Language: C++


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

#define SIZE 8

int coefficients[SIZE] = {10000000, 1000000, 100000, 10000, 1000, 100, 10, 1};

int movablePairs[SIZE][4] = {
    {1,4,-1,-1}, {0,2,5,-1}, {1,3,6,-1}, {2,7,-1,-1},
    {0,5,-1,-1}, {1,4,6,-1}, {2,5,7,-1}, {3,6,-1,-1}
};

int answerStateCode = 1234567;

class Puzzle
{
public:
    int state[SIZE];
    int depth;
    int movablePiecePoint;
    int stateCode;
    Puzzle(int state0[SIZE], int depth0)
    {
        memcpy(state, state0, sizeof(int)*SIZE);
        depth = depth0;
        stateCode = 0;
        for (int i=0; i<SIZE; i++) {
            if(state0[i] == 0){
                movablePiecePoint = i;
            }
            stateCode += coefficients[i]*state0[i];
        }
    }
};

void move(int state[], int nextState[], int point1, int point2)
{
    memcpy(nextState, state, sizeof(int)*SIZE);
    int tmp = nextState[point1];
    nextState[point1] = nextState[point2];
    nextState[point2] = tmp;
    return;
}

bool isVisit[76543211];

int solve(int input[])
{
    queue<Puzzle> qu;
    for (int i=0; i<76543211; i++) {
        isVisit[i] = false;
    }
    
    Puzzle init = Puzzle(input, 0);
    qu.push(init);
    while (!qu.empty()) {
        Puzzle now = qu.front();
        qu.pop();
        if (answerStateCode == now.stateCode) {
            return now.depth;
        }
        
        if (!isVisit[now.stateCode]) {
            for (int i=0; movablePairs[now.movablePiecePoint][i]>=0 and i<3; i++){
                int nextMove = movablePairs[now.movablePiecePoint][i];
                int nextState[SIZE];
                move(now.state, nextState, now.movablePiecePoint, nextMove);
                Puzzle nextP = Puzzle(nextState, now.depth+1);
                qu.push(nextP);
            }
            isVisit[now.stateCode] = true;
        }
    }
    return -1;
}

int get()
{
    int input[SIZE];
    for(int i=0; i<SIZE; i++){
        cin >> input[i];
    }
     
    return solve(input);
}


int main(int argc, const char * argv[])
{
    while (true) {
        cout << get() << endl;
    }
    
    return 0;
}

Compiler output:
a.cc: In constructor 'Puzzle::Puzzle(int*, int)':
a.cc:26:9: error: 'memcpy' was not declared in this scope
   26 |         memcpy(state, state0, sizeof(int)*SIZE);
      |         ^~~~~~
a.cc:4:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <queue>
  +++ |+#include <cstring>
    4 | using namespace std;
a.cc: In function 'void move(int*, int*, int, int)':
a.cc:40:5: error: 'memcpy' was not declared in this scope
   40 |     memcpy(nextState, state, sizeof(int)*SIZE);
      |     ^~~~~~
a.cc:40:5: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include<stdio.h>
#include<utility>
#include<string.h>
#include<queue>
using namespace std;
int d[1<<27]={0};
int main()
{
	typedef struct p{int n;char s[9];}p;
	queue<p> Q;
	int m[4]={1,4,-4,-1};
	char s[9]={48,49,50,51,52,53,54,55,0},c[18];
	memset(d,1,sizeof(d));
	d[1234567]=0;
	p T;
	T.n=-1;
	strcpy(T.s,s);
	Q.push(T);

	while(!Q.empty())
	{
		T=Q.front();
		Q.pop();
		int i,j,k;
		char w[9];
		strcpy(w,T.s);
		if(T.n<30)
		{
			for(i=0;i<8;i++)
				if(T.s[i]=='0')
					break;
			if(i==3)
				j=1,k=4;
			else if(i==4)
				j=0,k=3;
			else
				j=0,k=4;
			for(;j<k;j++)
				if(i+m[j]>=0&&i+m[j]<8)
				{
					char t=T.s[i+m[j]];
					T.s[i+m[j]]=T.s[i];
					T.s[i]=t;
					if(d[atoi(T.s)]>d[atoi(w)]+1)
					{
						d[atoi(T.s)]=T.n=d[atoi(w)]+1;
						Q.push(T);
					}
					strcpy(T.s,w);
				}
		}
	}
	while((c[0]=getchar())!=-1)
	{
		for(int i=1;i<16;i++)
			c[i]=getchar();
		for(int i=0,j=0;i<8;i++,j+=2)
			s[i]=c[j];
		printf("%d\n",d[atoi(s)]);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:46: error: 'atoi' was not declared in this scope
   44 |                                         if(d[atoi(T.s)]>d[atoi(w)]+1)
      |                                              ^~~~
a.cc:59:33: error: 'atoi' was not declared in this scope
   59 |                 printf("%d\n",d[atoi(s)]);
      |                                 ^~~~