Language: C++

#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
#include <array>
#include <vector>
#include <deque>
#include <list>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <queue>
#include <bitset>
#include <tuple>
#include <cmath>
#include <complex>
#include <algorithm>
#include <utility>
#include <regex>
#include <cstdint>
#include <numeric>
#include <functional>
#include <cassert>
#include <atcoder/convolution.hpp>
#include <atcoder/modint.hpp>
using namespace std;

namespace utils{
#define ALL(x) begin(x), end(x)
#define RALL(x) rbegin(x), rend(x)
    ///----- aliases
    using ll = long long int;
    using ull = unsigned long long;

    template<class T, class Compare> using p_queue = priority_queue<T, vector<T>, Compare>;
    template<class T> using min_queue = p_queue<T, greater<T>>;
    template<class T> using max_queue = p_queue<T, less<T>>;

    template<class T> inline bool CHMIN(T& X, const T& A){ if(X > A) {X = A; return true;} return false; }
    template<class T> inline bool CHMAX(T& X, const T& A){ if(X < A) {X = A; return true;} return false; }

    ///----- vector I/O
    template<class T>
    vector<T> VEC(size_t n, T t){
        return vector<T>(n, t);
    }

    template<class ...Ts>
    auto VEC(size_t n, Ts ... ts){
        return vector<decltype(VEC(ts...))>(n, VEC(ts...));
    }


    template<class T>
    istream& operator>>(istream& is, vector<T>& v){
        for (auto &&x : v) { is >> x; } return is;
    }

    template<class T>
    ostream& operator<<(ostream& os, const vector<T>& v){
        auto p = v.begin();
        assert(p != v.end());
        os << *p++;
        while(p != v.end()){
            os << ' ' << *p++;
        }
        return os ;
    }

    template<class T>
    ostream& operator<<(ostream& os, const vector<vector<T>>& v){
        auto p = v.begin();
        assert(p != v.end());
        os << *p++;
        while(p != v.end()){
            os << '\n' << *p++;
        }
        return os;
    }

    ///----- tuple I/O
    template <class S, class T>
    istream& operator>>(istream& is, tuple<S, T>& t){
        return is >> get<0>(t) >> get<1>(t);
    }

    template <class S, class T>
    istream& operator>>(istream& is, pair<S, T>& t){
        return is >> get<0>(t) >> get<1>(t);
    }

    template <class S, class T, class U>
    istream& operator>>(istream& is, tuple<S, T, U>& t){
        return is >> get<0>(t) >> get<1>(t) >> get<2>(t);
    }

    template <class S, class T>
    ostream& operator<<(ostream& os, const tuple<S, T>& t){
        return os << get<0>(t) << ' ' <<  get<1>(t);
    }

    template <class S, class T>
    ostream& operator<<(ostream& os, const pair<S, T>& t){
        return os << get<0>(t) << ' ' <<  get<1>(t);
    }

    template <class S, class T, class U>
    ostream& operator<<(ostream& os, const tuple<S, T, U>& t){
        return os << get<0>(t) << ' ' <<  get<1>(t) << ' ' <<  get<2>(t);
    }

    ///----- constants
    constexpr ll INFLL   = 1'000'000'000'000'000'020ll;
    constexpr ll INF     = 1'000'000'009;
    constexpr double PI      = 3.14'159'265'358'979'323'846;
    constexpr double EPS     = 1e-12;
}
using namespace utils;

namespace xelm_ModInt {
    class ModInt {
        static constexpr int64_t NIL = -1;
//        static constexpr int64_t MOD = 1'000'000'007;
        static constexpr int64_t MOD = 998'244'353;

    public:
        ll val;
        ModInt(long long x) : val(x >= 0 ? x % MOD : MOD - (-x) % MOD) {}
        ModInt(signed x) : val(x >= 0 ? x % MOD : MOD - (-x) % MOD) {}
        ModInt(unsigned long long x) : val(x % MOD) {}
        ModInt(unsigned x) : val(x % MOD) {}
        ModInt() : val{NIL} {}

        bool is_nil() { return val == NIL; }

        ModInt pow(long long n) const {
            long long r = 1, a = val;
            while (n) {
                if (n & 1) {
                    r *= a;
                    r %= MOD;
                }
                a *= a;
                a %= MOD;
                n /= 2;
            }
            return {r};
        }
        ModInt inv() const { /* return Inverse */ assert(val != 0);
            return this->pow(MOD - 2);
        }

        void operator+=(const ModInt &a) {
            val += a.val;
            if (val >= MOD) val -= MOD;
        }
        void operator-=(const ModInt &a) {
            val -= a.val;
            if (val < 0) val += MOD;
        }
        void operator*=(const ModInt &a) {
            val *= a.val;
            val %= MOD;
        }
        void operator/=(const ModInt &a) {
            val *= a.inv().val;
            val %= MOD;
        }

        ModInt operator+(const ModInt &x) const {
            long long v = val + x.val;
            return {v};
        }
        ModInt operator-(const ModInt &x) const {
            long long v = val - x.val;
            return {v};
        }
        ModInt operator*(const ModInt &x) const {
            long long v = val * x.val;
            return {v};
        }
        ModInt operator/(const ModInt &x) const {
            long long v = val * x.inv().val;
            return {v};
        }

        bool operator==(const ModInt &x) const { return x.val == val; }
        bool operator!=(const ModInt &x) const { return x.val != val; }

        friend istream &operator>>(istream &is, ModInt &r) {
            long long tmp;
            is >> tmp;
            r = tmp;
            return is;
        }
        friend ostream &operator<<(ostream &os, const ModInt &r) { return os << r.val; }
    };

    std::vector<ModInt> fact_memo, fact_inv_memo;

    ModInt __dont_memorized_factorial(long long n) {
        ModInt ans = 1;
        for (int i = 1; i < n; ++i) {
            ans *= i;
        } // end i
        return ans;
    }

    void fact_init(long long n) {
        fact_memo.resize(n + 1);
        fact_memo[0] = 1;
        for (long long i = 1; i <= n; ++i) {
            fact_memo[i] = fact_memo[i - 1] * i;
        } // end i

        fact_inv_memo.resize(n + 1);
        fact_inv_memo.back() = fact_memo[n].inv();
        for (long long i = n; i > 0; --i) {
            fact_inv_memo[i - 1] = fact_inv_memo[i] * i;
        } // end i
    }

    ModInt fact(long long n) {
        assert(fact_memo.size() > n);
        return fact_memo[n];
    }

    /// n! / k!(n-k!)
    /// k is small
    ModInt choose0(long long n, long long k) {
        if (k > n or k < 0 or n < 0) return 0;
        ModInt ans = 1;
        for (int i = 1; i <= k; ++i) {
            ans *= (n - i + 1);
        } // end i
        ans *= fact_inv_memo[k];
        return ans;
    }

    /// n and k is small
    ModInt choose1(long long n, long long k) {
        if (k > n or k < 0 or n < 0) return 0;
        assert(fact_memo.size() > n);
        ModInt ans = fact_memo[n] * fact_inv_memo[k] * fact_inv_memo[n - k];
        return ans;
    }

    ModInt operator "" _mod(unsigned long long x) {
        return ModInt{x};
    }
}
using namespace xelm_ModInt;


class solver{
    istream& is;
    ostream& os;

public:
    solver(istream& I, ostream& O) :is(I), os(O) {}

    vector<ModInt> dpower;

    int N;
    vector<int> h;
    bool input() {
        fact_init(200000);
        dpinit(300000);
        h = VEC(100009, 0);
        is >> N;

        for (int i = 0; i < 2*N; ++i) {
            int x;
            is >> x;
            h[x]++;
        } // end i
        return !!is;
    }

    void dpinit(int n){
        dpower.resize(n+1);
        dpower[0] = dpower[1] = 1;
        for (int i = 2; i < dpower.size(); ++i) {
            dpower[i] = dpower[i-2] * (i-2);
        } // end i
    }

    void run();
};

void solver::run(){
    if(!input()) return;

    deque<vector<ll>> p;
    for (auto &&hi : h) {
        if(hi == 0) continue;
        vector<ModInt> mi;
        int j = 0;
        while(2*j <= hi){
            mi.push_back(choose1(hi, 2*j)*dpower[2*j+1]);
            j++;
        }

        vector<ll> m;
        for (auto &&x : mi) {
            m.emplace_back(x.val);
        } // end x
        p.emplace_back(m);

    } // end hi

    while(p.size() > 1){
        p.emplace_back(atcoder::convolution(p[0], p[1]));
        p.pop_front();
        p.pop_front();
    }

    ModInt ans = 0;
    ll sgn = 1;
    for (int i = 0; i < p[0].size(); ++i) {
        ans += dpower[2*(N-i)+1]*sgn*p[0][i];
        sgn = -sgn;
    } // end i
    os << ans << endl;
}

int main(int argc, char *argv[]) {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << setprecision(16) << scientific;
#ifdef XELMH
    string test_cases = "test_f.txt";
    cerr << test_cases << " -->" << endl;
    auto fs = fstream(test_cases, fstream::in);
    int loop = 0;
    while(fs) {
        loop++;
        cout << '#' << loop << "#------\n";
        solver(fs, cout).run();
    }
    if(loop <= 1) {
        cout << "===" << endl;
        while(cin) solver(cin, cout).run();
    }
#else
    solver(cin, cout).run();
#endif
    return 0;
}


Compiler output:
a.cc:26:10: fatal error: atcoder/convolution.hpp: No such file or directory
   26 | #include <atcoder/convolution.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.