Language: C++

#include <bits/stdc++.h>

using ll = long long;
int main() {
    ll X,N;
    cin >> X >> N;
    vector<ll>A(N);
  set<ll>dis;
    
  for(ll &i:A)cin >> i;
  
  for(ll i:A){
   dis.insert(X-i);
  }
  
  bool s1=true,s2=true;
  ll sss=0;
  for(ll i=0;!dis.empty();i++){
      s1=true;
      s2=true;
    if(dis.count(i))s1=false;
    if(dis.count(-i))s2=false;
    dis.erase(i);
    dis.erase(-i);
    sss=i;
    if(s1||s2)break;
  }
  
  
    if(s2){
    cout << X-sss << endl;
    }else{
    cout << X+sss << endl;
    }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |     cin >> X >> N;
      |     ^~~
      |     std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:5: error: 'vector' was not declared in this scope
    7 |     vector<ll>A(N);
      |     ^~~~~~
a.cc:7:5: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:7:14: error: expected primary-expression before '>' token
    7 |     vector<ll>A(N);
      |              ^
a.cc:7:15: error: 'A' was not declared in this scope
    7 |     vector<ll>A(N);
      |               ^
a.cc:8:3: error: 'set' was not declared in this scope
    8 |   set<ll>dis;
      |   ^~~
a.cc:8:3: note: suggested alternatives:
In file included from /usr/include/c++/14/set:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:158:
/usr/include/c++/14/bits/stl_set.h:96:11: note:   'std::set'
   96 |     class set
      |           ^~~
/usr/include/c++/14/set:87:13: note:   'std::pmr::set'
   87 |       using set = std::set<_Key, _Cmp, polymorphic_allocator<_Key>>;
      |             ^~~
a.cc:8:9: error: expected primary-expression before '>' token
    8 |   set<ll>dis;
      |         ^
a.cc:8:10: error: 'dis' was not declared in this scope; did you mean 'div'?
    8 |   set<ll>dis;
      |          ^~~
      |          div
a.cc:31:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   31 |     cout << X-sss << endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:31:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   31 |     cout << X-sss << endl;
      |                      ^~~~
      |                      std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:33:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   33 |     cout << X+sss << endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:33:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   33 |     cout << X+sss << endl;
      |                      ^~~~
      |                      std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~