criyle/codenet-compile-errors huggingface dataset:
Language: C++

require 'set'

nn, qq = gets.split.map(&:to_i)
events = []
temp = []

# 30bit         30bit 2bit
# start_or_end  point type

POINT_or_INDEX = (((1 << 30) - 1) << 2)

nn.times do
  temp = gets.split.map(&:to_i)
  events.push(
    ((temp[0] - temp[2]) << 32) +
    (temp[2] << 2)
  )
  events.push(
    ((temp[1] - temp[2]) << 32) +
    (temp[2] << 2) +
    1
  )
end

1.step(qq, 1) do |i|
  events.push(
    (gets.to_i << 32) +
    (i << 2) +
    3
  )
end

events.sort!
p events

ss = Set.new
ans = []
events.each do |event|
  p event
  if event[0] == 0
    ss.add((event & POINT_or_INDEX) >> 32)
  else
    if event[1] == 0
      ss.delete((event & POINT_or_INDEX) >> 32)
    else
      ans[((event & POINT_or_INDEX) >> 32)] = ss.min || -1
    end
  end
end

p ans

puts ans[1..-1]

Compiler output:
a.cc:1:9: warning: multi-character character constant [-Wmultichar]
    1 | require 'set'
      |         ^~~~~
a.cc:7:3: error: "30bit" after # is not a positive integer
    7 | # 30bit         30bit 2bit
      |   ^~~~~
a.cc:8:3: error: invalid preprocessing directive #start_or_end
    8 | # start_or_end  point type
      |   ^~~~~~~~~~~~
a.cc:53:10: error: too many decimal points in number
   53 | puts ans[1..-1]
      |          ^~~
a.cc:1:1: error: 'require' does not name a type
    1 | require 'set'
      | ^~~~~~~
Language: Java

import java.util.*;

public class AtCoder {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[]$) {
        int n = scanner.nextInt();
        int q = scanner.nextInt();
        Set<int[]> list = new TreeSet<>(Comparator.comparingInt(array -> array[0]));
        for (int i = 1; i <= n; i++) {
            int s = Integer.parseInt(scanner.next());
            int t = Integer.parseInt(scanner.next());
            int x = Integer.parseInt(scanner.next());
            list.add(new int[] {s - x, x, -1});
            list.add(new int[] {t - x, x, -2});
        }
        int[] ans = new int[q];
        for (int i = 0; i < q; i++) {
            list.add(new int[] {Integer.parseInt(scanner.next()), 0, i});
        }
        TreeSet<Integer> set = new TreeSet<>();
        for (int[] s : list) {
            if (s[2] == -1) {
                set.add(s[1]);
            } else if (s[2] == -2) {
                set.remove(s[1]);
            } else {
                ans[s[2]] = set.isEmpty() ? -1 : set.first();
            }
        }

        Arrays.stream(ans).forEach(System.out::println);
    }
}

Compiler output:
Main.java:3: error: class AtCoder is public, should be declared in a file named AtCoder.java
public class AtCoder {
       ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<(n);i++)
#define repr(i,n) for(int i=(n)-1;i>=0;i++)
#define repf(i,j,n) for(int i=(j);i<(n);i++)

struct rw{
	int t,x,e;
	rw(){};
	rw(int t_,int x_,int e_){
		t=t_,x=x_,e=e_;
	};
	bool operator<(const rw& o)const {return t<o.t;}
};

signed main(){
	int n,q;cin>>n>>q;
	vector<int> d(q),ans;
	vector<rw> r;
	rep(i,n){
		int s,t,x;cin>>s>>t>>x;
		r.push_back(rw(s-x,x,1));
		r.push_back(rw(t-x,x,-1);} 
	for(auto&& u:d)cin>>u;
	sort(begin(r),end(r));

		int idx=0;
		multiset<int>s; 
	for(auto&& u:d){
		while(idx<r.size()&&u<=r[idx].t){
			if(r[idx].e==1)s.insert(r[idx].x);
			else s.erase(s.find(r[idx].x));
			idx++;
		}
		if(s.empty())ans.push_back(-1);
		else ans.push_back(*begin(s));
	}	
	for(auto&& u:ans)cout<<u<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:41: error: expected ')' before ';' token
   24 |                 r.push_back(rw(t-x,x,-1);}
      |                            ~            ^
      |                                         )
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<(n);i++)
#define repr(i,n) for(int i=(n)-1;i>=0;i++)
#define repf(i,j,n) for(int i=(j);i<(n);i++)

struct rw{
	int t,x,e;
	rw(){};
	rw(int t_,int x_,int e_){
		t=t_,x=x_,e=e_;
	};
	bool operator<(const rw& o)const {return t<0.t;}
};

signed main(){
	int n,q;cin>>n>>q;
	vector<int> d(q),ans;
	vector<rw> r;
	rep(i,n){
		int s,t,x;cin>>s>>t>>x;
		r.push_back(rw(s-x,x,1));
		r.push_back(rw(t-x,x,-1);} 
	for(auto&& u:d)cin>>u;
	sort(begin(r),end(r));

		int idx=0;
		multiset<int>s; 
	for(auto&& u:d){
		while(idx<r.size()&&u<=r[idx].t){
			if(r[idx].e==1)s.insert(r[idx].x);
			else s.erase(s.find(r[idx].x));
			idx++;
		}
		if(s.empty())ans.push_back(-1);
		else ans.push_back(*begin(s));
	}	
	for(auto&& u:ans)cout<<u<<endl;
}


Compiler output:
a.cc: In member function 'bool rw::operator<(const rw&) const':
a.cc:14:52: error: unable to find numeric literal operator 'operator""t'
   14 |         bool operator<(const rw& o)const {return t<0.t;}
      |                                                    ^~~
a.cc: In function 'int main()':
a.cc:24:41: error: expected ')' before ';' token
   24 |                 r.push_back(rw(t-x,x,-1);}
      |                            ~            ^
      |                                         )
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<(n);i++)
#define repr(i,n) for(int i=(n)-1;i>=0;i++)
#define repf(i,j,n) for(int i=(j);i<(n);i++)

struct rw{
	int t,x,e;
	rw(){};
	rw(int t_,int x_,int e_){
		t=t_,x=x_,e=e_;
	};
	bool operator<(const rw& o)const {return t<t.x;}
};

signed main(){
	int n,q;cin>>n>>q;
	vector<int> d(q),ans;
	vector<rw> r;
	rep(i,n){
		int s,t,x;cin>>s>>t>>x;
		r.push_back(rw(s-x,x,1));
		r.push_back(rw(t-x,x,-1)} 
	for(auto&& u:d)cin>>u;
	sort(begin(r),end(r));

		int idx=0;
		multiset<int>s; 
	for(auto&& u:d){
		while(idx<r.size()&&u<=r[idx].t){
			if(r[idx].e==1)s.insert(r[idx].x);
			else s.erase(s.find(r[idx].x));
			idx++;
		}
		if(s.empty())ans.push_back(-1);
		else ans.push_back(*begin(s));
	}	
	for(auto&& u:ans)cout<<u<<endl;
}


Compiler output:
a.cc: In member function 'bool rw::operator<(const rw&) const':
a.cc:14:54: error: request for member 'x' in '((const rw*)this)->rw::t', which is of non-class type 'const long long int'
   14 |         bool operator<(const rw& o)const {return t<t.x;}
      |                                                      ^
a.cc: In function 'int main()':
a.cc:24:41: error: expected ')' before '}' token
   24 |                 r.push_back(rw(t-x,x,-1)}
      |                            ~            ^
      |                                         )
Language: C

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <tuple>
#include <utility>
#include <set>
using namespace std;
#define LLI long long int

int main(int argc, char *argv[])
{
    // VARIABLES
    LLI N, Q;
    LLI s,t,x;
    vector<tuple<LLI, LLI, LLI>> L;
    LLI d;
    set<tuple<LLI, LLI>> D;

    // INPUT
    cin >> N >> Q;
    for (LLI i=0; i<N; i++){
        cin >> s >> t >> x;
        L.emplace_back(s-x, t-x, x);
    }

    for (LLI i=0; i<Q; i++){
        cin >> d;
        D.insert(make_tuple(d, i));
    }
   

    // PROC
    sort(L.begin(), L.end(), [](tuple<LLI, LLI, LLI> left, tuple<LLI, LLI, LLI> right) {
        return get<2>(left) <= get<2>(right);
    });

    vector<LLI> DD(Q, -1L);
    for (auto l : L){
        LLI s, t, x;
        tie(s, t, x) = l;

        auto it = D.lower_bound(make_tuple(s, -1));
        while (it != D.cend()) {
            LLI d = get<0>(*it);
            LLI idx = get<1>(*it);

            if (d >= t) {
                break;
            }

            DD[idx] = x;
            D.erase(it++);
        }
    }

    // OUTPUT
    for (auto d : DD) {
        cout << d << endl;
    }
    
    return 0;   
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <Cstdio>
#include <algorithm>
using namespace std;
struct road
{
    double s;
    double t;
    int x;
};
struct peo
{
    int d;
    int vt;
    int res;
    int fi;
};
road a[1000000];peo b[1000000];int n,q;

void readdata()
{
    cin>>n>>q;
    for (int i=1;i<=n;i++)
    {
        cin>>a[i].s>>a[i].t>>a[i].x;
        a[i].s-=(0.5+a[i].x);
        a[i].t-=(0.5+a[i].x);
    }
    for (int i=1;i<=q;i++)
    {
        cin>>b[i].d;
        b[i].vt=i;
    }
}

void genner()
{
    for (int i=1;i<=q;i++)
        b[i].res=-1;
}

bool cmp1(road a,road b)
{
    return a.x<b.x;
}

bool cmp2(peo a,peo b)
{
    return a.d<b.d;
}

bool cmp3(peo a,peo b)
{
    return a.vt<b.vt;
}

int find1(int l,int r,double k)
{
    while (l<=r)
    {
        int mid=(l+r)/2;
        if ((b[mid].d>=k)&&(b[mid-1].d<k)) return mid;
        if (b[mid].d<k) l=mid++;
        else r=mid--;
    }
    return 0;
}

int find2(int l,int r,double k)
{
    while (l<=r)
    {
        int mid=(l+r)/2;
        if ((b[mid].d<=k)&&(b[mid+1].d>k)) return mid;
        if (b[mid].d>k) r=mid--;
        else l=mid++;
    }
    return 0;
}

void solve()
{
    for (int i=1;i<=n;i++)
    {
        int x=find1(1,q,a[i].s);
        int y=find2(1,q,a[i].t);
        if ((x!=0)&&(y!=0))
        {
            while (x<=y)
            {
                if (b[x].res==-1)
                {
                    b[x].res=a[i].x;
                    b[x].fi=y;
                }
                else
                {
                    x=b[x].fi;
                }
                x++;
            }
        }
    }
}

void xuat()
{
    for (int i=1;i<=q;i++)
    {
        cout<<b[i].res<<"\n";
    }
}

int main()
{
   // freopen("a.inp","r",stdin);
   // freopen("a.out","w",stdout);
    readdata();
    genner();
    b[0].d=-1e9;
    b[q+1].d=1e9;
    sort(a+1,a+1+n,cmp1);
    sort(b+1,b+1+q,cmp2);
    solve();
    sort(b+1,b+1+q,cmp3);
    xuat();
    return 0;
}


Compiler output:
a.cc:2:10: fatal error: Cstdio: No such file or directory
    2 | #include <Cstdio>
      |          ^~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <cstdint>
#include <cmath>
#include <set>

using namespace std;

using Event = struct
{
    int64_t time;
    int kind;
    union {
        int64_t pos;
        int index;
    } v;
};

int64_t S[200'000];
int64_t T[200'000];
int64_t X[200'000];
int64_t D[200'000];

Event es[600'000];

int64_t result[200'000];

int main()
{
    int N, Q;

    cin >> N >> Q;

    for (int i = 0; i < N; i++)
    {
        cin >> S[i] >> T[i] >> X[i];
    }

    for (int i = 0; i < Q; i++)
    {
        cin >> D[i];
    }

    for (int i = 0; i < N; i++)
    {
        es[2 * i].time = S[i] - X[i];
        es[2 * i].kind = 1;
        es[2 * i].v.pos = X[i];
        es[2 * i + 1].time = T[i] - X[i];
        es[2 * i + 1].kind = 0;
        es[2 * i + 1].v.pos = X[i];
    }

    for (int i = 0; i < Q; i++)
    {
        es[2 * N + i].time = D[i];
        es[2 * N + i].kind = 2;
        es[2 * N + i].v.index = i;
    }

    const int E = 2 * N + Q;

    sort(es, es + E, [](const Event &l, const Event &r) {
        if (l.time == r.time)
        {
            return l.kind < r.kind;
        }

        return l.time < r.time;
    });

    /*
    for (int i = 0; i < E; i++)
    {
        cout << "t=" << es[i].time << ", kind=" << es[i].kind;
        if (es[i].kind != 2)
        {
            cout << ", x=" << es[i].v.pos;
        }
        else
        {
            cout << ", idx=" << es[i].v.index;
        }
        cout << endl;
    }
    */

    set<int64_t> current;

    for (int i = 0; i < E; i++)
    {
        if (es[i].kind == 0)
        {
            current.erase(es[i].v.pos);
        }
        else if (es[i].kind == 1)
        {
            current.insert(es[i].v.pos);
        }
        else
        {
            auto iter = current.begin();
            if (iter == current.end())
            {
                result[es[i].v.index] = -1;
            }
            else
            {
                result[es[i].v.index] = *iter;
            }
        }

        /*
        cout << "{ ";
        for (auto it = current.begin(); it != current.end(); it++)
        {
            cout << *it << ", ";
        }
        cout << "}" << endl;
        */
    }

    for (int i = 0; i < Q; i++)
    {
        cout << result[i] << endl;
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:62:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   62 |     sort(es, es + E, [](const Event &l, const Event &r) {
      |     ^~~~
      |     sqrt
Language: C++

#include <bits/stdc++.h>
using namespace std;

typedef pair <int, int> ii;

int n, q;
vector <ii> seq;
set <int> S;

int main()
{
    scanf("%d %d", &n, &q);
    for (int i = 0; i < n; i++) {
        int s, t, x; scanf("%d %d %d", &s, &t, &x);
        seq.push_back(ii(s - x, x));
        seq.push_back(ii(t - x, -x));
    }
    sort(seq.begin(), seq.end());
    int pnt = 0;
    while (q--) {
        int d; scanf("%d", &d);
        while (pnt < seq.size() && seq[pnt].first <= d) {
            if (seq[pnt].second < 0) 
            else S.insert(seq[pnt].second);
            pnt++;
        }
        if (S.empty()) printf("-1\n");
        else printf("%d\n", *S.begin());
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:13: error: expected primary-expression before 'else'
   24 |             else S.insert(seq[pnt].second);
      |             ^~~~
Language: C++

#include <stdio.h>
#include <stdlib.h>

int work[200000][3];

int cmp(const void *a, const void *b) {
	const int *ai = a, *bi = b;
	return ai[0] - bi[0];
}

struct node {
	int n;
	struct node *l, *r;
};

void twalk(const struct node *root) {
	if (root == NULL) return;
	//printf("walk: %d\n", root->n);
	twalk(root->l);
	twalk(root->r);
}

void tpush(struct node **root, int n) {
	//printf("push %d\n", n);
	while (*root)
		if ((*root)->n >= n) root = &(*root)->l;
		else root = &(*root)->r;

	*root = malloc(sizeof **root);
	(*root)->n = n;
	(*root)->l = NULL;
	(*root)->r = NULL;
}

void tpop(struct node **root, int n) {
	//printf("pop %d\n", n);
	while ((*root)->n != n)
		if ((*root)->n > n) root = &(*root)->l;
		else if ((*root)->n < n) root = &(*root)->r;

	struct node *c = NULL;
	if ((*root)->l == NULL) c = (*root)->r;
	else if ((*root)->r == NULL) c = (*root)->l;
	else {
		struct node **cp = &(*root)->r;
		while ((*cp)->l) cp = &(*cp)->l;
		c = *cp;
		*cp = NULL;
	}

	free(*root);
	*root = c;
}

int tmin(struct node *const *root) {
	if (*root == NULL) return -1;
	while ((*root)->l) root = &(*root)->l;
	return (*root)->n;
}

int main(void) {
	int n, q;
	scanf("%d%d", &n, &q);

	for (int i = 0; i < n; i++) {
		int s, t, x;
		scanf("%d%d%d", &s, &t, &x);
		work[i*2][0] = s-x;
		work[i*2][1] = 1;
		work[i*2][2] = x;
		work[i*2+1][0] = t-x;
		work[i*2+1][1] = 0;
		work[i*2+1][2] = x;
	}
	qsort(work, 2*n, sizeof work[0], cmp);

	struct node *root = NULL;
	int ind = 0;
	for (int i = 0; i < q; i++) {
		int d;
		scanf("%d", &d);
		while (ind < 2*n && work[ind][0] <= d) {
			//printf("work[%d]: %d %d %d\n", ind, work[ind][0], work[ind][1], work[ind][2]);
			if (work[ind][1]) tpush(&root, work[ind][2]);
			else tpop(&root, work[ind][2]);
			twalk(root);
			ind++;
		}
		printf("%d\n", tmin(&root));
	}
}


Compiler output:
a.cc: In function 'int cmp(const void*, const void*)':
a.cc:7:25: error: invalid conversion from 'const void*' to 'const int*' [-fpermissive]
    7 |         const int *ai = a, *bi = b;
      |                         ^
      |                         |
      |                         const void*
a.cc:7:34: error: invalid conversion from 'const void*' to 'const int*' [-fpermissive]
    7 |         const int *ai = a, *bi = b;
      |                                  ^
      |                                  |
      |                                  const void*
a.cc: In function 'void tpush(node**, int)':
a.cc:29:23: error: invalid conversion from 'void*' to 'node*' [-fpermissive]
   29 |         *root = malloc(sizeof **root);
      |                 ~~~~~~^~~~~~~~~~~~~~~
      |                       |
      |                       void*
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
#define INIT() ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define Rep(i,n) for (int i = 0; i < (n); ++i)
#define For(i,s,t) for (int i = (s); i <= (t); ++i)
#define rFor(i,t,s) for (int i = (t); i >= (s); --i)
#define ForLL(i, s, t) for (LL i = LL(s); i <= LL(t); ++i)
#define rForLL(i, t, s) for (LL i = LL(t); i >= LL(s); --i)
#define foreach(i,c) for (__typeof(c.begin()) i = c.begin(); i != c.end(); ++i)
#define rforeach(i,c) for (__typeof(c.rbegin()) i = c.rbegin(); i != c.rend(); ++i)
 
#define pr(x) cout << #x << " = " << x << "  "
#define prln(x) cout << #x << " = " << x << endl
 
#define LOWBIT(x) ((x)&(-x))
 
#define ALL(x) x.begin(),x.end()
#define INS(x) inserter(x,x.begin())
 
#define ms0(a) memset(a,0,sizeof(a))
#define msI(a) memset(a,inf,sizeof(a))
#define msM(a) memset(a,-1,sizeof(a))

#define MP make_pair
#define PB push_back
#define ft first
#define sd second
 
template<typename T1, typename T2>
istream &operator>>(istream &in, pair<T1, T2> &p) {
    in >> p.first >> p.second;
    return in;
}
 
template<typename T>
istream &operator>>(istream &in, vector<T> &v) {
    for (auto &x: v)
        in >> x;
    return in;
}
 
template<typename T1, typename T2>
ostream &operator<<(ostream &out, const std::pair<T1, T2> &p) {
    out << "[" << p.first << ", " << p.second << "]" << "\n";
    return out;
}

inline int gc(){
	static const int BUF = 1e7;
	static char buf[BUF], *bg = buf + BUF, *ed = bg;
	
	if(bg == ed) fread(bg = buf, 1, BUF, stdin);
	return *bg++;
} 

inline int ri(){
	int x = 0, f = 1, c = gc();
	for(; c<48||c>57; f = c=='-'?-1:f, c=gc());
	for(; c>47&&c<58; x = x*10 + c - 48, c=gc());
	return x*f;
}
 
typedef long long LL;
typedef unsigned long long uLL;
typedef pair< double, double > PDD;
typedef pair< int, int > PII;
typedef pair< string, int > PSI;
typedef set< int > SI;
typedef vector< int > VI;
typedef vector< PII > VPII;
typedef map< int, int > MII;
typedef unordered_map< int, int > uMII;
typedef pair< LL, LL > PLL;
typedef vector< LL > VL;
typedef vector< VL > VVL;
typedef priority_queue< int > PQIMax;
typedef priority_queue< int, VI, greater< int > > PQIMin;
const double EPS = 1e-10;
const LL inf = 0x7fffffff;
const LL infLL = 0x7fffffffffffffffLL;
const LL mod = 1e9 + 7;
const int maxN = 2e5 + 7;
const LL ONE = 1;
const LL evenBits = 0xaaaaaaaaaaaaaaaa;
const LL oddBits = 0x5555555555555555;

int N, Q;
int A[maxN];
 
int main(){
	INIT(); 
	cin >> N >> Q;
	For(i, 1, N) {
		int S, T, X;
		cin >> S >> T >> X;
		S -= X;
		T -= X + 1;
		if(T < 0) continue;
		else if(S < 0) S = 0;
		
		For(j, S, T) {
			if(A[j]) A[j] = min(A[j], X);
			else A[j] = X;
		}
	}
	
	For(i, 1, Q) {
		LL D;
		cin >> D;
		
		if(A[D])) cout << A[D] << endl;
		else cout << -1 << endl;
	}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:112:25: error: expected primary-expression before ')' token
  112 |                 if(A[D])) cout << A[D] << endl;
      |                         ^
Language: C++

#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int n;
    int q;
    cin >> n >> q;
    int s[n];
    int t[n];
    int x[n];
    for(int i=0;i<n;i++){
        cin >> s[i] >> t[i] >> x[i];
    }
    int d[q];
    for(int i=0;i<q;i++){
        cin >> d[i];
    }
    for(int i=0;i<q;i++){
        for(int j=0;j<n;j++){
        if(s[j]<=d[i]+x[j]&&d[i]+x[j]<=t[j]-1){
            cout << x[j];
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:2: error: expected '}' at end of input
   24 | }
      |  ^
a.cc:3:15: note: to match this '{'
    3 | int main(void){
      |               ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i++)

struct rw{
	int x,a,b;
	rw(){};
	rw(int x_,int s_,int t_){
		x=x_,a=s_-x_,b=t_-x;
	};
	bool operator<(const rw& o){const return x<o.x;}
};

signed main(){
	int n,q;cin>>n>>q;
	vector<int> d(q),ans(q,-1);
	vector<rw> r;
	rep(i,n){  int s,t,x;cin>>s>>t>>x;r.push_back(rw(x,s,t));} 
	for(auto&& w:d)cin>>w;
	sort(begin(r),end(r));
	rep(i,n){
		int i0=lower_bound(begin(d),end(d),r[i].a)-begin(d);
		int i1=upper_bound(begin(d),end(d),r[i].b)-begin(d);
	for(int j=i0,j<i1;j++)if(ans[j]==-1)ans[j]=r[i].x;	
	}	
	for(auto&& w:ans)cout<<w<<endl;
}

Compiler output:
a.cc: In member function 'bool rw::operator<(const rw&)':
a.cc:13:43: error: expected unqualified-id before 'return'
   13 |         bool operator<(const rw& o){const return x<o.x;}
      |                                           ^~~~~~
a.cc:13:56: warning: no return statement in function returning non-void [-Wreturn-type]
   13 |         bool operator<(const rw& o){const return x<o.x;}
      |                                                        ^
a.cc: In function 'int main()':
a.cc:26:23: error: expected ';' before '<' token
   26 |         for(int j=i0,j<i1;j++)if(ans[j]==-1)ans[j]=r[i].x;
      |                       ^
      |                       ;
a.cc:26:23: error: expected primary-expression before '<' token
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i++)

struct rw{
	int x,a,b;
	rw(){};
	rw(int x_,s_,t_){
		x=x_,a=s_-x_,b=t_-x;
	};
	bool operator<(const rw& o){const return x<o.x;}
};

signed main(){
	int n,q;cin>>n>>q;
	vector<int> d(q),ans(q,-1);
	vector<rw> r;
	rep(i,n){  int s,t,x;cin>>s>>t>>x;r.push_back(rw(x,s,t));} 
	for(auto&& w:d)cin>>w;
	sort(begin(r),end(r));
	rep(i,n){
		int i0=lower_bound(begin(d),end(d),r[i].a)-begin(d);
		int i1=upper_bound(begin(d),end(d),r[i].b)-begin(d);
	for(int j=i0,j<i1;j++)if(ans[j]==-1)ans[j]=r[i].x;	
	}	
	for(auto&& w:ans)cout<<w<<endl;
}

Compiler output:
a.cc:10:19: error: 's_' has not been declared
   10 |         rw(int x_,s_,t_){
      |                   ^~
a.cc:10:22: error: 't_' has not been declared
   10 |         rw(int x_,s_,t_){
      |                      ^~
a.cc: In constructor 'rw::rw(long long int, int, int)':
a.cc:11:24: error: 's_' was not declared in this scope; did you mean 'x_'?
   11 |                 x=x_,a=s_-x_,b=t_-x;
      |                        ^~
      |                        x_
a.cc:11:32: error: 't_' was not declared in this scope; did you mean 'tm'?
   11 |                 x=x_,a=s_-x_,b=t_-x;
      |                                ^~
      |                                tm
a.cc: In member function 'bool rw::operator<(const rw&)':
a.cc:13:43: error: expected unqualified-id before 'return'
   13 |         bool operator<(const rw& o){const return x<o.x;}
      |                                           ^~~~~~
a.cc:13:56: warning: no return statement in function returning non-void [-Wreturn-type]
   13 |         bool operator<(const rw& o){const return x<o.x;}
      |                                                        ^
a.cc: In function 'int main()':
a.cc:26:23: error: expected ';' before '<' token
   26 |         for(int j=i0,j<i1;j++)if(ans[j]==-1)ans[j]=r[i].x;
      |                       ^
      |                       ;
a.cc:26:23: error: expected primary-expression before '<' token
Language: Java

import java.util.*;

public class Main {


    static class Pair implements Comparable<Pair>{
        int d =0;
        int idx =0;
        Pair(int x , int y){
            this.d = x;
            this.idx = y;
        }
        @Override
        public int compareTo(Pair o) {
            return  this.d-o.d;
        }

    }

    static class Trio implements Comparable<Trio>{
        int x=0;
        int s=0;
        int t=0;
        Trio(int x , int s , int t){
            this.x = x;
            this.s = s;
            this.t = t;
        }
        @Override
        public int compareTo(Trio o) {
            int xd = this.x - o.x;
            int sd = this.s - o.s;
            int td = this.t - o.t;
            return xd != 0 ? xd :
                    sd !=0 ? sd :
                            td;
        }

    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();// ins
        int Q = sc.nextInt();//Q people

        ArrayList<Trio> constructs = new ArrayList<>();
        for (int i = 0; i < N; i++) {
            int s = sc.nextInt();int t = sc.nextInt();int x = sc.nextInt();
            constructs.add(new Trio(x ,s-x, t-x)  );
        }

        Collections.sort(constructs, new Comparator<Trio>() { // sort construcions by start date
            @Override
            public int compare(Trio o1, Trio o2) {
                return o1.s - o2.s;
            }
        });


        TreeSet<Trio> sortedByEndTime= new TreeSet<>(new Comparator<Trio>() {
            @Override
            public int compare(Trio o1, Trio o2) {
                return o1.t - o2.t;
            }
        });
        TreeSet<Trio> sortedByDistance= new TreeSet<>( (o1,o2) -> o1.x-o2.x );


        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < Q; i++) {

            int d= sc.nextInt();

            int idx = 0;
            while(idx < constructs.size() && constructs.get(idx).s <= d ){ //  Starttme <= d
                sortedByEndTime.add(constructs.get(idx));
                sortedByDistance.add(constructs.get(idx));
                idx++;
            }

            while( !sortedByEndTime.isEmpty() &&  sortedByEndTime.first().t <= d ) { //  Endttme >= d remove
                Trio  construct = sortedByEndTime.pollFirst();
                sortedByDistance.remove(construct);
            }

            if(sortedByDistance.isEmpty()){
                //sb.append("-1\n");
                System.out.println("-1");
            }else{
                Trio closestConstru = sortedByDistance.first();
//                sb.append(closestConstru.x);
                System.out.println(closestConstru.x);
            }
            sortedByDistance.clear();
            sortedByEndTime.clear();
        }
    }

Compiler output:
Main.java:96: error: reached end of file while parsing
    }
     ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define all(v) v.begin(),v.end()
#define SZ(v) ((int)v.size())
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
#define Max(a, b) a = max(a, b)
#define Min(a, b) a = min(a, b)
#define bit(n) (1LL<<(n))
#define bit_exist(x, n) ((x >> n) & 1)
#define debug(x) cout << #x << "=" << x << endl;
#define vdebug(v) cout << #v << "=" << endl; REP(i_debug, v.size()){ cout << v[i_debug] << ","; } cout << endl;
#define mdebug(m) cout << #m << "=" << endl; REP(i_debug, m.size()){ REP(j_debug, m[i_debug].size()){ cout << m[i_debug][j_debug] << ","; } cout << endl;}
#define pb push_back
#define f first
#define s second
#define int long long
#define INF 1000000000000000000
template<typename T> istream &operator>>(istream &is, vector<T> &v){ for (auto &x : v) is >> x; return is; }
template<typename T> ostream &operator<<(ostream &os, vector<T> &v){ for(int i = 0; i < v.size(); i++) { cout << v[i]; if(i != v.size() - 1) cout << endl; }; return os; }
template<typename T> void Out(T x) { cout << x << endl; }
template<typename T1, typename T2> void Ans(bool f, T1 y, T2 n) { if(f) Out(y); else Out(n); }

using vec = vector<int>;
using mat = vector<vec>;
using Pii = pair<int, int>;
using PiP = pair<int, Pii>;
using PPi = pair<Pii, int>;
using bools = vector<bool>;
using pairs = vector<Pii>;

//int dx[4] = {1,0,-1,0};
//int dy[4] = {0,1,0,-1};
//char d[4] = {'D','R','U','L'};

const int mod = 1000000007;
//const int mod = 998244353;
#define Add(x, y) x = (x + (y)) % mod
#define Mult(x, y) x = (x * (y)) % mod



signed main(){

    int N, Q; cin >> N >> Q;
    vector<PiP> p(N);
    int S, T, X;
    REP(i, N){
        cin >> S >> T >> X;
        p[i] = PiP(X, Pii(S, T));
    }
    Sort(p);

    vec D(Q); cin >> D;
    set<int> s;
    REP(i, Q) s.insert(D[i]);
    map<int, int> ans;

    REP(i, N){
        int x = p[i].f, t1 = p[i].s.f, t2 = p[i].s.s;
        t1 -= x;
        t2 -= x;
        auto it1 = s.lower_bound(t1);
        auto it2 = it1;
        while(it2 != s.end() && (*it2) < t2){
            ans[*it2] = x;
            it2++;
        }
        s.erase(it1, it2);
    }
    for(int i: s) ans[i] = -1;
    REP(i, Q) else Out(ans[D[i]]);

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:79:15: error: expected primary-expression before 'else'
   79 |     REP(i, Q) else Out(ans[D[i]]);
      |               ^~~~
Language: Java

import java.util.Scanner;
import java.util.ArrayList;
import java.util.Collections;
import java.util.TreeSet;
import java.util.Iterator;

class Event implements Comparable<Event>{
    int kind; int time; int x;
    public Event(int s, int t, int x){
        this.x = x;
        if(t==0){
            this.kind = 1;
            this.time = s-x;
        }else{
            this.kind = -1;
            this.time = t-x;
        }
    }
    @Override
    public int compareTo(Event e){
        return e.time - this.time;
    }
}

public class roadwalk{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int q = Integer.parseInt(sc.next());
        ArrayList<Event> e = new ArrayList<Event>();
        for(int i=0;i<n;i++){
            int s = Integer.parseInt(sc.next());
            int t = Integer.parseInt(sc.next());
            int x = Integer.parseInt(sc.next());
            e.add(new Event(s, 0, x));
            e.add(new Event(0, t, x));
        }
        Collections.sort(e);
        TreeSet<Integer> x = new TreeSet<Integer>();
        int people[] = new int[q];
        for(int i=0;i<q;i++){
            people[i] = Integer.parseInt(sc.next()); 
        }
        int time = e.get(n-1).time;
        int curp = 0;
        while(true){
            if(n==0){
                break;
            }
            Event a = e.get(n);
            if(time == a.time){
                if(a.kind == 1){
                    x.add(a.x);
                }else{
                    x.remove(a.x);
                }
                e.remove(0);
                n--;
                continue;
            }else{
                if(time == people[curp]){
                    Iterator<Integer> xi = x.iterator();
                    if(!xi.hasNext()){
                        System.out.println(-1);
                    }else{
                        System.out.println(xi.next());
                    }
                    curp++;
                }
                if(e.isEmpty()){
                    break;
                }
            }
            time++;
        }
        Iterator<Integer> xi = x.iterator();
        int remain = 0;
        if(!xi.hasNext()){
            remain = -1;
        }else{
            remain = xi.next();
        }
        while(curp<q){
            System.out.println(remain);
            curp++;
        }
        sc.close();
    }
}

Compiler output:
Main.java:25: error: class roadwalk is public, should be declared in a file named roadwalk.java
public class roadwalk{
       ^
1 error
Language: C++

#include <iostream>
#include<set>
#include <map>
#include <vector>
using namespace std;

int N, Q;
long long int S[200005], T[200005], X[200005];
long long int D[200005];

set<long long int> W;

map<long long int, int> MAP;

vector<long long int> PUSH[500005], POP[500005];

long long int LIMIT[500005];

long long int INF = 99999999999999;

int main(void) {

	cin >> N >> Q;

	for (int i = 1; i <= N; i++) {
		cin >> S[i] >> T[i] >> X[i];
	}

	for (int i = 1; i <= Q; i++) {
		cin >> D[i];
	}

	
	W.insert(-INF);
	W.insert(INF);
	for (int i = 1; i <= N; i++) {
		W.insert(S[i]-X[i]);
		W.insert(T[i]-X[i]);
	}

	int q = 1;
	/*for (auto y : W) {
		MAP[y] = q;
		q++;
	}


	for (int i = 1; i <= N; i++) {
		PUSH[MAP[S[i] - X[i]]].push_back(X[i]);
		POP[MAP[T[i] - X[i]]].push_back(X[i]);
	}


	int NUM = W.size();
	for (int i = 0; i <= NUM+1; i++) { LIMIT[i] = INF; }

	set<long long int> H;
	H.insert(INF);
	*/
/*	for (int i = 1; i <= NUM; i++) {
		for (int j = 0; j < (int)POP[i].size(); j++) {
			H.erase(POP[i][j]);
		}
		for (int j = 0; j < (int)PUSH[i].size(); j++) {
			H.insert(PUSH[i][j]);
		}

		auto it = H.begin();
		LIMIT[i] = (*it);
	}*/

	auto it = W.begin();
	for (int i = 1; i <= NUM; i++) {
		//cout << (*it)<<" " <<LIMIT[i] << endl;
		//it++;
	}


	for (int i = 1; i <= Q; i++) {
		if (W.count(D[i]) > 0) {
			it = W.find(D[i]);
			int y = distance(W.begin(), it)+1;
			//cout << "y= " << y << endl;
			if (LIMIT[y] == INF) {
				cout << -1 << endl;
			}
			else {
				cout << LIMIT[y] << endl;
			}
		}
		else {
			W.insert(D[i]);
			auto it = W.find(D[i]);
			it;
			int y = distance(W.begin(), it);
			if (LIMIT[y] == INF) {
				cout << -1 << endl;
			}
			else {
				cout << LIMIT[y] << endl;
			}
			W.erase(D[i]);
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:73:30: error: 'NUM' was not declared in this scope
   73 |         for (int i = 1; i <= NUM; i++) {
      |                              ^~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main(void){
int Q,N,tmp;


cin>>N>>Q;  //N????AQ??l??

vector<long> S(N),T(N),X(N),D(Q),Cnt(Q,-1);

for (int i=0; i<N; ++i){ //????
    cin>>S[i]>>T[i]>>X[i];
    }
    
    for (int i=0; i<Q; ++i){ //????
    cin>>D[i];
    }
    
    for(int i=0; i<Q; ++i){  //?l
      for(int j=0; j<N; ++j){ //?H??
      C=Cnt[i];
      long judge = X[j]+D[i];
      //cout<<"judge→"<<judge<<"i→"<<i<<"j→"<<j<<endl; //デバッグ用
        if(judge<T[j]&&judge>=S[j]){
        if(C>X[j]||C==-1)
        C= X[j];
        }
      }
      
    }
  
  for (int i=0; i<Q; ++i){ //????
    cout<<Cnt[i]<<endl;
    }

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:7: error: 'C' was not declared in this scope
   24 |       C=Cnt[i];
      |       ^
Language: C

#include<stdio.h>
int main() {
	int n;
	int q;
	int s[n];
	int t[n];
	int x[n];
	int d{ q };
	scanf("%d%d", &n, &q);
	for (int i = 0;i < n;i++) {
		scanf("%d%d%d", &s[i], &t[i], &x[i]);

	}
	scanf("%d", d);
	for (int i = 0;i < q;i++) {
		int v=10^9;
		for (int j = 0;j < n;j++) {
			
			if (x[j] > s[j] && x[j] < t[j]) {
				if (v > x[j]) {
					int v = x[j];
				}

			}
			printf("%d\n", v);
		}
	}

}


Compiler output:
main.c: In function 'main':
main.c:8:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    8 |         int d{ q };
      |              ^
main.c:8:17: error: expected ';' before '}' token
    8 |         int d{ q };
      |                 ^~
      |                 ;
main.c:14:21: error: 'd' undeclared (first use in this function)
   14 |         scanf("%d", d);
      |                     ^
main.c:14:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:25: warning: result of '10^9' is 3; did you mean '1e9'? [-Wxor-used-as-pow]
   16 |                 int v=10^9;
      |                         ^
      |                       ---
      |                       1e
main.c:16:23: note: you can silence this warning by using a hexadecimal constant (0xa rather than 10)
   16 |                 int v=10^9;
      |                       ^~
      |                       0xa
Language: C++

#include<bits/stdc++.h>
using namespace std;
int wa(int a, int b) {
  int k = (a + b) / 2;
  if ((a + b) % 2) k ++;
  return k;
}
int main () {
  int N, Q;
  cin >> N >> Q;
  vector<int>wor(N);
  vector<int>wos(N);
  vector<int>woe(N);
  for (int i = 0; i < N; i ++) cin >> wor[i] >> wos[i] >> woe[i];
  vector<int>hum(Q + 1);
  for (int i = 0; i < Q; i ++) cin >> hum[i];
  hum[Q] = 10000000000;
  vector<int>ans(Q, 10000000000);
  for (int i = 0; i < N; i ++) {
    int s, t
    int min = 0;
    int max = N + 1;
    while(min != max) {
      //wos[i] <= hum[j] を満たす最小のj
      int mid = (min + max) / 2;
      if (wos[i] > hum[mid]) max = mid - 1;
      else min = mid;
    }
    s = max;
    max = N + 1;
    while(min != max) {
      //woe[i] > hum[j]を満たす最大のj
      int mid = wa(min, max);
      if (woe[i] > hum[j]) max = mid;
      else min = mid + 1;
    }
    t = min;
    for (int j = s; j <= t; j ++) {
      if (ans[j] > wor[i]) ans[j] = wor[i];
    }
  }
  for (int i = 0; i < Q; i ++) {
    if (ans[i] < 10000000000) cout << ans[i] << endl;
    else cout << -1 << endl;
  }
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:17:12: warning: overflow in conversion from 'long int' to '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} changes value from '10000000000' to '1410065408' [-Woverflow]
   17 |   hum[Q] = 10000000000;
      |            ^~~~~~~~~~~
a.cc:18:21: warning: overflow in conversion from 'long int' to 'std::vector<int>::value_type' {aka 'int'} changes value from '10000000000' to '1410065408' [-Woverflow]
   18 |   vector<int>ans(Q, 10000000000);
      |                     ^~~~~~~~~~~
a.cc:21:5: error: expected initializer before 'int'
   21 |     int min = 0;
      |     ^~~
a.cc:23:15: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator!='
   23 |     while(min != max) {
      |           ~~~~^~~~~~
a.cc:25:22: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+'
   25 |       int mid = (min + max) / 2;
      |                  ~~~~^~~~~
a.cc:27:18: error: overloaded function with no contextual type information
   27 |       else min = mid;
      |                  ^~~
a.cc:31:15: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator!='
   31 |     while(min != max) {
      |           ~~~~^~~~~~
a.cc:33:19: error: cannot resolve overloaded function 'min' based on conversion to type 'int'
   33 |       int mid = wa(min, max);
      |                 ~~^~~~~~~~~~
a.cc:34:24: error: 'j' was not declared in this scope
   34 |       if (woe[i] > hum[j]) max = mid;
      |                        ^
a.cc:35:24: error: overloaded function with no contextual type information
   35 |       else min = mid + 1;
      |                        ^
a.cc:37:5: error: 't' was not declared in this scope
   37 |     t = min;
      |     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
const int INF = (int) 1e9;
const ll LINF = (ll) 4e18;
using pll = pair<ll, ll>;
#define REP(i,m,n) for(ll i = m; i < (ll)(n); ++i)
#define rep(i,n) REP(i, 0, n)
#define all(v) v.begin(), v.end()

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n, q;
    cin >> n >> q;
    vector<pair<ll, pll> > kouzi(n);
    vector<pll> person(q);
    ll ans[200010];
    rep(i, q) ans[i] = -1;

    rep(i, n) {
        cin >> kouzi[i].second.first >> kouzi[i].second.second >> kouzi[i].first;
    }

    rep(i, q) {
        cin >> person[i].first;
        person[i].second = i;
    }

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

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

    rep(i, n) {
        auto itr1 = lower_bound(all(person), make_pair(kouzi[i].second.first - kouzi[i].first, -LINF));
        auto itr2 = upper_bound(all(person), make_pair(kouzi[i].second.second - kouzi[i].first - 1, LINF));
        for (auto itr = itr1; itr != itr2; itr++) {
            if (ans[(*itr).second] >= 0) continue;
            ans[(*itr).second] = x;
        }
    }
    rep(i, q) cout << ans[i] << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:34: error: 'x' was not declared in this scope
   40 |             ans[(*itr).second] = x;
      |                                  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
const int INF = (int) 1e9;
const ll LINF = (ll) 4e18;
using pll = pair<ll, ll>;
#define REP(i,m,n) for(ll i = m; i < (ll)(n); ++i)
#define rep(i,n) REP(i, 0, n)
#define all(v) v.begin(), v.end()

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n, q;
    cin >> n >> q;
    vector<pair<ll, pll> > kouzi(n);
    vector<pll> person(q);
    ll ans[200010];
    rep(i, q) ans[i] = -1;

    rep(i, n) {
        cin >> kouzi[i].second.first >> kouzi[i].second.second >> kouzi[i].first;
    }

    rep(i, q) {
        cin >> person[i].first;
        person[i].second = i;
    }

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

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

    rep(i, n) {
        auto itr1 = lower_bound(all(person), MP(kouzi[i].second.first - kouzi[i].first, -LINF));
        auto itr2 = upper_bound(all(person), MP(kouzi[i].second.second - kouzi[i].first - 1, LINF));
        for (auto itr = itr1; itr != itr2; itr++) {
            if (ans[(*itr).second] >= 0) continue;
            ans[(*itr).second] = x;
        }
    }
    rep(i, q) cout << ans[i] << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:46: error: 'MP' was not declared in this scope
   36 |         auto itr1 = lower_bound(all(person), MP(kouzi[i].second.first - kouzi[i].first, -LINF));
      |                                              ^~
a.cc:40:34: error: 'x' was not declared in this scope
   40 |             ans[(*itr).second] = x;
      |                                  ^
Language: C++

#include <iostream>
#include <algorithm>
#include <queue>
#include <tuple>
#include <stack>
#include <climits>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#define INF INT_MAX>>1 //要climits#includ

typedef long long ll;

using namespace std;

static int a[10000000001];

int main(void){
	int n, q; cin >> n >> q;
	fill(a, a+10000000001, INF);
	static int s, t, x;
	for(int i=0; i<n; i++){
		cin >> s >> t >> x;
		int j=max(0, s-x);
		while(1){
			if(j == t-x) break;
			a[j] = min(a[j], x);
			j++;
		}
	}
	static int d;
	for(int i=0; i<q; i++){
		cin >> d;
		if(a[d] == INF) cout << -1 << endl;
		else cout << a[d] << endl;
	}
}

Compiler output:
/tmp/ccNsX9Oz.o: in function `main':
a.cc:(.text+0x71): relocation truncated to fit: R_X86_64_PC32 against `.bss'
a.cc:(.text+0x8d): relocation truncated to fit: R_X86_64_PC32 against `.bss'
a.cc:(.text+0xa2): relocation truncated to fit: R_X86_64_PC32 against `.bss'
a.cc:(.text+0xb3): relocation truncated to fit: R_X86_64_PC32 against `.bss'
a.cc:(.text+0xb9): relocation truncated to fit: R_X86_64_PC32 against `.bss'
a.cc:(.text+0xe3): relocation truncated to fit: R_X86_64_PC32 against `.bss'
a.cc:(.text+0xe9): relocation truncated to fit: R_X86_64_PC32 against `.bss'
a.cc:(.text+0x10e): relocation truncated to fit: R_X86_64_PC32 against `.bss'
a.cc:(.text+0x15d): relocation truncated to fit: R_X86_64_PC32 against `.bss'
a.cc:(.text+0x175): relocation truncated to fit: R_X86_64_PC32 against `.bss'
a.cc:(.text+0x1be): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

//ライブラリ
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <map>
#include <numeric>
#include <cmath>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <complex>
#include <string.h>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <iomanip>
#include <sys/time.h>
#include <tuple>
#include <random>
#include <functional>
using namespace std;

//ユーティリティ
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define reps(i,n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
#define rrep(i,n) for(int i=n-1; i>=0; --i)
#define rreps(i,n) for(int i=n; i>0; --i)
#define vmax(v) *max_element(all(v))
#define vmin(v) *min_element(all(v))
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define uniq(v) (v).erase(unique((v).begin(), (v).end()), (v).end())

template<class T>bool chmax(T &former, const T &b) {if (former<b) {former=b;return true;} return false;}
template<class T>bool chmin(T &former, const T &b) {if (former>b) {former=b;return true;} return false;}

//型
typedef long long unsigned int ll;

//定数
const ll inf = (1e9+9);
const double pi = (acos(-1));
const ll mod = 1e9 + 7;
const double eps = 1e-8;

//セグメント木
//データ構造
template< typename Monoid >
struct SegmentTree {
  using F = function< Monoid(Monoid, Monoid) >;
 
  int sz;
  vector< Monoid > seg;
 
  const F f;
  const Monoid M1;
 
  SegmentTree(int n, const F f, const Monoid &M1) : f(f), M1(M1) {
    sz = 1;
    while(sz < n) sz <<= 1;
    seg.assign(2 * sz, M1);
  }
 
  void set(int k, const Monoid &x) {
    seg[k + sz] = x;
  }
 
  void build() {
    for(int k = sz - 1; k > 0; k--) {
      seg[k] = f(seg[2 * k + 0], seg[2 * k + 1]);
    }
  }
 
  void update(int k, const Monoid &x) {
    k += sz;
    seg[k] = x;
    while(k >>= 1) {
      seg[k] = f(seg[2 * k + 0], seg[2 * k + 1]);
    }
  }
 
  Monoid query(int a, int b) {
    Monoid L = M1, R = M1;
    for(a += sz, b += sz; a < b; a >>= 1, b >>= 1) {
      if(a & 1) L = f(L, seg[a++]);
      if(b & 1) R = f(seg[--b], R);
    }
    return f(L, R);
  }
 
  Monoid operator[](const int &k) const {
    return seg[k + sz];
  }
};


int table[inf];
int N, Q;

void input() {
	cin >> N >> Q;
	rep(i, N) {
		int l,r,v;
		cin >> l >> r >> v;
		cin.ignore();
		for(int j=l; j<r; j++) {
			if(j-v<0) continue;
			table[j-v] = v;
		}
	}
	rep(i,Q) {
		int d;
		cin >> d;
		cin.ignore();
		cout << table[d];
	}
}

void solve() {
	//rep()
}

int main() {
	input();
	//cout << solve() << endl;
}	


Compiler output:
/tmp/ccyGFXc9.o: in function `input()':
a.cc:(.text+0xb): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/ccyGFXc9.o
a.cc:(.text+0x27): relocation truncated to fit: R_X86_64_PC32 against symbol `Q' defined in .bss section in /tmp/ccyGFXc9.o
a.cc:(.text+0x3f): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/ccyGFXc9.o
a.cc:(.text+0xf0): relocation truncated to fit: R_X86_64_PC32 against symbol `Q' defined in .bss section in /tmp/ccyGFXc9.o
collect2: error: ld returned 1 exit status