Language: C++

    #include <iostream>
    #include <vector>
    #include <algorithm>
    #include <cmath>
     
    using namespace std;
     
    int main() {
      int A,B,Q;
      cin >> A >> B >> Q;
      
      vector<int> jin(A+2);
      vector<int> tera(B+2);
      //int qu[Q];
      
      long long INF = std::pow(10, 18);
      
      jin[0] = -INF;
      jin[A+1] = INF;
        
      tera[0] = -INF;
      tera[B+1] = -INF;
      
      for (int i=1; i<A+1;i++){
        cin >> jin[i]
      }
      for (int i=1; i<B+1;i++){
        cin >> tera[i]
      }
      
      long long qu;
      int b,d;
      
      for (int i; i<Q;i++){
        //cin >> qu[i];
        cin >> qu;
        long long b = upper_bound(jin.begin(), jin.end(), qu) - jin.begin() + 1;
        long long d = upper_bound(tera.begin(), tera.end(), qu) - tera.begin() + 1;

        long long res = INF;
        vector<long long> jinv{jin[b-1],jin[b]};
        vector<long long> terav{tera[d-1],tera[d]};
        vector<long long> dv[3];

        for (auto j: jinv) {
          for (auto t: terav){
            dv[0] = std::abs(j-qu)+std::abs(t-j);
            dv[1] = std::abs(t-qu)+std::abs(j-t);
            dv[2] = res;
            res = *std::min_element(dv.begin(), dv.end());
          }
        }
        cout << res << endl;
      }
    return 0;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:25:22: error: expected ';' before '}' token
   25 |         cin >> jin[i]
      |                      ^
      |                      ;
   26 |       }
      |       ~               
a.cc:28:23: error: expected ';' before '}' token
   28 |         cin >> tera[i]
      |                       ^
      |                       ;
   29 |       }
      |       ~                
a.cc:47:48: error: no match for 'operator=' (operand types are 'std::vector<long long int>' and 'long long int')
   47 |             dv[0] = std::abs(j-qu)+std::abs(t-j);
      |                                                ^
In file included from /usr/include/c++/14/vector:72,
                 from a.cc:2:
/usr/include/c++/14/bits/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = long long int; _Alloc = std::allocator<long long int>]'
  210 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note:   no known conversion for argument 1 from 'long long int' to 'const std::vector<long long int>&'
  211 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66:
/usr/include/c++/14/bits/stl_vector.h:766:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = long long int; _Alloc = std::allocator<long long int>]'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:766:26: note:   no known conversion for argument 1 from 'long long int' to 'std::vector<long long int>&&'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:788:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = long long int; _Alloc = std::allocator<long long int>]'
  788 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:788:46: note:   no known conversion for argument 1 from 'long long int' to 'std::initializer_list<long long int>'
  788 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:48:48: error: no match for 'operator=' (operand types are 'std::vector<long long int>' and 'long long int')
   48 |             dv[1] = std::abs(t-qu)+std::abs(j-t);
      |                                                ^
/usr/include/c++/14/bits/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = long long int; _Alloc = std::allocator<long long int>]'
  210 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note:   no known conversion for argument 1 from 'long long int' to 'const std::vector<long long int>&'
  211 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:766:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = long long int; _Alloc = std::allocator<long long int>]'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:766:26: note:   no known conversion for argument 1 from 'long long int' to 'std::vector<long long int>&&'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:788:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = long long int; _Alloc = std::allocator<long long int>]'
  788 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:788:46: note:   no known conversion for argument 1 from 'long long int' to 'std::initializer_list<long long int>'
  788 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:49:21: error: no match for 'operator=' (operand types are 'std::vector<long long int>' and 'long long int')
   49 |             dv[2] = res;
      |                     ^~~
/usr/include/c++/14/bits/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = long long int; _Alloc = std::allocator<long long int>]'
  210 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note:   no known conversion for argument 1 from 'long long int' to 'const std::vector<long long int>&'
  211 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:766:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = long long int; _Alloc = std::allocator<long long int>]'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:766:26: note:   no known conversion for argument 1 from 'long long int' to 'std::vector<long long int>&&'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:788:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = long long int; _Alloc = std::allocator<long long int>]'
  788 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:788:46: note:   no known conversion for argument 1 from 'long long int' to 'std::initializer_list<long long int>'
  788 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:50:40: error: request for member 'begin' in 'dv', which is of non-class type 'std::vector<long long int> [3]'
   50 |             res = *std::min_element(dv.begin(), dv.end());
      |                                        ^~~~~
a.cc:50:52: error: request for member 'end' in 'dv', which is of non-class type 'std::vector<long long int> [3]'
   50 |             res = *std::min_element(dv.begin(), dv.end());
      |                                                    ^~~