Language: C++

#include<iostream>
#include<map>
#include<deque>
#include<cstdlib>
using namespace std;struct B{int z[2];char s[14];bool operator<(const B&r)const{return strcmp(s,r.s)<0;}};int main(){int a[13][5]={{2,-1},{2,5,-1},{0,1,3,6,-1},{2,7,-1},{5,-1},{1,4,6,9,-1},{2,5,7,10,-1},{3,6,8,11,-1},{7,-1},{5,10,-1},{6,9,11,12,-1},{7,10,-1},{10,-1},},gx[]={2,1,2,3,0,1,2,3,4,1,2,3,2},gy[]={0,1,1,1,2,2,2,2,2,3,3,3,4},v,d,s,i,j;B g={0,0,"0123456789:;0"};for(;;){map<B,int>m;deque<B>q;B b={-1,-1};for(i=0;i<13;i++){cin>>v;if(v==-1)return 0;b.s[i]='0'+v;if(!v)b.z[b.z[0]!=-1]=i;}b.s[13]=0;m[b]=1;for(q.push_back(b);!q.empty();q.pop_front()){B&b=q.front();if(!strcmp(b.s,g.s))break;d=0;for(i=13;i--;){v=b.s[i]-'0';if(v)d+=abs(gx[v]-gx[i])+abs(gy[v]-gy[i]);}s=m[b];if(s+d<22)for(j=2;j--;)for(i=0;~a[b.z[j]][i];i++){B n=b;n.z[j]=a[b.z[j]][i];if(n.z[j]-n.z[1-j]){swap(n.s[b.z[j]],n.s[n.z[j]]);int&t=m[n];if(!t){t=s+1;q.push_back(n);}}}}m[g]?cout<<m[g]-1<<endl:cout<<"NA\n";}}

Compiler output:
a.cc: In member function 'bool B::operator<(const B&) const':
a.cc:5:88: error: 'strcmp' was not declared in this scope
    5 | using namespace std;struct B{int z[2];char s[14];bool operator<(const B&r)const{return strcmp(s,r.s)<0;}};int main(){int a[13][5]={{2,-1},{2,5,-1},{0,1,3,6,-1},{2,7,-1},{5,-1},{1,4,6,9,-1},{2,5,7,10,-1},{3,6,8,11,-1},{7,-1},{5,10,-1},{6,9,11,12,-1},{7,10,-1},{10,-1},},gx[]={2,1,2,3,0,1,2,3,4,1,2,3,2},gy[]={0,1,1,1,2,2,2,2,2,3,3,3,4},v,d,s,i,j;B g={0,0,"0123456789:;0"};for(;;){map<B,int>m;deque<B>q;B b={-1,-1};for(i=0;i<13;i++){cin>>v;if(v==-1)return 0;b.s[i]='0'+v;if(!v)b.z[b.z[0]!=-1]=i;}b.s[13]=0;m[b]=1;for(q.push_back(b);!q.empty();q.pop_front()){B&b=q.front();if(!strcmp(b.s,g.s))break;d=0;for(i=13;i--;){v=b.s[i]-'0';if(v)d+=abs(gx[v]-gx[i])+abs(gy[v]-gy[i]);}s=m[b];if(s+d<22)for(j=2;j--;)for(i=0;~a[b.z[j]][i];i++){B n=b;n.z[j]=a[b.z[j]][i];if(n.z[j]-n.z[1-j]){swap(n.s[b.z[j]],n.s[n.z[j]]);int&t=m[n];if(!t){t=s+1;q.push_back(n);}}}}m[g]?cout<<m[g]-1<<endl:cout<<"NA\n";}}
      |                                                                                        ^~~~~~
a.cc:5:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include<cstdlib>
  +++ |+#include <cstring>
    5 | using namespace std;struct B{int z[2];char s[14];bool operator<(const B&r)const{return strcmp(s,r.s)<0;}};int main(){int a[13][5]={{2,-1},{2,5,-1},{0,1,3,6,-1},{2,7,-1},{5,-1},{1,4,6,9,-1},{2,5,7,10,-1},{3,6,8,11,-1},{7,-1},{5,10,-1},{6,9,11,12,-1},{7,10,-1},{10,-1},},gx[]={2,1,2,3,0,1,2,3,4,1,2,3,2},gy[]={0,1,1,1,2,2,2,2,2,3,3,3,4},v,d,s,i,j;B g={0,0,"0123456789:;0"};for(;;){map<B,int>m;deque<B>q;B b={-1,-1};for(i=0;i<13;i++){cin>>v;if(v==-1)return 0;b.s[i]='0'+v;if(!v)b.z[b.z[0]!=-1]=i;}b.s[13]=0;m[b]=1;for(q.push_back(b);!q.empty();q.pop_front()){B&b=q.front();if(!strcmp(b.s,g.s))break;d=0;for(i=13;i--;){v=b.s[i]-'0';if(v)d+=abs(gx[v]-gx[i])+abs(gy[v]-gy[i]);}s=m[b];if(s+d<22)for(j=2;j--;)for(i=0;~a[b.z[j]][i];i++){B n=b;n.z[j]=a[b.z[j]][i];if(n.z[j]-n.z[1-j]){swap(n.s[b.z[j]],n.s[n.z[j]]);int&t=m[n];if(!t){t=s+1;q.push_back(n);}}}}m[g]?cout<<m[g]-1<<endl:cout<<"NA\n";}}
a.cc: In function 'int main()':
a.cc:5:575: error: 'strcmp' was not declared in this scope
    5 | using namespace std;struct B{int z[2];char s[14];bool operator<(const B&r)const{return strcmp(s,r.s)<0;}};int main(){int a[13][5]={{2,-1},{2,5,-1},{0,1,3,6,-1},{2,7,-1},{5,-1},{1,4,6,9,-1},{2,5,7,10,-1},{3,6,8,11,-1},{7,-1},{5,10,-1},{6,9,11,12,-1},{7,10,-1},{10,-1},},gx[]={2,1,2,3,0,1,2,3,4,1,2,3,2},gy[]={0,1,1,1,2,2,2,2,2,3,3,3,4},v,d,s,i,j;B g={0,0,"0123456789:;0"};for(;;){map<B,int>m;deque<B>q;B b={-1,-1};for(i=0;i<13;i++){cin>>v;if(v==-1)return 0;b.s[i]='0'+v;if(!v)b.z[b.z[0]!=-1]=i;}b.s[13]=0;m[b]=1;for(q.push_back(b);!q.empty();q.pop_front()){B&b=q.front();if(!strcmp(b.s,g.s))break;d=0;for(i=13;i--;){v=b.s[i]-'0';if(v)d+=abs(gx[v]-gx[i])+abs(gy[v]-gy[i]);}s=m[b];if(s+d<22)for(j=2;j--;)for(i=0;~a[b.z[j]][i];i++){B n=b;n.z[j]=a[b.z[j]][i];if(n.z[j]-n.z[1-j]){swap(n.s[b.z[j]],n.s[n.z[j]]);int&t=m[n];if(!t){t=s+1;q.push_back(n);}}}}m[g]?cout<<m[g]-1<<endl:cout<<"NA\n";}}
      |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               ^~~~~~
a.cc:5:575: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'