Language: C++

#include <bits/stdc++.h>
#define FOR(i,bg,ed) for(ll i=(bg);i<(ed);i++)
#define REP(i,n) FOR(i,0,n)
#define MOD 1000000007
//#define int long long
using namespace std;
typedef long long ll;
typedef vector<vector<ll>> mat;
const int INF = 1e9;

int N, K;
int A[101010];

signed main()
{
    cin >> N >> K;
    bool odd = false, even = false;
    bool baisu = true;
    set<int> S;
    REP(i,N) {
        cin >> A[i];
        S.insert(A[i]);
    }

    sort(A, A + N);

    REP(i,N) {
        if (A[i] % 2 == 0) {
            even = true;
        } else {
            odd = true;
        }
        if (A[i] % A[0] != 0) baisu = false;
    }

    if (N == 1) {
        if (A[0] == K) {
            cout << "POSSIBLE" << endl;
        } else {
            cout << "IMPOSSIBLE" << endl;
        }
        return 0;
    }

    if (A[N-1] < K) {
        cout << "IMPOSSIBLE" << endl;
        return 0;
    }

    if (baisu) {
        if (K % A[0] == 0) {
            cout << "POSSIBLE" << endl;
        } else {
            cout << "IMPOSSIBLE" << endl;
        }
        return 0;
    }

    if (odd && !even) {
        cout << "POSSIBLE" << endl;
    } else if (odd && even) {
        //cout << "POSSIBLE" << endl;
        int minSa = 1e9 + 500;
        FOR(i,1,N) {
            minSa = min(A[i] - A[i-1]);
        }
        if (abs(A[N-1] - K) % minSa == 0) {
            cout << "POSSIBLE" << endl;
        } else {
            cout << "IMPOSSIBLE" << endl;
        }
    } else if (!odd && even) {
        if (K % 2 == 0) {
            cout << "POSSIBLE" << endl;
        } else {
            cout << "IMPOSSIBLE" << endl;
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:65:24: error: no matching function for call to 'min(int)'
   65 |             minSa = min(A[i] - A[i-1]);
      |                     ~~~^~~~~~~~~~~~~~~
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:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   template argument deduction/substitution failed:
a.cc:65:24: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   65 |             minSa = min(A[i] - A[i-1]);
      |                     ~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   candidate expects 2 arguments, 1 provided