Language: C++

#include<iostream>
#include<map>
#include<string>
#include<vector>
#include<algorithm>
#include<numeric>
#include<cmath>
#include<queue>
using namespace std;
int inf = 1000000000;

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

vector<int> trans(vector< vector<int> > a){
  vector<int> t(16);
  for(int i=0; i<4; i++) for(int j=0; j<4; j++) t[i*4+j] = a[i][j];
  return t;
}
bool check(vector<int> a){
  for(int i=0; i<16; i++){
    if( a[i] != (i+1)%16 ) return false;
  }
  return true;
}

void bfs(vector<int> sss){
  queue< pair<int, vector<int> > > q;
  q.push(make_pair(0, sss));
  map< bool, int> mpb;
  while( !q.empty() ){
    pair<int, vector<int> > p = q.front();
    q.pop();

    vector<int> s = p.second;
    mpb[s] = true;
    // cerr << p.first << " " << p.second << endl;
    if( check(s) ){
      cout << p.first << endl;
      return;
    }

    for(int i=0; i<16; i++){
      if( s[i] == 0 ){
        int y = i / 4;
        int x = i % 4;
        for(int d=0; d<4; d++){
          int nx = x + dx[d]; int ny = y + dy[d];
          if( nx < 0 || ny < 0 || nx >= 4 || ny >= 4 ) continue;
          vector<int> t = s;
          swap(t[i], t[ny*4 + nx]);
          if( !mpb[t] ) q.push( make_pair(p.first + 1, t) );
        }
      }
    }

  }
}

int main(){

  vector< vector<int> > a(4, vector<int>(4));
  for(int i=0; i<4; i++) for(int j=0; j<4; j++) cin >> a[i][j];

  bfs(trans(a));

  return 0;
}

Compiler output:
a.cc: In function 'void bfs(std::vector<int>)':
a.cc:36:8: error: no match for 'operator[]' (operand types are 'std::map<bool, int>' and 'std::vector<int>')
   36 |     mpb[s] = true;
      |        ^
In file included from /usr/include/c++/14/map:63,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = bool; _Tp = int; _Compare = std::less<bool>; _Alloc = std::allocator<std::pair<const bool, int> >; mapped_type = int; key_type = bool]'
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:34: note:   no known conversion for argument 1 from 'std::vector<int>' to 'const std::map<bool, int>::key_type&' {aka 'const bool&'}
  504 |       operator[](const key_type& __k)
      |                  ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = bool; _Tp = int; _Compare = std::less<bool>; _Alloc = std::allocator<std::pair<const bool, int> >; mapped_type = int; key_type = bool]'
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:29: note:   no known conversion for argument 1 from 'std::vector<int>' to 'std::map<bool, int>::key_type&&' {aka 'bool&&'}
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~
a.cc:52:19: error: no match for 'operator[]' (operand types are 'std::map<bool, int>' and 'std::vector<int>')
   52 |           if( !mpb[t] ) q.push( make_pair(p.first + 1, t) );
      |                   ^
/usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = bool; _Tp = int; _Compare = std::less<bool>; _Alloc = std::allocator<std::pair<const bool, int> >; mapped_type = int; key_type = bool]'
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:34: note:   no known conversion for argument 1 from 'std::vector<int>' to 'const std::map<bool, int>::key_type&' {aka 'const bool&'}
  504 |       operator[](const key_type& __k)
      |                  ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = bool; _Tp = int; _Compare = std::less<bool>; _Alloc = std::allocator<std::pair<const bool, int> >; mapped_type = int; key_type = bool]'
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:29: note:   no known conversion for argument 1 from 'std::vector<int>' to 'std::map<bool, int>::key_type&&' {aka 'bool&&'}
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~