Language: C++

#include <bits/stdc++.h>
#include <boost/functional/hash.hpp>

#define debug 0
#define esc(ret) cout << (ret) << endl,quick_exit(0)
#define fcout(d) cout << fixed << setprecision(d)
#define repU(i,s,t) for(int i = (int)(s); i <= (int)(t); ++i)
#define repD(i,s,t) for(int i = (int)(s); i >= (int)(t); --i)
#define rep(i,n) repU(i,0,(n) - 1)
#define rep1(i,n) repU(i,1,(n))
#define all(v) begin(v),end(v)
#define vct vector
#define prique priority_queue
#define l_bnd lower_bound
#define u_bnd upper_bound
#define puf push_front
#define pub push_back
#define pof pop_front
#define pob pop_back
#define mkp make_pair
#define mkt make_tuple
#define ins insert
#define emp emplace
#define era erase
#define fir first
#define sec second
#define odd(x) (x & 1)
#define even(x) (!odd(x))

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef pair<int,int> pii;
typedef pair<db,int> pdi;
typedef tuple<int,int,int> tiii;

const int dir[][2] = { {1,0},{0,1},{-1,0},{0,-1},{1,1},{-1,1},{-1,-1},{1,-1} };
const int mod = 1e9 + 7;
const int inf32 = (1 << 30) - 1;
const ll inf64 = (1LL << 62) - 1;

template <class T, class U> T qceil(T x, U y) { return x > 0 ? (x - 1) / y + 1 : x / y; }
template <class T, class U> bool parity(T x, U y) { return odd(x) ^ even(y); }
template <class T, class U> bool chmax(T &m, U x) { if(m < x) { m = x; return 1; } return 0; }
template <class T, class U> bool chmin(T &m, U x) { if(m > x) { m = x; return 1; } return 0; }
template <class T> bool cmprs(T &v) {
    T tmp = v;
    sort(all(tmp));
    tmp.erase(unique(all(tmp)),end(tmp));
    for(auto it = begin(v); it != end(v); ++it) *it = l_bnd(all(tmp),*it) - begin(tmp) + 1;
    return v.size() > tmp.size();
}

struct Table {
    ll md;
    vector<ll> fact_tbl,invfact_tbl;
    vector<vector<ll>> comb_tbl;

    Table(int n, int m = mod) {
        md = m;
        fact_init(n);
        invfact_init(n);
        //comb_init(n);
    }

    ll fact(int x) {
        return fact_tbl[x];
    }

    ll invfact(int x) {
        return invfact_tbl[x];
    }

    ll comb(int x, int y) {
        if(x < y || y < 0) return 0;
        return comb_tbl[x][y];
    }

    void fact_init(int n) {
        fact_tbl.resize(n + 1);
        fact_tbl[0] = 1;
        for(int i = 1; i <= n; i++) fact_tbl[i] = fact_tbl[i - 1] * i % md;
    }

    void invfact_init(int n) {
        invfact_tbl.resize(n + 1);
        for(int i = 0; i <= n; i++) invfact_tbl[i] = modinv(fact(i));
    }

    void comb_init(int n) {
        comb_tbl.resize(n + 1);
        comb_tbl[0].assign(1,1);
        for(int i = 1; i <= n; i++) {
            comb_tbl[i].resize(i + 1);
            for(int j = 0; j * 2 <= i; j++) {
                comb_tbl[i][j] = comb_tbl[i][i - j] = (comb(i - 1,j - 1) + comb(i - 1,j)) % md;
            }
        }
    }

    ll modpow(ll n, ll e) {
        n %= md,e %= md - 1;
        ll ret = 1;
        while(e) {
            if(e & 1) ret = ret * n % md;
            n = n * n % md;
            e /= 2;
        }
        return ret;
    }

    ll modinv(ll n) {
        return modpow(n,md - 2);
    }
};


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n,a[100100],b[100100];
    cin>>n;
    Table tb(n); 
    rep(i,n)cin>>a[i];
    rep(i,n)cin>>b[i];
    sort(a,a+n);
    sort(b,b+n);
    a[n]=inf32;
    ll ans = 1;
    while(i<n){
        int j=i;
        while(j<n&&a[i]>b[j])++j;
        if(j>i){
            ans*=j-i;
            ans%=mod;
            i=j;
            continue;
        }
        int k=i;
        while(k<n&&a[k]<b[i])++k;
        ans*=k-i;
        ans%=mod;
        i=k;
    }
    esc(ans);
}


Compiler output:
a.cc:2:10: fatal error: boost/functional/hash.hpp: No such file or directory
    2 | #include <boost/functional/hash.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.