Language: C++

#include<bits/stdc++.h> 
using namespace std; 
typedef long long int ll;
vector<ll> permutation;
void search() 
{
if(permutation.size() == n) 
  {
   return ;
     } 
else{
for (int i = 1; i <= n; i++)
{ 
  if (chosen[i]) continue; 
  chosen[i] = true; 
  permutation.push_back(i); 
  search();
chosen[i] = false;
permutation.pop_back(); 
                              
  }
}
}
ll config(ll n){
  if(n>=1000)
    return -1;
  search(n);
  return permutation.size();
}
  
int main()
{
  ll t;
  cin>>t;
  while(t--){
    ll n;
    cin>>n;
  ll ans =config(n);
  cout<<ll<<"\n";
    
  }
  
  return 0;
  
}




Compiler output:
a.cc: In function 'void search()':
a.cc:7:26: error: 'n' was not declared in this scope; did you mean 'yn'?
    7 | if(permutation.size() == n)
      |                          ^
      |                          yn
a.cc:14:7: error: 'chosen' was not declared in this scope; did you mean 'close'?
   14 |   if (chosen[i]) continue;
      |       ^~~~~~
      |       close
a.cc:15:3: error: 'chosen' was not declared in this scope; did you mean 'close'?
   15 |   chosen[i] = true;
      |   ^~~~~~
      |   close
a.cc: In function 'll config(ll)':
a.cc:27:9: error: no matching function for call to 'search(ll&)'
   27 |   search(n);
      |   ~~~~~~^~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:2332:5: note: candidate: 'template<class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> _ForwardIterator1 std::search(_ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2, _BinaryPredicate)'
 2332 |     search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
      |     ^~~~~~
/usr/include/c++/14/bits/stl_algobase.h:2332:5: note:   candidate expects 5 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:4090:5: note: candidate: 'template<class _FIter1, class _FIter2> _FIter1 std::search(_FIter1, _FIter1, _FIter2, _FIter2)'
 4090 |     search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
      |     ^~~~~~
/usr/include/c++/14/bits/stl_algo.h:4090:5: note:   candidate expects 4 arguments, 1 provided
/usr/include/c++/14/bits/stl_algo.h:4184:5: note: candidate: 'template<class _ForwardIterator, class _Searcher> _ForwardIterator std::search(_ForwardIterator, _ForwardIterator, const _Searcher&)'
 4184 |     search(_ForwardIterator __first, _ForwardIterator __last,
      |     ^~~~~~
/usr/include/c++/14/bits/stl_algo.h:4184:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:112:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator> std::search(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2, _BinaryPredicate)'
  112 | search(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __s_first,
      | ^~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:112:1: note:   candidate expects 6 arguments, 1 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:117:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator> std::search(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _ForwardIterator2)'
  117 | search(_ExecutionPolicy&& __exec, _ForwardIterator1 __first, _ForwardIterator1 __last, _ForwardIterator2 __s_first,
      | ^~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:117:1: note:   candidate expects 5 arguments, 1 provided
a.cc:5:6: note: candidate: 'void search()'
    5 | void search()
      |      ^~~~~~
a.cc:5:6: note:   candidate expects 0 arguments, 1 provided
a.cc: In function 'int main()':
a.cc:39:11: error: expected primary-expression before '<<' token
   39 |   cout<<ll<<"\n";
      |           ^~