Language: C++

#include <bits/stdc++.h>
using namespace std;
//#include <boost/multiprecision/cpp_int.hpp>
//using multiInt = boost::multiprecision::cpp_int;

using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template<typename Q_temp>
using smaller_queue = priority_queue <Q_temp, vector<Q_temp>, greater<Q_temp> >;

const int INF = (int) 1e9;
const ll LINF = (ll) 4e18;
const ll MOD = (ll) (1e9 + 7);
const double PI = acos(-1.0);

#define REP(i,m,n) for(ll i = m; i < (ll)(n); ++i)
#define rep(i,n) REP(i, 0, n)
#define MP make_pair
#define MT make_tuple
#define YES(n) cout << ((n) ? "YES" : "NO") << endl
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible") << endl
#define all(v) v.begin(), v.end()
#define NP(v) next_permutation(all(v))
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define dbg2(x_) for(auto a_ : x_) cerr << a_ << " "; cerr << endl;
#define dbg3(x_ , sx_) rep(i, sx_) cerr << x_[i] << " "; cerr << endl;
vector<int> Dx = {0, 0, -1, 1, -1, 1, -1, 1, 0};
vector<int> Dy = {1, -1, 0, 0, -1, -1, 1, 1, 0};

ll gcd(ll a, ll b) {
    return b == 0 ? a : gcd(b, a % b);
}

inline ll CEIL(ll a, ll b) {
    return (a + b - 1) / b;
}

//------------------------------------------------------

const int sqrtN = 512;
#define int ll

struct SqrtDecomposition {
    int N, K;
    vector<int> data;
    vector<bool> lazyFlag;
    vector<int> lazyUpdate;

    SqrtDecomposition(int n) : N(n) {
        K = (N + sqrtN - 1) / sqrtN;
        data.assign(K * sqrtN, INF);
        lazyFlag.assign(K, false);
        lazyUpdate.assign(K, 0);
    }

    void eval(int k) {
        if (lazyFlag[k]) {
            lazyFlag[k] = false;
            for (int i = k * sqrtN; i < (k + 1) * sqrtN; ++i) {
                data[i] = lazyUpdate[k];
            }
        }
    }
    // [s, t)

    void update(int s, int t, int x) {
        for (int k = 0; k < K; ++k) {
            int l = k * sqrtN, r = (k + 1) * sqrtN;
            if (r <= s || t <= l)
                continue;
            if (s <= l && r <= t) {
                lazyFlag[k] = true;
                lazyUpdate[k] = x;
            } else {
                eval(k);
                for (int i = max(s, l); i < min(t, r); ++i) {
                    data[i] = x;
                }
            }
        }
    }

    int find(int i) {
        int k = i / sqrtN;
        eval(k);
        return data[i];
    }
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n, q;
    scanf("%lld %lld", &n, &q);
    vector<pair<ll, pll> > kouzi(n);
    vector<pll> person(q);

    rep(i, n) {
        scanf("%lld %lld %lld", &kouzi[i].second.first, &kouzi[i].second.second, &kouzi[i].first);
    }

    rep(i, q) {
        pll p;
        scanf("%lld", &p.first);
        p.second = i;
        person[i] = p;
    }

    sort(all(kouzi));
    reverse(all(kouzi));
    sort(all(person));

    //----------------
    SqrtDecomposition sd(q);

    rep(i, q) {
        sd.data[i] = -1;
    }

    rep(i, n) {
        ll s = kouzi[i].second.first;
        ll t = kouzi[i].second.second;
        ll x = kouzi[i].first;
        auto itr1 = lower_bound(all(person), MP(s - x, -LINF));
        auto itr2 = upper_bound(all(person), MP(t - x - 1, LINF));
        ll l = (*itr1).second, r = (*itr2).second;
        sd.update(l, r, x);
    }
    ll ans[200010];
    rep(i, q) ans[person[i].second] = sd.find(i);
    rep(i, q) printf("%lld\n", ans[i]);
    return 0;
}


Compiler output:
a.cc:44:13: error: '::main' must return 'int'
   44 | #define int ll
      |             ^~
a.cc:93:1: note: in expansion of macro 'int'
   93 | int main() {
      | ^~~