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

#include<iostream>
#include<vector>
using namespace std;
#define INF 1e15

typedef struct{
    int l;
    int r;
    int c;
} path;

bool comp(const path &a,const path &b){
    return (a.l) < (b.l);
}



int main(){
    int N, M; 
    cin >> N >> M;

    vector<path> P;

    for(int i=0; i <M; i++){
        int l, r, c;
        cin >> l >> r >> c;
        P.push_back((path){l-1, r-1, c});
    }

    sort(P.begin(), P.end(), comp);
    for(int i=0; i<M; i++){
        cout << P[i].l << endl;
    }

    long dp[N];
    for(int i=0; i<M; i++){
        dp[i] = INF;
    }
    dp[0] = 0;
    int top = 0;

    for(int i=0; i<M; i++){
        if(top < P[i].l){
            cout << -1 << endl;
            return 0;
        }
        else{
            for(int j = P[i].l ; j <= P[i].r; j++){
                dp[j] = min(dp[j], dp[P[i].l] + P[i].c);
            }
        }
    }
    if(dp[N-1]== INF) cout << -1 << endl;
    cout << dp[N-1] << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   30 |     sort(P.begin(), P.end(), comp);
      |     ^~~~
      |     short
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
int main(){
    ll n,m,L[200001],R[200001],C[200001].B[200001];
    cin>>n>>m;
    rep(i,m) cin>>L[i]>>R[i]>>C[i];
    ll ans=0;
    vector<pair<ll,ll>> A;
    rep(i,m) A.push_back(make_pair(R[i],i));
    sort(A.begin(),A.end());
    rep(i,m) B[i]=A[i].second;
    ll a=1,b=1e9,c,ans=0;
    rep(i,m){
        if(L[B[i]]>a){cout<<-1;return 0;}
        if(b>C[B[i]]) c=B[i],b=C[B[i]];
        if(i<m-1&&L[B[i+1]]>a){
            ans+=b,a=R[B[i]],b=1e9;
        }
    }
    cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:41: error: expected initializer before '.' token
    6 |     ll n,m,L[200001],R[200001],C[200001].B[200001];
      |                                         ^
a.cc:8:31: error: 'C' was not declared in this scope
    8 |     rep(i,m) cin>>L[i]>>R[i]>>C[i];
      |                               ^
a.cc:13:14: error: 'B' was not declared in this scope
   13 |     rep(i,m) B[i]=A[i].second;
      |              ^
a.cc:14:20: error: redeclaration of 'll ans'
   14 |     ll a=1,b=1e9,c,ans=0;
      |                    ^~~
a.cc:9:8: note: 'll ans' previously declared here
    9 |     ll ans=0;
      |        ^~~
a.cc:16:14: error: 'B' was not declared in this scope
   16 |         if(L[B[i]]>a){cout<<-1;return 0;}
      |              ^
a.cc:17:14: error: 'C' was not declared in this scope
   17 |         if(b>C[B[i]]) c=B[i],b=C[B[i]];
      |              ^
a.cc:17:16: error: 'B' was not declared in this scope
   17 |         if(b>C[B[i]]) c=B[i],b=C[B[i]];
      |                ^
a.cc:18:21: error: 'B' was not declared in this scope
   18 |         if(i<m-1&&L[B[i+1]]>a){
      |                     ^
Language: C++

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

using i64 = int64_t;

constexpr i64 INF = 1e17;

struct Node{
    i64 l, r, c;
    bool operator<(const Node &obj)const{
        if(l == obj.l)return r < obj.r;
        return l < obj.l;
    }
};

struct State{
    i64 num, cost;
    bool operator<(const State &obj)const{
        return cost > obj.cost;
    }
};

int main(){
    int n, m;
    cin >> n >> m;
    vector<Node> v;
    v.push_back({0, 1, 0});
    for(int i=0;i<m;++i){
        i64 l, r, c;
        cin >> l >> r >> c;
        v.push_back({l, r, c});
    }
    sort(v.begin(), v.end());
    vector<i64> mini(m+1, INF);
    mini[0] = 0;
    priority_queue<State> que;
    que.push({0, 0});
    while(!que.empty()){
        auto cur = que.top(); que.pop();
        if(v[cur.num].r < rmax)continue;
        rmax = cur.num;
        //cout << cur.num << " " << cur.cost << endl;
        if(v[cur.num].r == n){
            cout << cur.cost << endl;
            return 0;
        }
        for(int i=cur.num+1;i<=m;++i){
            if(v[i].l > v[cur.num].r)break;
            if(v[i].l == v[cur.num].l)continue;
            i64 new_cost = cur.cost + v[i].c;
            if(new_cost >= mini[i])continue;
            mini[i] = new_cost;
            que.push({i, new_cost});
        }
    }
    cout << -1 << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:27: error: 'rmax' was not declared in this scope; did you mean 'fmax'?
   40 |         if(v[cur.num].r < rmax)continue;
      |                           ^~~~
      |                           fmax
a.cc:41:9: error: 'rmax' was not declared in this scope; did you mean 'fmax'?
   41 |         rmax = cur.num;
      |         ^~~~
      |         fmax
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include<cstdlib>
#include<map>
#include<iomanip>
#include<sstream>
#include<vector>
#include<stack>
#include<math.h>
#include<queue>
#include<complex>
#include<random>
#include<ctime>
#include<set>
using namespace std;

const long long int mod=998244353;
const long long int INF=99999999999999999;

long long int n,m,sum=0,res=0;
long long int L[200000],R[200000],C[200000],value[2000000]={};
pair<pair<long long int,long long int>,long long int >LRC[200005];

typedef pair<pair<long long int,long long int>,long long int >three;

set<long long int>se;

bool cmp(three A,three B){
    if(A.first.first!=B.first.first){return A.first.first<B.first.first;}
    else{return A.second<B.second;}
}
int main() {
	cout << fixed << setprecision(10);
    cin>>n>>m;
    for(int i=0;i<m;i++){
        cin>>LRC[i].first.first>>LRC[i].first.second>>LRC[i].second;
    }
    sort(LRC,LRC+m,cmp);
    se.insert(1000000);
    value[1000000]=INF;
    if(LRC[0].first.first!=1){cout<<-1<<endl;}
    else{se.insert(LRC[0].first.second);value[LRC[0].first.second]=LRC[0].second;}
    for(int i=1;i<m;i++){
        if(*se.lower_bound(LRC[i].first.first)==1000000){
            cout<<-1<<endl;
            return 0;
        }else{
            if(value[*se.lower_bound(LRC[i].first.first)]+LCR[i].second<value[*se.lower_bound(LRC[i].first.second)]){
                se.insert(LRC[i].first.second);
                value[LRC[i].first.second]=value[*se.lower_bound(LRC[i].first.first)]+LCR[i].second;
            }
        }
        
    }
    cout<<value[n];
} 


Compiler output:
a.cc: In function 'int main()':
a.cc:49:59: error: 'LCR' was not declared in this scope; did you mean 'LRC'?
   49 |             if(value[*se.lower_bound(LRC[i].first.first)]+LCR[i].second<value[*se.lower_bound(LRC[i].first.second)]){
      |                                                           ^~~
      |                                                           LRC
Language: C++

#include <bits/stdc++.h>
#include <unistd.h>
using namespace std;
typedef long long int lli;
typedef pair<lli, lli> pii;
#define dbg(x) cout << #x << " has a value of: " << x << "\n";
#define usize(x) (int)(x.size())
#define plist(x)                       \
    for (int i = 0; i < usize(x); i++) \
        cout << "eleman " << i << " = " << x[i] << "\n";
#define foreach(x) for (auto item : x)
#define fill(s, x)              \
    for (int i = 0; i < x; i++) \
        cin >> s[i];
#define in(veriler, a) (veriler.find(a) != veriler.end())
#define btw(x, y, z) x >= y&& x <= z;
std::ostream& operator<<(std::ostream& os, pair<int,int> p) {
    os << p.first << ", " << p.second;
    return os;
}
#ifdef ONLINE_JUDGE
#define fio ios_base::sync_with_stdio(false);cin.tie(null);
#else
#define fio //a
#endif
class SegmentTree{
	public:
	int n;
	bool isLazy;
	private:
	vector<lli> segTree,lazy;
	public:
	SegmentTree(){}
	SegmentTree(int n){
		segTree=vector<lli>(4*n);
		lazy=vector<lli>(4*n);
	}
	void buildTree(int node,int l,int r,vector<lli>& anaDizi){
		if(l>r)return;
		if(l==r)segTree[node]=anaDizi[l];
		else{
			buildTree(node*2,l,(l+r)/2,anaDizi);
			buildTree(node*2+1,(l+r)/2+1,r,anaDizi);
			segTree[node]=min(segTree[node*2],segTree[node*2+1]);
		}
	}
	void updateTree(int node,int a,int b,int ind,lli x){
		if(a>b)return;
		if(a>ind ||b<ind)return;
		if(a==b&&a==ind){
			segTree[node]=x;
			return;
		}
		updateTree(node*2,a,(a+b)/2,ind,x);
		updateTree(node*2+1,(a+b)/2+1,b,ind,x);
		segTree[node]=min(segTree[node*2],segTree[node*2+1]);
	}
	lli query(int node,int a,int b,int l,int r){
		if(l>r)return 1e17;
		if(a>b||a>r||b<l)return 1e17;
		if(lazy[node]!=0){
			segTree[node]+=lazy[node]*(b-a+1);
			lazy[node*2]+=lazy[node];
			lazy[node*2+1]+=lazy[node];
			lazy[node]=0;
		}
		if(a>=l&&b<=r)return segTree[node];
		return min(query(node*2,a,(a+b)/2,l,r),
		query(node*2+1,(a+b)/2+1,b,l,r));
		
	}
};
typedef pair<lli,pii> psi;
int main(){
	ios_base::sync_with_stdio(false);cin.tie(null);
	int n,m;
	cin>>n>>m;
	vector<psi> aras;
	for (int i = 0; i < m; i++)
	{
		lli a,b,cost;
		cin>>a>>b>>cost;
		aras.push_back(psi(a,pii(cost,b)));
	}
	sort(aras.begin(),aras.end());
	vector<lli> dist(n+1,1e17);
	dist[1]=0;
	SegmentTree st(n+1);
	st.buildTree(1,1,n,dist);
	lli last=1;
	for (int i = 0; i < m; i++)
	{
		lli cost=aras[i].second.first;
		lli a=aras[i].first,b=aras[i].second.second;
		//dbg(cost);
		for (lli smd = min(last+1,a); smd <= b; smd++)
		{
			//dbg(smd);
			//dbg(a);
			//dbg(st.query(1,1,n,a,smd-1));
			dist[smd]=min(dist[smd],st.query(1,1,n,a,smd-1)+cost);
			//dbg(dist[smd]);
			if(dist[smd]!=1e17)last=smd;
			else break;
			st.updateTree(1,1,n,smd,dist[smd]);
		}
		
	}
	cout<<(dist[n]==1e17?-1:dist[n])<<"\n";
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:75:50: error: 'null' was not declared in this scope
   75 |         ios_base::sync_with_stdio(false);cin.tie(null);
      |                                                  ^~~~
Language: C++


#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <queue>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

// rep(i, 100) { cout << i << endl; } => 0 1 2 ... 99
#define rep(i, n) for(int i = 0, i##_len = (n); i < (int)n; i++)

// std::sort(all(v));
#define all(x) (x).begin(), (x).end()

// long long int
using ll = long long;

// utility to cast return value of size function to int
#define SZ(x) ((int)(x).size())

// VS defines "_DEBUG" macro when debug configuration.
#if _DEBUG
#define dump(x) cerr << #x << " = " << (x) << endl
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl
#else
#define dump(x)
#define debug(x)
#endif

// update max
template<class T>bool chmax(T & prov, const T & cur)
{
	if (cur > prov)
	{
		prov = cur;
		return true;
	}
	return false;
}

// update min
template<class T>bool chmin(T & prov, const T & cur)
{
	if (cur < prov)
	{
		prov = cur;
		return true;
	}
	return false;
}

/*
int alter(vector<pair<int, int>> & memo, int k, int r, int c)
{
	if (memo[k].second == -1)
	{
		// コスト
		memo[k].first = c;
		// 行き先
		memo[k].second = r;
	}
	else
	{
		// すでに圧縮済み
		if (memo[k].second < r)
		{
			// 手前なので意味がない
		}
		else if (memo[k].second == r)
		{
			// コスト勝負
			chmin(memo[k].first, c);
		}
		else
		{
			alter(memo[k].first, c);
		}
	}
}
*/

ll ans = INT_MAX;
bool is_found = false;
int dst = -1;

void calc(const vector<vector<pair<int, int>>> & memo, int cur, ll cost)
{
	if (ans <= cost) { return; }

	if (cur == dst)
	{
		ans = cost;
		is_found = true;
	}

	for (auto && root : memo[cur])
	{
		calc(memo, root.second, root.first + cost);
	}
}

int main()
{
	int N, M;
	cin >> N >> M;

	vector<int> L(M);
	vector<int> R(M);
	vector<int> C(M);

	vector<vector<pair<int, int>>> memo(N);

	for (int i = 0; i < M; i++)
	{
		int l, r, c;
		cin >> l >> r >> c;
		L[i] = l - 1;
		R[i] = r - 1;
		C[i] = c;

		for (int k = L[i]; k < R[i]; k++)
		{
			memo[k].push_back(pair<int, int>(c, R[i]));
		}
	}

	dst = N - 1;
	calc(memo, 0, 0);

	if (is_found)
	{
		cout << ans << endl;
	}
	else
	{
		cout << -1 << endl;
	}
	return 0;
}


Compiler output:
a.cc:86:10: error: 'INT_MAX' was not declared in this scope
   86 | ll ans = INT_MAX;
      |          ^~~~~~~
a.cc:7:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    6 | #include <queue>
  +++ |+#include <climits>
    7 | #include <string>
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,n) for(long long i=0;i<n;++i)
#define REPP(i,m,n) for(long long i=m;i<n;++i)
#define rep(i,n) for(long long i = n-1;i>=0;--i)
#define repp(i,n,m) for(long long i = n-1; i >= m; --i)
#define ALL(N) (N.begin(),N.end())
#define de cout << "line : " << __LINE__ << " debug" << endl;
#define pb push_back
#define pq priority_queue
#define Dcout(N) cout << setprecision(20) << N << endl
#define fi first
#define se second
constexpr int INF = 2147483647;
constexpr long long INFF = 9223372036854775807;
signed main() {
    cin.tie(0);
	ios::sync_with_stdio(false);
    int N,M;cin >> N >> M;
    vector<pair<ll,pair<ll,ll>>> V;ll A,B,C;
    REP(i,M){
        cin >> A >> B >> C;--A;--B;
        V.pb({A,{C,B}});
        //cin >> V[i].fi >> V[i].second.second >> V[i].second.first >> endl;
        //--V[i].fi;--V[i].se.fi;
        //Vにはfrom cost to
    }
    sort ALL(V);
    ll dp[N];REP(i,N) dp[i] = INF;
    dp[0] = 0;
    if(V[0].fi != 0){
        cout << -1 << endl;
        return 0;
    }
  bool flag[N] = {};
    REPP(i,V[0].fi + 1,V[0].se.se + 1){dp[i] = V[0].se.fi;flag = 1;}
    REPP(i,1,M){
        if(V[i].fi == V[i-1].fi){
            REPP(j,V[i-1].se.se + 1,V[i].se.se + 1){
                ll A = V[i].fi,B = V[i].se.fi;
                dp[j] = min(dp[j],B);
            	flag[j] = 1;
            }
        }
        else{
            REPP(j,V[i].fi+1,V[i].se.se + 1){
                int A = V[i].fi,B = V[i].se.fi;
                dp[j] = min(dp[j],dp[A] + B);
            	flag[j] = 1;
            }
        }
    }
    REP(i,N){
        if(!flag[i]){
            cout << -1 << endl;
            return 0;
        }
    }
    if(dp[N-1] != INF) cout << dp[N-1] << endl;
    else cout << -1 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:64: error: incompatible types in assignment of 'int' to 'bool [N]'
   37 |     REPP(i,V[0].fi + 1,V[0].se.se + 1){dp[i] = V[0].se.fi;flag = 1;}
      |                                                           ~~~~~^~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

const int N = 1e5+7;

struct Node
{
    int l, r;
    long long c;
    friend operator < (const Node &x, const Node &y) {
        if (x.c != y.c) return x.c < y.c;
        return x.r > y.r;
    }
} a[N];

int n, m;
long long dis[N];
set<Node> s;

bool cmpl(const Node &x, const Node &y) { return x.l < y.l; }

int main()
{
    cin >> n >> m;
    for (int i = 1; i <= m; ++i) {
        cin >> a[i].l >> a[i].r >> a[i].c;
    }
    sort(a+1, a+m+1, cmpl);
    memset(dis, -1, sizeof dis);
    dis[1] = 0;
    for (int i = 1, p = 1; i <= n; ++i) {
        while (s.size() && s.begin()->r < i) s.erase(s.begin());
        if (i > 1) {
            if (s.empty()) break;
            dis[i] = s.begin()->c;
        }
        for ( ;p <= m && a[p].l <= i; ++p) {
            a[p].c += dis[i];
            while (s.size() && s.rbegin()->c >= a[p].c && s.rbegin()->r <= a[p].r)
                s.erase((--s.end()));
            if (s.size() && s.rbegin()-> c <= a[p].c && s.rbegin()->r >= a[p].r)
                continue;
            s.insert(a[p]);
        }
    }
    cout << dis[n] << endl;
    return 0;
}


Compiler output:
a.cc:11:12: error: ISO C++ forbids declaration of 'operator<' with no type [-fpermissive]
   11 |     friend operator < (const Node &x, const Node &y) {
      |            ^~~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(void)
{
  int N,M;
  vector<tuple<int,long long,int>> R;
  int amax=0;
  for(int i=0;i<N;i++){
    int a,b;
    long long c;
    cin>>a>>b>>c;
    R.emplace_back(a-1,c,b-1);
  }

  sort(R.begin(),R.end());
/*
  vector<long long> Tb(N,-1);
  Tb[0]=0;
  for(int i=0;i<R.size();i++){
    int a = get<0>R[i];
    long long c = get<1>R[i];
    int b = get<2> R[i];
    for(int j=a+1;j<=b;j++){
      if(Tb[j]==-1 || Tb[j]>Tb[a]+c){
        Tb[j] = Tb[a]+c;
      }
    }
  }
*/
  cout << Tb[N-1] << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:11: error: 'Tb' was not declared in this scope
   32 |   cout << Tb[N-1] << endl;
      |           ^~
Language: Java

import heapq

n, m = [int(v) for v in input().split(' ')]

costs = []
links = []
for i in range(n):
    costs.append([0] * i)
    links.append(set())

for i in range(m):
    l, r, c = [int(v) for v in input().split(' ')]
    l -= 1
    r -= 1

    for j in range(l, r):
        for k in range(j + 1, r + 1):
            c0 = costs[k][j]
            if c0 == 0 or c0 > c:
                costs[k][j] = c
                links[k].add(j)


h = []
heapq.heappush(h, (0, n-1))
closed = n
while len(h) > 0:
    c0, n0 = heapq.heappop(h)
    if closed <= n0:
        continue
    closed = n0
    if n0 == 0:
        print(c0)
        exit()

    for n1 in links[n0]:
        c1 = costs[n0][n1]
        heapq.heappush(h, (c0 + c1, n1))

print("-1")



Compiler output:
Main.java:1: error: '.' expected
import heapq
            ^
Main.java:3: error: ';' expected
n, m = [int(v) for v in input().split(' ')]
 ^
2 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
const long long INF = 1000000009;
long long d[100000][100000];
int n,m;

void warshall_floyd(){
    for(int k=0;k<n;k++){
        for(int i=0;i<n;i++){
            for(int j=0;j<n;j++)d[i][j] = min(d[i][j],d[i][k]+d[k][j]);
        }
    }
    if(d[0][n-1]==INF)cout<<"-1"<<endl;
    else cout<<d[0][n-1]<<endl;
    return;
}

int main(){
    cin>>n>>m;
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            d[i][j] = INF;
        }
    }
    for(int i=0;i<m;i++){
        int l,r;
        long long c;cin>>l>>r>>c;
        l--;r--;
        for(int j=l;j<r;j++){
            for(int k=l+1;k<=r;k++){
                d[j][k] = min(c,d[j][k]);
                d[k][j] = min(c,d[k][j]);
            }
        }
    }
    warshall_floyd();
}


Compiler output:
/tmp/cc6WwRC2.o: in function `warshall_floyd()':
a.cc:(.text+0xeb): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc6WwRC2.o
a.cc:(.text+0xfe): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc6WwRC2.o
a.cc:(.text+0x111): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc6WwRC2.o
a.cc:(.text+0x120): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc6WwRC2.o
a.cc:(.text+0x173): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc6WwRC2.o
/tmp/cc6WwRC2.o: in function `main':
a.cc:(.text+0x1c1): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc6WwRC2.o
a.cc:(.text+0x1dd): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/cc6WwRC2.o
a.cc:(.text+0x230): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc6WwRC2.o
a.cc:(.text+0x23f): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc6WwRC2.o
a.cc:(.text+0x3a3): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/cc6WwRC2.o
collect2: error: ld returned 1 exit status
Language: C++

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

using pii = pair<int,int>;
using ll = long long;
#define rep(i, j) for(int i=0; i < (int)(j); i++)
#define repeat(i, j, k) for(int i = (j); i < (int)(k); i++)
#define all(v) v.begin(),v.end()
#define debug(x) cerr << #x << " : " << x << endl

template<class T> bool set_min(T &a, const T &b) { return a > b  ? a = b, true : false; }
template<class T> bool set_max(T &a, const T &b) { return a < b  ? a = b, true : false; }
// vector
template<class T> istream& operator >> (istream &is , vector<T> &v) { for(T &a : v) is >> a; return is; }
template<class T> ostream& operator << (ostream &os , const vector<T> &v) { for(const T &t : v) os << "\t" << t; return os << endl; }
// pair
template<class T, class U> ostream& operator << (ostream &os , const pair<T, U> &v) { return os << "<" << v.first << ", " << v.second << ">"; }

const int INF = 1 << 30;
const ll INFL = 1LL << 60;
using pli = pair<ll, int>;
class Solver {
  public:
    bool solve() {
        int N, M; cin >> N >> M;
        map<int, vector<pii>> LRC;
        rep(i, M) {
            int l, r; ll c; cin >> l >> r >> c;
            l--; r--;
            LRC[l].push_back(pii(r, c));
        }
        priority_queue<pli, vector<pli>, greater<pli>> que;
        bool fail = false;
        for(pii p : LRC[0]) {
            que.push(pli(p.second, p.first));
        }
        repeat(i, 1, N-1) {


            if(not LRC.count(i)) continue;
            while(que.size() and que.top().second < i) {
                que.pop();
            }
            if(que.size() == 0) {
                fail = true;
                break;
            }
            ll now = que.top().first;
            for(pii p : LRC[i]) {
                que.push(pli(now + p.second, p.first));
            }
        }
        while(que.size() and que.top().second < N-1) {
            que.pop();
        }
        if(fail or que.size() == 0) cout << -1 << endl;
        else cout << que.top().first << endl;
        return 0;
    }
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    Solver s;
    s.solve();
    return 0;
}
~/D/P

Compiler output:
a.cc:69:2: error: expected class-name before '/' token
   69 | ~/D/P
      |  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
/*{{{*/  //template
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
constexpr int INF = numeric_limits<int>::max()/2;
constexpr long long LINF = numeric_limits<long long>::max()/3;
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define sz(x) (int)(x).size()
#define debug(x) cerr<<#x<<":"<<x<<endl
#define debug2(x,y) cerr<<#x<<","<<#y":"<<x<<","<<y<<endl
//struct fin{ fin(){ cin.tie(0); ios::sync_with_stdio(false); } } fin_;
struct Double{ double d; explicit Double(double x) : d(x){} };
ostream& operator<<(ostream& os,const Double x){ os << fixed << setprecision(20) << x.d; return os; }
template<typename T> ostream& operator<<(ostream& os,const vector<T>& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; }
template<typename T,typename U> ostream& operator<<(ostream& os, const map<T,U>& mp){ os << "{"; for(auto& p : mp){ os << p << ","; } os << "}"; return os; }
template<typename T,typename U> ostream& operator<<(ostream& os,const pair<T,U>& p){ os << "(" << p.first << ","<< p.second <<")"; return os; }
template<typename T> ostream& operator<<(ostream& os,const set<T>& st){ os<<"{"; for(T v:st) os<<v<<","; os <<"}"; return os; }
template<typename T,typename U> inline void chmax(T &x,U y){ if(y>x) x = y; }
template<typename T,typename U> inline void chmin(T &x,U y){ if(y<x) x = y; }
using ll = long long;
using ull = unsigned long long;
using pii = std::pair<int,int>;
using vi = std::vector<int>;
typedef vector<vi> vvi;
ll gcd(ll a,ll b){ if(b==0) return a; else return gcd(b,a%b); }
constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); }
//constexpr double eps = 1e-14; 
constexpr double eps = 1e-10; 
constexpr ll mod = 1e9+7;
const int dx[]={1,0,-1,0} ,dy[] = {0,1,0,-1};
/*}}}*/


int main(){
    int n,m; cin >> n >> m;
    set<int> stl,str;
    vector<tuple<int,int,ll>> v;
    st.insert(0);
    st.insert(n-1);
    rep(i,m){
        int l,r; cin >> l >> r; l--;r--;
        ll c; cin >> c;
        stl.insert(l);
        str.insert(r);
        v.emplace_back(l,r,c);
    }

    vector<vector<pair<int,ll>>> G(n);
    for(auto& t : v){
        int l,r; ll c;
        tie(l,r,c) = t;
        auto si = str.upper_bound(l);
        auto se = str.upper_bound(r);
        for(auto iter = si; iter!=se ; iter++){
            G[l].emplace_back(*iter,c);
        }
    }

    /* rep(i,n){ */
    /*     cout << G[i] << endl; */
    /* } */

    vector<ll> dp(n,LINF);
    dp[0] = 0;
    for(int i=0;i<n-1;i++){
        for(auto& p : G[i]){
            int v = p.first;
            ll c = p.second;
            dp[v] = min(dp[v],dp[i]+c);
        }
    }
    if(dp[n-1]==LINF){
        cout << -1 << endl;
        return 0;
    }
    //cerr << dp << endl;
    cout << dp[n-1] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:5: error: 'st' was not declared in this scope; did you mean 'str'?
   43 |     st.insert(0);
      |     ^~
      |     str
Language: C++

#include <iostream>
#include <vector>
#include <string.h>
#include <set>
#include <map>
#include <assert.h>
#include <algorithm>
#include <queue>
#include <bitset>
#include <stack>
#include <chrono>
#include <random>
#define all(x) x.begin(),x.end()
#define ff first
#define ss second
#define ll long long
#define MOD 1000000007 
#define INF 1000000000000000000
#define uid uniform_int_distribution <int>
#define rnd mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define FIO ios_base::sync_with_stdio(false); cin.tie(NULL);
using namespace std;
// Read the question carefully and see all the given sample tests
// Think about the correctness before implementing

int main()
{
	int n, m;
	cin >> n >> m;
	vector <pair<int, pair<int, int>>> v[n + 1];
	for (int i = 0; i < m; i++)
	{
		int x, y, c;
		cin >> x >> y >> c;
		v[x].push_back({-c, {x, y}});
	}
	priority_queue <pair<int, pair<int, int>>> pq;
	for (auto g : v[1])
	{
		pq.push(g);
	}
	vector <ll> ans(n + 1, INF);
	ans[1] = 0;
	int p = 2;
	while(!pq.empty())
	{
		int cost = -pq.top().ff;
		int l = pq.top().ss.ff;
		int r = pq.top().ss.ss;
		pq.pop();
		while(p <= r)
		{
			ans[p] = ans[l] + cost;
			for (auto g : v[p])
			{ 
				pq.push(g);
			}
			p++;
		}
	}
	if(ans[n] != INF)
		cout << ans[n];
	else
		cout << -1;b
}


Compiler output:
a.cc: In function 'int main()':
a.cc:64:28: error: 'b' was not declared in this scope
   64 |                 cout << -1;b
      |                            ^
Language: C++

#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
using ll = long long;
using u64 = uint_fast64_t;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007;
//constexpr long long MOD = 998244353;
template<class T1, class T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return true;} return false; }
template<class T1, class T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return true;} return false; }
inline int popcount(int x) {return __builtin_popcount(x);}
inline int popcount(long long x) {return __builtin_popcountll(x);}
void print() { cout << "\n"; }
template<class T, class... Args>
void print(const T &x, const Args &... args) {
    cout << x << " ";
    print(args...);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////


template<typename T>
struct Compress {
    vector<T> xs;

    Compress(){};
    Compress(const vector<T> &vs) {add(vs);}
    Compress(const initializer_list<vector<T>> &vs) {for(auto &p : vs) add(p);}

    void add(const vector<T> &vs) {copy(begin(vs), end(vs), back_inserter(xs));}
    void add(const T &x) {xs.emplace_back(x);}

    int build() {
        sort(begin(xs), end(xs));
        xs.erase(unique(begin(xs), end(xs)), end(xs));
        return (int)xs.size();
    }

    vector<int> get(const vector<T> &vs) const {
        vector<int> ret;
        transform(begin(vs), end(vs), back_inserter(ret), [&](const T &x) {
            return lower_bound(begin(xs), end(xs), x) - begin(xs);
        });
        return ret;
    }

    int get(const T &x) const {return lower_bound(begin(xs), end(xs), x) - begin(xs);}

    const T &operator[](int k) const {return xs[k];}
};

void No(){
    cout << "No" << ln;
    exit(0);
}
void Yes(){
    cout << "Yes" << ln;
    exit(0);
}
int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int N; cin >> N;
    vector<int> A(N),B(N);
    rep(i,N) cin >> A[i];
    rep(i,N) cin >> B[i];

    sort(all(A),[&](int i, int j){return B[i] < B[j];});
    sort(all(B));
    auto sA = A;
    sort(all(sA));
    rep(i,N) if (sA[i] >= B[i]) No();

    Compress<int> ComA(A),ComB(B);
    int a = ComA.build(); 
    int b = ComB.build();
    
    auto CA = ComA.get(A);
    auto CB = ComB.get(B);

    rep(i,N-1) {
        i
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:88:10: error: expected ';' before '}' token
   88 |         i
      |          ^
      |          ;
   89 |     }
      |     ~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int n, k;
struct an{
	int a, b;
};
vector<an> ans;
bool comp(an a, an b)
{
	return a.a + a.b < b.a + b.b;
}
void solve(int n, int k, int add)
{
	if (n == 0) return;

	if (n % 4 == 0)
    {
        return 1;
    }
	if (n == 2)
	{
		ans.push_back({k + add, k + 2 + add});
		ans.push_back({k + add + 1, k + 2 + add + 1});
		return;
	}
	//cout << n << " " << k << " " << add << " " << add2 << endl;
	for (int r = 2 * n; r < k + 2 * n; r++)
	{
		ans.push_back({r - 2 * n + k + add, r + add});
	}
	n = n - k;
	int s = 2 * k - (n + 1) / 2;
	add = add + s;
	k = (n + 1) / 2;
	solve(n, k, add);
}

int main()
{
	cin >> n >> k;
	if (n == 2 && k == 1)
	{
		cout << "1 3 5\n2 4 6\n";
		return 0;
	}
	if (2 * k > n + 1)
	{
		cout << -1;
		return 0;
	}
	int x = k - (n + 1) / 2;
	solve(n, (n + 1) / 2, 0);
	sort(ans.begin(), ans.end(), comp);
	for (int i = 0; i < n; i++)
	{
		cout << ans[i].a + x << " " << ans[i].b + x << " " << k + 2 * n + i << "\n";
		if (ans[i].a + x + ans[i].b + x > k + 2 * n + i)
        {
            cout << "BAD\n";
        }
	}
	return 0;
}


Compiler output:
a.cc: In function 'void solve(int, int, int)':
a.cc:20:16: error: return-statement with a value, in function returning 'void' [-fpermissive]
   20 |         return 1;
      |                ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;
int n, k;
struct an{
	int a, b;
};
vector<an> ans;
bool comp(an a, an b)
{
	return a.a + a.b < b.a + b.b;
}
void solve(int n, int k, int add)
{
	if (n == 0) return;
	if (n == 2)
	{
		ans.push_back({k + add, k + 2 + add});
		ans.push_back({k + add + 1, k + 2 + add + 1});
		return;
	}
	//cout << n << " " << k << " " << add << " " << add2 << endl;
	for (int r = 2 * n; r < k + 2 * n; r++)
	{
		ans.push_back({r - 2 * n + k + add, r + add});
	}
	n = n - k;
	int s = 2 * k - (n + 1) / 2;
	add = add + s;
	k = (n + 1) / 2;
	solve(n, k, add);
}

int main()
{
	cin >> n >> k;
	if (n == 2 && k == 1)
	{
		cout << "1 3 5\n2 4 6\n";
		return 0;
	}
	if (2 * k > n + 1)
	{
		cout << -1;
		return 0;
	}
	int x = k - (n + 1) / 2;
	solve(n, (n + 1) / 2, 0);
	sort(ans.begin(), ans.end(), comp);
	for (int i = 0; i < n; i++)
	{
		cout << ans[i].a + x << " " << ans[i].b + x << " " << k + 2 * n + i << "\n";
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   50 |         sort(ans.begin(), ans.end(), comp);
      |         ^~~~
      |         short
Language: C++

`#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main()
{
    int n, k;
    cin >> n >> k;
    if (k != 1)
    {
        cout << -1;
        return 0;
    }
    for (int i = 0; i < n; i++)
    {
        // for(int j = 0; j < 3; j++) {
        cout << k + i << " " << k + i + n << " " << k + i + n + n << endl;
        // }
    }
}


Compiler output:
a.cc:1:1: error: stray '`' in program
    1 | `#include <bits/stdc++.h>
      | ^
a.cc:1:2: error: stray '#' in program
    1 | `#include <bits/stdc++.h>
      |  ^
a.cc:1:3: error: 'include' does not name a type
    1 | `#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc: In function 'int main()':
a.cc:8:5: error: 'cin' was not declared in this scope
    8 |     cin >> n >> k;
      |     ^~~
a.cc:11:9: error: 'cout' was not declared in this scope
   11 |         cout << -1;
      |         ^~~~
a.cc:17:9: error: 'cout' was not declared in this scope
   17 |         cout << k + i << " " << k + i + n << " " << k + i + n + n << endl;
      |         ^~~~
a.cc:17:70: error: 'endl' was not declared in this scope
   17 |         cout << k + i << " " << k + i + n << " " << k + i + n + n << endl;
      |                                                                      ^~~~
Language: C++

#pragma GCC optimize "-O3"
#pragma GCC optimize("Ofast")
#pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define NumberOfOnes __builtin_popcount
#define LSOne(S) (S & (-S))
#define ll long long
#define two pair<int,int>
#define twoll pair<ll,ll>
#define four pair<two,two>
#define pb push_back
#define eb emplace_back
#define mk make_pair
#define y1 y1922
#define INF 1000000000000000000
#define P 1000000007
#define lmax 1000000000
#define nn 1000003
#define ff first.first
#define fs first.second
#define sf second.first
#define ss second.second
#define f first
#define s second
#define vi vector<int>
#define vll vector<ll>
#define vtwo vector<two>
#define ALL(container) (container).begin(), (container).end()
#define sz(container) (int)(container.size())
#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
#define mid(a,b) (a+b>>1)
#define minN 0
#define maxN 10000000
#define na(x) ((x)<P?(x):(x)-P)
#define ab(a) (-(a)<(a)?(a):-(a))
#define FAST std::ios::sync_with_stdio(false)
#define xRand mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define rnd rng
#define IT iterator
typedef
tree<
  int,// aq pair<int,int> shegidzlia
  null_type,
  less/*_equal*/<int>,// aqac
  rb_tree_tag,
  tree_order_statistics_node_update>
ordered_set;
// '_equal' mashin ginda roca multiset gchirdeba
template<class key, class value,class cmp = std::less<key>>
using ordered_map = tree<key, value, cmp, rb_tree_tag, tree_order_statistics_node_update>;
ordered_map<int, int> my_map;
inline int rin(){
	int x=0,w=1;char ch=getchar();
	while ((ch<'0'||ch>'9')&&ch!='-') ch=getchar();
	if (ch=='-') w=0,ch=getchar();
	while (ch>='0'&&ch<='9') x=(x<<3)+(x<<1)+ch-'0',ch=getchar();
	return w?x:-x;
}
inline int bin(){
	int x=0;char ch=getchar();
	while (ch<'0'||ch>'9') ch=getchar();
	while (ch>='0'&&ch<='9') x=(x<<3)+(x<<1)+ch-'0',ch=getchar();
	return x;
}
int n,k;
int main(){FAST;xRand;
cin>>n>>k;
if((n+1)/2<k){
	cout<<-1<<endl;
	return 0;
}
for(i=0;i<n;i++)
	if(i&1)
		cout<<i/2+(n+1)/2+k<<" "<<i/2+n+k<<" "<<i+n+n+k<<endl;
	else
		cout<<i/2+k<<" "<<i/2+n+n/2+k<<" "<<i+n+n+k<<endl;
}
/*

                   *         *
                  * *       * *
                 *   *     *   *
                *     *   *     *
                 *   *   * *   *
                  *   *   *   *
                   *   * *   *
                     *  *   *
					   *  *


*/



Compiler output:
a.cc: In function 'int main()':
a.cc:76:5: error: 'i' was not declared in this scope
   76 | for(i=0;i<n;i++)
      |     ^
Language: C++

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <chrono>
#define _USE_MATH_DEFINES
#include <cmath>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <iomanip>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;

#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()

const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-8;
const int MOD = 1000000007; // 998244353;
const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1};

struct IOSetup {
  IOSetup() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    cerr << fixed << setprecision(10);
  }
} iosetup;
/*-------------------------------------------------*/
int main() {
  long long n, k; cin >> n >> k;
  vector<long long> a(n), b(n), c(n);
  REP(i, n) {
    if (i % 2 == 0) {
      a[i] = k + i / 2;
      b[i] = k + n + n / 2 + i / 2;
    } else {
      a[i] = k + (n + 1) / 2 + i / 2;
      b[i] = k + n + i / 2;
    }
    c[i] = k + n + n + i;
  }
  REP(i, n) {
    if (a[i] + b[i] > c[i]) {
      cout << -1 << '\n';
      return 0;
    }
  }
  REP(i, n) cout << a[i]s << ' ' << b[i] << ' ' << c[i] << '\n';
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:65:25: error: expected ';' before 's'
   65 |   REP(i, n) cout << a[i]s << ' ' << b[i] << ' ' << c[i] << '\n';
      |                         ^
      |                         ;
Language: C++

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<math.h>
#include<vector>
#include<queue>
#include<map>
#include<stack>
#include<fstream>
#include<set>
#include<climits>
#include<cmath>
#include<sstream>
#include<stdlib.h>
#include<memory.h> 
#include<time.h>
#include<iomanip>
using namespace std;
const unsigned long long BIGEST=1000000000000000000+100000000000000000;
const long long BIGER=1000000000000000000;
const int BIG=1000000000;
const long long MOD=1000000007;
const long long LMOD=998244353;
#define Sf scanf
#define Pf printf
#define ll long long
#define Fi first
#define Se second
#define P2 pair
#define Cb make_pair
#define Vct vector
#define Que queue
#define Era erase
#define Sz size
#define Pii pair<int,int>
#define Pll pair<long long,long long>
#define Pb push_back
#define Clr clear
#define Cot continue
#define Psh push
#define Ins insertvhjm
#define Str string
#define Pq priority_queue
ll a[400005];
ll b[400005];
ll c[400005];
vector<int>v[2];
bool occ[400005];
int main()
{
	ll n,k;
	Sf("%lld%lld",&n,&k);
	if((2*k+5*n-1)*n/2>=(2*k+2*n-1)*n)
	{
		//puts(":)");
	}
	else
	{
		puts("-1");
		return 0;
	}
	for(ll i=1;i<=n;i++)
	{
		a[i]=k+i-1;
		b[i]=k+2*n-i;
		c[i]=k+i-1+2*n;
	}
	/*
	for(ll i=1;i<=n;i++)
	{
		cout<<a[i]<<" "<<b[i]<<" "<<c[i]<<endl;
	}
	*/
	//int t=2*n-b[1];
	
	for(ll i=1;i<=n;i++)
	{
		//v[(2*n-b[i])%2].Pb(b[i]);
		
		if(b[i]>=2*n)
		{
			//cout<<i<<" "<<(2*n-b[i])<<endl;
			//swap(a[i],a[n-t+i]);
			v[(b[i]-2*n)%2].Pb(b[i]);
		}
		else
		{
			break;
		}
		
	}
	reverse(v[0].begin(),v[0].end());
	reverse(v[1].begin(),v[1].end());
	int f=0;
	/*
	for(int i=0;i<=1;i++)
	{
		for(int j=0;j<v[i].Sz();j++)
		{
			cout<<v[i][j]<<" ";
		}
		cout<<endl;
	}
	*/
	for(int i=1;i<=n;i++)
	{
		if(v[f].Sz()==0)f++;
		if(f==2)break;
		if(occ[i])continue;
		if(occ[i+v[f][(int)(v[f].Sz())-1]-n*2])continue;
		//cout<<"!"<<b[i]<<" "<<i+n*2-b[i]<<endl;
		b[i]=v[f][(int)(v[f].Sz())-1];
		swap(c[i],c[i+b[i]-n*2]);
		b[i+b[i]-n*2]=n*4-b[i];
		occ[i+b[i]-n*2]=1;
		v[f].pop_back();
	}
	for(ll i=1;i<=n;i++)
	{
		if(a[i]+b[i]>ac[i])
		{
			puts("-1");
			return 0;
		}
	}
	for(ll i=1;i<=n;i++)
	{
		//cout<<a[i]<<" "<<b[i]<<" "<<c[i]<<endl;
		Pf("%lld %lld %lld\n",a[i],b[i],c[i]);
		/*
		if(a[i]+b[i]<c[i])
		{
			puts("-1");
			return 0;
		}
		*/
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:121:30: error: 'ac' was not declared in this scope; did you mean 'c'?
  121 |                 if(a[i]+b[i]>ac[i])
      |                              ^~
      |                              c
Language: C++

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

int main() {

    int N, K;
    cin >> N >> K;
	if(2*K> N + 1){
		cout << -1;
		return 0;
	}
	vector<int> B(N, 0);
	// vector<int> C(N, 0);
	queue<int> A;
	for(int i=0;i<N;i++){
		A.push(i);
	}
    
	int a, b, c, ai, bi;
	for(int i=0;i<N;i++){
		c = 3 * N + K - i - 1;
		while true{
			ai = A.pop();
			a = K + ai;
			b = c - a;
			bi = b - K - N;
			if(0<=bi && bi <N && B.at(bi)==0){
				B.at(bi) = 1;
				cout << a << " " << b <<" " << c << endl;
			}else{
				A.push(ai);
			}
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:23: error: expected '(' before 'true'
   22 |                 while true{
      |                       ^~~~
      |                       (
a.cc:22:27: error: expected ')' before '{' token
   22 |                 while true{
      |                       ~~~~^
      |                           )
a.cc:23:35: error: void value not ignored as it ought to be
   23 |                         ai = A.pop();
      |                              ~~~~~^~
Language: C++

#include<bits/stdc++.h>
#define REP(i,n) for(int i=0,i##_len=(n);i<i##_len;++i)
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
#define All(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;

int main(){
    ll N,K;cin>>N>>K;
    if(K!=1){
        cout<<-1<<endl;
        return;
    }else{
        rep(i,1,N+1){
            cout<<i<<" "<<i+N<<" "<<i+2*N<<endl;
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
   12 |         return;
      |         ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

void solve(){
    int n;
    ll k;
    cin >>n >>k;

    if(k>=2){
        cout << -1 << "\n";
        return 0;
    }

    set<ll> s;
    rep(i,2*n){
        s.insert(k+i);
    }

    vector<ll> a(n),b(n),c(n);
    rep(i,n){
        c[i] = k+2*n+i;

        a[i] = *s.begin();
        s.erase(a[i]);
        // dbg(c[i]);
        // dbg(a[i]);

        auto itr = s.upper_bound(c[i]-a[i]);
        if(itr == s.begin()){
            printf("-1\n");
            return;
        }
        --itr;
        b[i] = *itr;
        s.erase(itr);
    }

    rep(i,n) printf("%lld %lld %lld\n", a[i], b[i], c[i]);
}

int main(){
    solve();
    return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:20:16: error: return-statement with a value, in function returning 'void' [-fpermissive]
   20 |         return 0;
      |                ^
Language: C++

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

int main(){
  int N,K;
  int count=0;
  cin >> N;
  cin >> K;
  int Asum=0;
  int Bsum=0;
  
  for(int i=3*N+K-1; 2*N+K-1;i--){
  	Asum +=i;
  }
  for(int i=K;2*K;i++){
    Bsum +=i;
  }
  if(Asum<Bsum) cout << -1 << endl;
  if(Asum>Bsum) cout << K*N << 2*K*N << 3*N+K-1 << endl;
}

  

Compiler output:
a.cc:1:10: fatal error: bits/stdc++.H: No such file or directory
    1 | #include <bits/stdc++.H>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define pll pair<ll,ll>
#define pii pair<int,int>
#define rep(i,n) for(int i=0;i<n;i++)
#define sz(x) ((ll)(x).size())
#define pb push_back
#define mp make_pair
#define bit(n) (1LL<<(n))
#define F first
#define S second
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
const ll INF = 1LL<<60;
const ll mod = (int)1e9 + 7;

int main() {
    int n,k;
    cin >> n >> k;
    if(k!=1){
        cout << -1;
        return 0;
    }
    rep(i,n){
        cout << i+1 << ' ' << i+n+1 << ' ' << i+2n+1 << endl;
    }
    
}

/*



 */



Compiler output:
a.cc: In function 'int main()':
a.cc:29:49: error: unable to find numeric literal operator 'operator""n'
   29 |         cout << i+1 << ' ' << i+n+1 << ' ' << i+2n+1 << endl;
      |                                                 ^~
Language: C++

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#define PB push_back
#define ll long long
using namespace std;
template <class T>
inline void rd(T &x) {
	x=0; char c=getchar(); int f=1;
	while(!isdigit(c)) { if(c=='-') f=-1; c=getchar(); }
	while(isdigit(c)) x=x*10-'0'+c,c=getchar(); x*=f;
}
const int N=1510,mod=998244353;
inline void Add(int &x,int y) { x+=y; if(x>=mod) x-=mod; }
inline int Pow(int x,int y) {
	int res=1;
	while(y) {
		if(y&1) res=res*(ll)x%mod;
		x=x*(ll)x%mod,y>>=1;
	}
	return res;
}
int n;
char S[N][N];
vector<int> c[N][N];
int ty[N][N];
vector<int> G[N];
int v[N],vis[N],num;
void dfs(int u) {
	if(vis[u]) return;
	vis[u]=1,num+=v[u];
	for(int i=0;i<G[u].size();++i) dfs(G[u][i]);
}
int main() {
	rd(n);
	for(int i=1;i<n;++i) scanf("%s",S[i]+1);
	for(int i=0;i<=n;++i) {
		int x=0,y=i;
		int dx=1,dy=1;
		for(int ii=0;ii<((i>0&&i<n)?2*n:n);++ii) {
			c[x][y].PB(i);
			if(x+dx<0||x+dx>n) dx=-dx;
			if(y+dy<0||y+dy>n) dy=-dy;
			x+=dx,y+=dy;
		}
	}
	memset(ty,-1,sizeof(ty));
	for(int i=1;i<n;++i)
		for(int j=1;j<n;++j) if(S[i][j]!='?') {
			int x=c[i][j][0],y=c[i][j][1];
			if(ty[x][y]!=-1&&ty[x][y]!=(S[i][j]=='o')) {
				printf("0");
				return 0;
			}
			ty[x][y]=(S[i][j]=='o');
		}
	int ETOT[2]={0,0};
	for(int i=0;i<=n;++i)
		for(int j=i+2;j<=n;j+=2)
			if(ty[i][j]==-1) G[i].PB(j),G[j].PB(i),ETOT[i&1]++;
			else v[i]^=ty[i][j],v[j]^=ty[i][j];
	int ans=1;
	for(int d=0;d<2;++d) {
		int ntot=(n-d)/2+1;
		if(ntot&1) {
			int cnt=0;
			for(int i=d;i<=n;i+=2) if(!vis[i]) {
				cnt++,num=0;
				dfs(i);
				if(num&1) {
					printf("0");
					return 0;
				}
			}
			ans=ans*(ll)Pow(2,ETOT[d]-(ntot-cnt))%mod;
		}
		else ans=ans*(ll)Pow(2,ETOT[d])%mod;
	}
	printf("%d",ans);
	return 0;
}
ns=1;
	for(int d=0;d<2;++d) {
		int ntot=(n-d)/2+1;
		if(ntot&1) {
			int cnt=0;
			for(int i=d;i<=n;i+=2) if(!vis[i]) {
				cnt++,num=0;
				dfs(i);
				if(num&1) {
					printf("0");
					return 0;
				}
			}
			ans=ans*(ll)Pow(2,ETOT[d]-(ntot-cnt))%mod;
		}
		else ans=ans*(ll)Pow(2,ETOT[d])%mod;
	}
	printf("%d",ans);
	return 0;
}


Compiler output:
a.cc:84:1: error: 'ns' does not name a type
   84 | ns=1;
      | ^~
a.cc:85:9: error: expected unqualified-id before 'for'
   85 |         for(int d=0;d<2;++d) {
      |         ^~~
a.cc:85:21: error: 'd' does not name a type
   85 |         for(int d=0;d<2;++d) {
      |                     ^
a.cc:85:25: error: expected unqualified-id before '++' token
   85 |         for(int d=0;d<2;++d) {
      |                         ^~
a.cc:101:15: error: expected constructor, destructor, or type conversion before '(' token
  101 |         printf("%d",ans);
      |               ^
a.cc:102:9: error: expected unqualified-id before 'return'
  102 |         return 0;
      |         ^~~~~~
a.cc:103:1: error: expected declaration before '}' token
  103 | }
      | ^