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

#include<bits/stdc++.h>
signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a,q=0;  
    cin>>a;
    for(int i=0;i<a;i++) cin>>b[i];
    for(int j=0;j<a;j++) cin>>c[j];
    sort(b,b+a);
    sort(c,c+a);
    for(int i=0;i<a;i++){
	if(b[i]>c[i]){
	    q=1;
	    break;
	}
    }
    if(q) cout<<"No";
    else cout<<"Yes";
    cout<<"\n";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    3 |     cin.tie(0);
      |     ^~~
      |     std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:4:5: error: 'ios' has not been declared
    4 |     ios::sync_with_stdio(false);
      |     ^~~
a.cc:7:31: error: 'b' was not declared in this scope
    7 |     for(int i=0;i<a;i++) cin>>b[i];
      |                               ^
a.cc:8:31: error: 'c' was not declared in this scope
    8 |     for(int j=0;j<a;j++) cin>>c[j];
      |                               ^
a.cc:9:10: error: 'b' was not declared in this scope
    9 |     sort(b,b+a);
      |          ^
a.cc:9:5: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
    9 |     sort(b,b+a);
      |     ^~~~
      |     std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
a.cc:10:10: error: 'c' was not declared in this scope
   10 |     sort(c,c+a);
      |          ^
a.cc:17:11: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   17 |     if(q) cout<<"No";
      |           ^~~~
      |           std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:18:10: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   18 |     else cout<<"Yes";
      |          ^~~~
      |          std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:19:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   19 |     cout<<"\n";
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

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

int main(){
	int N;
	cin >> N;
	vector<int> A(N);
	vector<int> B(N);
	int loop,ans=1;
	int Amax=0,Bmax=0;
	for(loop=0;loop<N;loop++){
		cin >> A[loop];
		if(Amax<A[loop]){
			Amax = A[loop];
		}
	}
	for(loop=0;loop<N;loop++){
		cin >> B[loop];
		if(Bmax<B[loop]){
			Bmax = B[loop];
		}
		if(A[loop]<B[loop]){
			
		}
	}
	if(Amax > Bmax){
		ans = 0;
	}else{
		sort(A.begin(),A.end());
		sort(B.begin(),B.end());
		for(loop=0;loop<N;i++){
			if(A[loop] > B[loop]){
				ans = 0;
				break;
			}
		}
	}
	if(ans){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:35: error: 'i' was not declared in this scope
   31 |                 for(loop=0;loop<N;i++){
      |                                   ^
Language: C++

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

int main(){
	int N;
	cin >> N;
	vector<int> A(N);
	vector<int> B(N);
	int loop,ans=1;
	int Amax=0,Bmax=0;
	for(loop=0;loop<N;loop++){
		cin >> A[loop];
		if(Amax<A[loop]){
			Amax = A[loop];
		}
	}
	for(loop=0;loop<N;loop++){
		cin >> B[loop];
		if(Bmax<B[loop]){
			Bmax = B[loop];
		}
	}
	if(Amax > Bmax){
		ans = 0;
	}else{
		sort(A.begin(),A.end());
		sort(B.begin(),B.end());
		for(i=0;i<N;i++){
			if(A[i] > B[i]){
				ans = 0;
				break;
			}
		}
	}
	if(ans){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}
	return 0;
}

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

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

int main(){
	int N;
	cin >> N;
	vector<int> A(N);
	vector<int> B(N);
	int loop,ans=1;
	int Amax=0,Bmax=0;
	for(loop=0;loop<N;loop++){
		cin >> A[loop];
		if(Amax<A[loop]){
			Amax = A[loop];
		}
	}
	for(loop=0;loop<N;loop++){
		cin >> B[loop];
		if(Bmax<B[loop]){
			Bmax = B[loop];
		}
		if(A[loop]<B[loop]){
			
		}
	}
	if(Amax > Bmax){
		ans = 0;
	}else{
		A.sort();
		B.sort();
		for(i=0;i<N;i++){
			if(A[i] > B[i]){
				ans = 0;
				break;
			}
		}
	}
	if(ans){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:19: error: 'class std::vector<int>' has no member named 'sort'
   29 |                 A.sort();
      |                   ^~~~
a.cc:30:19: error: 'class std::vector<int>' has no member named 'sort'
   30 |                 B.sort();
      |                   ^~~~
a.cc:31:21: error: 'i' was not declared in this scope
   31 |                 for(i=0;i<N;i++){
      |                     ^
Language: C++

#include<bits/stdc++.h>

#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = (n)-1; i >= 0; i--)
#define rep1(i,n) for(int i = 1; i <= (n); i++)
#define rrep1(i,n) for(int i = (n); i > 0; i--)

#define ll long long
#define pi pair<int, int>
#define pll pair<ll, ll>

#define MOD 1000000007
#define INF 1000000000000000LL

using namespace std;

int main(){
  int n, m; cin>>n>>m;
  vector<vector<pll>> g(n, vector<pll>());
  rrep1(i, n-1)g[i].push_back({0, i-1});
  rep(i, m){
    ll l, r, c; cin>>l>>r>>c; l--;r--;
    g[l].push_back( {c, r} );
  }

  priority_queue<pll, vector<pll>, greater<pll>> pq;
  vector<ll> d(n);
  rep(i, n)d[i]=INF;
  d[0]=0;
  pq.push( {0, 0} );
  while(pq.size()){
    auto p = pq.top();pq.pop();
    if(p.first > d[p.second])continue;
    d[p.second] = p.first;
    for(auto np: g[p.second]){
      if(d[np.second] < np.first+p.first)continue;
      d[np.second] = np.first+p.first;
      pq.push( {d[np.second], np.second} );
    }
  }

  cout<<(d[n-1] == INF : -1 : d[n-1])<<endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:24: error: expected ')' before ':' token
   42 |   cout<<(d[n-1] == INF : -1 : d[n-1])<<endl;
      |         ~              ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;
typedef pair<ll,ll> pll;
const ll mod=1e9+7;
//const ll mod=998244353;
const ll inf=5e15;

int main() {
  ll n,m;
  cin >> n >> m;
  vector<map<ll,ll>> E(n);
  for(ll i=1;i<n;i++) E[i][i-1]=0;
  for(ll i=0;i<m;i++) {
    ll l,r,c;
    cin >> l >> r >> c;
    l--;r--;
    if(E[l][r]) {
      E[l][r]=min(E[l][r]);
    }
    else {
      E[l][r]=c;
    }
  }
  priority_queue<pll,vector<pll>,greater<pll>> q;
  vec d(n,inf);
  q.push(pll(0,0));
  while(q.size()) {
    ll dis=q.top().first;
    ll f=q.top().second;
    q.pop();
    if(d[f]<dis) continue;
    d[f]=dis;
    for(auto p:E[f]) {
      ll ndis=dis+p.second;
      ll t=p.first;
      if(d[t]>ndis) {
        q.push(pll(ndis,t));
      }
    }
  }
  if(d[n-1]==inf) d[n-1]=-1;
  cout << d[n-1] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:18: error: no matching function for call to 'min(std::map<long long int, long long int>::mapped_type&)'
   21 |       E[l][r]=min(E[l][r]);
      |               ~~~^~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   template argument deduction/substitution failed:
a.cc:21:18: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   21 |       E[l][r]=min(E[l][r]);
      |               ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   candidate expects 2 arguments, 1 provided
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
#define tii tuple<int,int,int>
#define Priq priority_queue<int,vi,greater<int>>
#define pb push_back
#define mp make_pair
#define INF (1ll<<60)
signed main(){
  int N,M; cin>>N>>M;
  vector<pair<pii,int>> A(M);
  rep(i,0,M) cin>>A[i].first.first>>A[i].first.second>>A[i].second;
  sort(ALL(A));
  vi dp(N+1,-1);
  dp[1]=0;
  priority_queue<pii,vector<pii>,greater<pii>> Q;
  int memo=0;
  REP(i,1,N){
    for(memo;memo<M;memo++){
      if(A[memo].first.first>i) break;
      Q.push(mp(A[memo].first.second,A[memo].second));
    }
    while(Q.size()>0){
      int X=Q.top();
      if(X>i) break;
      Q.pop();
    }
    if(dp[i]!=-1){
      queue<pii> q;
      rep(i,0,Q.size()){
        q.push(Q.top());
        int X=Q.top().first,Y=Q.top().second;
        Q.pop();
        if(dp[X]==-1) dp[X]=Y+dp[i];
        else dp[X]=min(dp[X],Y+dp[i]);
      }
      while(q.size()>0){
        Q.push(q.front());
        q.pop();
      }
    }
  }
  cout<<dp[N]<<endl;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:34:18: error: cannot convert 'const __gnu_cxx::__alloc_traits<std::allocator<std::pair<long long int, long long int> >, std::pair<long long int, long long int> >::value_type' {aka 'const std::pair<long long int, long long int>'} to 'long long int' in initialization
   34 |       int X=Q.top();
      |             ~~~~~^~
      |                  |
      |                  const __gnu_cxx::__alloc_traits<std::allocator<std::pair<long long int, long long int> >, std::pair<long long int, long long int> >::value_type {aka const std::pair<long long int, long long int>}
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <set>
using ll = long long;
#define rep(i,n) for (int i=0; i < int(n); i++)
using namespace std;
#define INF 1ll << 50;
#define MAX_V 100005

struct edge {
    ll to;
    ll cost;
};

// <最短距離, 頂点の番号>
using P = pair<int, int>;

ll V;
vector<edge> G[MAX_V];
ll d[MAX_V];

void dijkstra(int s) {
    priority_queue<P, vector<P>, greater<P> > que;
    fill(d, d+V, INF);
    d[s] = 0;
    que.push(P(0, s));

    while (!que.empty()) {
        P p = que.top();
        que.pop();
        ll v = p.second;
        if (d[v] < p.first) continue;

        for (ll i=0; i<G[v].size(); ++i) {
            edge e = G[v][i];
            if (d[e.to] > d[v] + e.cost) {
                d[e.to] = d[v] + e.cost;
                que.push(P(d[e.to], e.to));
            }
        }
    }
}

int main() {
    cin >> V;
    ll E;
    cin >> E;
    for (ll i=0; i<E; ++i) {
        ll a, b, c;
        cin >> a >> b >> c;
        a--;b--;
        edge e = {b, c};
        G[a].push_back(e);
    }
    for (ll i = V-1; i > 0; --i) {
        edge e = {i-1,0};
        G[i].push_back(e);
    }
    dijkstra(0);
    if(d[V - 1] == INF){
        cout << -1 << endl;
        return 0;
    }
    cout << d[V - 1] << endl;
}


Compiler output:
a.cc: In function 'void dijkstra(int)':
a.cc:12:22: error: expected ')' before ';' token
   12 | #define INF 1ll << 50;
      |                      ^
a.cc:29:18: note: in expansion of macro 'INF'
   29 |     fill(d, d+V, INF);
      |                  ^~~
a.cc:29:9: note: to match this '('
   29 |     fill(d, d+V, INF);
      |         ^
a.cc:29:21: error: expected primary-expression before ')' token
   29 |     fill(d, d+V, INF);
      |                     ^
a.cc: In function 'int main()':
a.cc:65:23: error: expected primary-expression before ')' token
   65 |     if(d[V - 1] == INF){
      |                       ^
Language: C++

#ifndef COMPETITIVE_GRAPH_H
#define COMPETITIVE_GRAPH_H

#include <map>
#include <set>
#include <utility>
#include <queue>

template<typename T>
class djikstra {
private:
    std::map<T, std::set<std::pair<T, T>>> path; //src dst cost
    std::map<T, T> dist; //dst cost
public:
    void compute(T start);

    void add_path(T src, T dst, T cost);

    T get_dist(T dst);
};

#endif //COMPETITIVE_GRAPH_H
#ifndef COMPETITIVE_NIKLIB_H
#define COMPETITIVE_NIKLIB_H

#ifdef BUILT_LOCAL

#include "graph.h"

#endif

#endif //COMPETITIVE_NIKLIB_H
#ifdef BUILT_LOCAL

#include "niklib.h"

#endif

template<typename T>
void djikstra<T>::compute(T start) {
    dist.clear();
    dist[start] = 0;
    std::priority_queue<std::pair<T, T>, std::deque<std::pair<T, T>>, std::greater<>> q;
    for (auto &e:path[start]) q.push(std::make_pair(e.second, e.first));
    while (!q.empty()) {
        auto c = q.top();
        q.pop();
        if (dist.find(c.second) != dist.end()) continue;
        dist[c.second] = c.first;
        for (auto &e:path[c.second]) {
            if (dist.find(e.first) != dist.end()) continue;
            q.push(std::make_pair(c.first + e.second, e.first));
        }
    }
}

template<typename T>
void djikstra<T>::add_path(T src, T dst, T cost) {
    path[src].insert(std::make_pair(dst, cost));
}

template<typename T>
T djikstra<T>::get_dist(T dst) {
    return dist.find(dst) == dist.end() ? -1 : dist[dst];
}

template
class djikstra<long long>;#ifdef BUILT_LOCAL

#include "niklib.h"

#endif

#include <iostream>
#include <utility>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <string>
#include <cstdio>
#include <map>
#include <set>
#include <list>

using namespace std;

typedef long long ll;
constexpr ll mod = 1000000007;

int main() {
    int n, m, l, r, c;
    djikstra<ll> d;
    cin >> n >> m;
    for (int i = 0; i < m; i++) {
        cin >> l >> r >> c;
        d.add_path(l, r, c);
    }
    for (int i = 1; i < n; i++) {
        d.add_path(i + 1, i, 0);
    }
    d.compute(1);
    cout << d.get_dist(n) << endl;
}

Compiler output:
a.cc:68:27: error: stray '#' in program
   68 | class djikstra<long long>;#ifdef BUILT_LOCAL
      |                           ^
a.cc:70:10: fatal error: niklib.h: No such file or directory
   70 | #include "niklib.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<tuple>
using namespace std;
#define INF 1000000000000
#define SZ 131072

typedef vector<pair<pair<int,int>,long long int>> Graph;

struct Segtree{
  long long int data[2*SZ-1];
  
  Segtree(){
    int n = SZ;
    for(int i=0;i<2*n-1;i++) data[i] = INF;
    data[n-1] = 0;
    for(int i=n-2;i>=0;i--) data[i] = min(data[2*i+1],data[2*i+2]);
  }
  
  void change(int id, long long int val){
  	int i = id + SZ - 1;
    data[i] = val;
    i = i/2;
    while(1){
    	data[i] = min(data[2*i+1],data[2*i+2]);
      	if(i==0) break;
    	i = i/2;
    }
  }
  
  long long int find(int a, int b,int k=0, int l=0, int r=SZ){
  	if(a<=l && r<=b) return data[k];
    if(b <= l || r <= a) return INF;
    else {
    	return min(find(a, b, 2*k+1, l,(l+r)/2), find(a,b, 2*k+2, (l+r)/2, r));
    }
  }
};

int main(){
  int n,m; 
  cin >> n >> m;
  Segtree segt();
  Graph g(m);
  for(int i=0;i<m;i++){
  	cin >> g[i].first.first >> g[i].first.second >> g[i].second;
  }
  sort(g.begin(), g.end());
  for(int i=0;i<m;i++){
  	int l = g[i].first.first-1, r = g[i].first.second , c = g[i].second;
  	long long int mc = segt.find(l,r-1);
    long long int minc = segt.find(r-1,r);
  //  cout << minc << endl;
    segt.change(r-1, min(minc,mc+c));
  }
//  for(int i=0;i<n;i++) cout << segt.data[SZ+i-1] << " ";
  if(segt.find(n-1,n) == INF) cout << - 1 << endl;
  else cout << segt.find(n-1,n) << endl;
  return 0;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:44:15: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   44 |   Segtree segt();
      |               ^~
a.cc:44:15: note: remove parentheses to default-initialize a variable
   44 |   Segtree segt();
      |               ^~
      |               --
a.cc:44:15: note: or replace parentheses with braces to value-initialize a variable
a.cc:52:33: error: request for member 'find' in 'segt', which is of non-class type 'Segtree()'
   52 |         long long int mc = segt.find(l,r-1);
      |                                 ^~~~
a.cc:53:31: error: request for member 'find' in 'segt', which is of non-class type 'Segtree()'
   53 |     long long int minc = segt.find(r-1,r);
      |                               ^~~~
a.cc:55:10: error: request for member 'change' in 'segt', which is of non-class type 'Segtree()'
   55 |     segt.change(r-1, min(minc,mc+c));
      |          ^~~~~~
a.cc:58:11: error: request for member 'find' in 'segt', which is of non-class type 'Segtree()'
   58 |   if(segt.find(n-1,n) == INF) cout << - 1 << endl;
      |           ^~~~
a.cc:59:21: error: request for member 'find' in 'segt', which is of non-class type 'Segtree()'
   59 |   else cout << segt.find(n-1,n) << endl;
      |                     ^~~~
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<tuple>
using namespace std;
#define INF 1000000000

vector<pair<pair<int,int>,int>> Graph;

struct Segtree{
  vector<int> data;
  int n;
  
  void Segtree(vector<int> v){
  	int n = 1;
    while(1<<n < v.size()) n = 2*n;
    data.resize(2*n-1);
    for(int i=0;i<2*n-1;i++) data[i] = INF;
    for(int i=0;i<n;i++) data[n+i] = v[i];
    for(int i=n-1;i>=0;i--) data[i] = min(data[2*i+1],data[2*i+2]);
  }
  
  void change(int id, int val){
  	int i = id + n - 1;
    data[i] = val;
    i = i/2;
    while(1){
    	data[i] = min(data[2*i+1],data[2*i+2]);
      	if(i==0) break;
    	i = i/2;
    }
  }
  
  int find(int a, int b,int k=0, int l=0, int r=n){
  	if(a<=l && b<=r) return data[k];
    else (l <= a || b <= r) return INF;
    else {
    	return min(find(a, b, 2*k+1, l,(l+r)/2), find(a,b, 2*k+2, (l+r)/2, r));
    }
  }
};

int main(){
  int n,m; 
  cin >> n >> m;
  vector<int> v(n); v[0]=0;
  Segtree segt(v);
  Graph g(m);
  for(int i=0;i<m;i++){
  	cin >> g[i].first.second >> g[i].first.second >> g[i].second;
  }
  sort(g.begin(), g.end());
  for(int i=0;i<m;i++){
  	int l = g[i].first.second-1, r = g[i].first.second-1 , c = g[i].second;
  	int mc = segt.find(l,r+1);
    segt.change(r, mc+d);
  }
  cout << segt.find(n-1,n) << endl;
  return 0;
}
  

Compiler output:
a.cc:14:3: error: return type specification for constructor invalid
   14 |   void Segtree(vector<int> v){
      |   ^~~~
a.cc:34:49: error: invalid use of non-static data member 'Segtree::n'
   34 |   int find(int a, int b,int k=0, int l=0, int r=n){
      |                                                 ^
a.cc:12:7: note: declared here
   12 |   int n;
      |       ^
a.cc: In member function 'int Segtree::find(int, int, int, int, int)':
a.cc:36:29: error: expected ';' before 'return'
   36 |     else (l <= a || b <= r) return INF;
      |                             ^~~~~~
a.cc:37:5: error: 'else' without a previous 'if'
   37 |     else {
      |     ^~~~
a.cc: In function 'int main()':
a.cc:48:8: error: expected ';' before 'g'
   48 |   Graph g(m);
      |        ^~
      |        ;
a.cc:50:16: error: 'g' was not declared in this scope
   50 |         cin >> g[i].first.second >> g[i].first.second >> g[i].second;
      |                ^
a.cc:52:8: error: 'g' was not declared in this scope
   52 |   sort(g.begin(), g.end());
      |        ^
a.cc:55:30: error: 'r' was not declared in this scope
   55 |         int mc = segt.find(l,r+1);
      |                              ^
a.cc:56:23: error: 'd' was not declared in this scope
   56 |     segt.change(r, mc+d);
      |                       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(long long i=0;i<x;i++)
#define repn(i,x) for(long long i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
vector<pair<string,P> >vec;
// vector<vector<int>> data(3, vector<int>(4));


const ll MAX_N = 1 << 20;
// セグメント木を持つグローバル配列 
ll n, dat[2 * MAX_N - 1];
// 初期化
void init(ll n_) {
	// 簡単のため、要素数を2のべき乗に 
	n = 1;
	while (n < n_) n *= 2;
	// すべての値をINT_MAXに
	for (ll i = 0; i < 2 * n - 1; i++) dat[i] = INT_MAX; 
}
// k番目の値(0-indexed)をaに変更
void update(ll k, ll a) {
	// 葉の節点
	k += n - 1; 
	dat[k] = a; 
	// 登りながら更新
	while (k > 0) {
		k = (k - 1) / 2;
		dat[k] = min(dat[k * 2 + 1], dat[k * 2 + 2]);
	}
}

ll query(ll a, ll b, ll k, ll l, ll r) {
	// [a, b)と[l, r)が交差しなければ、INT_MAX 
	if (r <= a || b <= l) return INT_MAX;
	// [a, b)が[l, r)を完全に含んでいれば、この節点の値 
	if (a <= l && r <= b) return dat[k]; 
	else {
		// そうでなければ、2つの子の最小値
		ll vl = query(a, b, k * 2 + 1, l, (l + r) / 2); 
		ll vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
		return min(vl, vr);
	} 
}



vector<ll> dp(100001, INT_MAX);

ll main(){	
	ll M;
	ll N;
	scanf("%d",&N);
	init(N);
	scanf("%d",&M);
	vector<ll> C(M-1+1);
	vector<ll> L(M-1+1);
	vector<ll> R(M-1+1);
	vector<vector<ll>> lv(M, vector<ll>(3));
	for(ll i = 0 ; i <= M-1 ; i++){
		scanf("%d",&L[i]);
		scanf("%d",&R[i]);
		scanf("%d",&C[i]);
		L[i]--; R[i]--;
		lv[i][0] = L[i];
		lv[i][1] = R[i];
		lv[i][2] = C[i];
	}
	dp[0] = 0;
	update(0, 0);
	sort(lv.begin(),lv.end());
	// rep(i, M) {
	// 	cout << lv[i][0] << " " << lv[i][1] << " " << lv[i][2] << endl;
	// }
	rep(i, M) {
		ll l = lv[i][0], r = lv[i][1], c = lv[i][2];
		// cout << lv[i][0] << " " << lv[i][1] << " " << lv[i][2] << endl;
		
		dp[r] = min(dp[r], query(l, r+1, 0, 0, n)+c);
		update(r, dp[r]);

		// rep(j, N+1) if (dp[j] >= INT_MAX/4) cout << "i"; else cout << dp[j];
		// cout << endl;
	}

	if (dp[N-1] >= INT_MAX ) printf("-1\n"); else printf("%d\n",dp[N-1]);
	return 0;
}



Compiler output:
a.cc:65:1: error: '::main' must return 'int'
   65 | ll main(){
      | ^~
Language: C++

#include <bits/stdc++.h>
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (ll i = (ll)(a); i < (ll)(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define ll long long
#define lld long double
#define ALL(x) x.begin(), x.end()
#ifdef DEBUG
#define line() cerr << "[" << __LINE__ << "] ";
#define dump(i) cerr << #i ": " << i << " ";
#define dumpl(i) cerr << #i ": " << i << endl;
#else
#define line(i)
#define dump(i)
#define dumpl(i)
#endif
using namespace std;
#define int ll
#define INF (1ll << 60)
typedef map<int, vector<int>> Graph;

typedef map<int, map<int, ll>> WGraph;
vector<ll> dijkstra(int v, WGraph &g, int r)
{
    vector<ll> cost(v, INF);
    cost[r] = 0;
    priority_queue<pair<ll, int>> pq;

    pq.push({0, r});

    while (!pq.empty())
    {
        //cerr << "-------------------------------" << endl;
        auto t = pq.top();
        pq.pop();
        //cerr << t.second << "," << t.first << endl;
        if (cost[t.second] < -t.first)
        {
            continue;
        }
        for (auto x : g[t.second])
        {
            if (cost[x.first] > cost[t.second] + g[t.second][x.first])
            {
                cost[x.first] = cost[t.second] + g[t.second][x.first];
                //cerr << "update cost[" << x.first << "] with " << cost[x.first] << endl;
                pq.push({-cost[x.first], x.first});
            }
        }
    }
    return cost;
}

sigend main(int argc, char const *argv[])
{
    int n, m;
    cin >> n >> m;
    WGraph g;
    rep(i, 1, n)
    {
        g[i][i - 1] = 0;
    }
    rep(i, m)
    {
        int a, b;
        ll c;
        cin >> a >> b >> c;
        a--;
        b--;
        g[a][b] = c;
    }
    ll ans = dijkstra(n, g, 0)[n - 1];
    cout << (ans == INF ? -1 : ans) << endl;
    return 0;
}


Compiler output:
a.cc:55:1: error: 'sigend' does not name a type; did you mean 'signed'?
   55 | sigend main(int argc, char const *argv[])
      | ^~~~~~
      | signed
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;

int rmq[400000] = {};


int N, M;
tuple<int, int, int> LRC[100000];

void update(int index, int value){
  for(int idx = (1 << 17) + index - 1; idx > 0; idx /= 2){
    rmq[idx] = min(rmq[idx], value);
  }
}

int query(int begin, int end, int node_idx, int node_b, int node_e){
  if(node_b >= end || node_e <= begin){
    return INT_MAX;
  }
  if(begin <= node_b && node_e <= end){
    return rmq[node_idx];
  }

  int vl = query(begin, end, node_idx * 2, node_b, (node_b + node_e) / 2);
  int vr = query(begin, end, node_idx * 2 + 1, (node_b + node_e) / 2, node_e);
  return min(vl, vr);
}

int main(){
  for(int i = 0; i < 400000; i++){
    rmq[i] = INT_MAX;
  }
  
  cin >> N >> M;
  for(int i = 0; i < M; i++){
    int l, r, c;
    cin >> l >> r >> c;
    LRC[i] = make_tuple(l, r, c);
  }
  sort(LRC, LRC + M);

  update(1, 0);
  for(int i = 0; i < M; i++){
    int l, r, c;
    tie(l, r, c) = LRC[i];
    // cout << l << ' ' << r << ' ' << c << endl;
    int m = query(l, r + 1, 1, 1, (1 << 17) + 1);
    update(r, m + c);
  }

  /*
  for(int i = 1; i <= N; i++){
    cout << query(i, i + 1, 1, 1, (1 << 17) + 1) << endl;
  }
  */
  int ans = query(N, N + 1, 1, 1, (1 << 17) + 1);
  if(ans > 2e9 || ans < -2e9){
    cout << -1 << endl;
  }else{
    cout << ans << endl;
  }
}


Compiler output:
a.cc: In function 'int query(int, int, int, int, int)':
a.cc:19:12: error: 'INT_MAX' was not declared in this scope
   19 |     return INT_MAX;
      |            ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include<algorithm>
  +++ |+#include <climits>
    3 | using namespace std;
a.cc: In function 'int main()':
a.cc:32:14: error: 'INT_MAX' was not declared in this scope
   32 |     rmq[i] = INT_MAX;
      |              ^~~~~~~
a.cc:32:14: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

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

int main(){
    int n, m;
    cin >> n >> m;
    vector<pair<int,int64_t>> edges[100000];
    for(int i=0;i<m;++i){
        int l, r, c;
        cin >> l >> r >> c;
        edges[l-1].emplace_back(r-1, c);
    }
    for(int i=1;i<n;++i) edges[i].emplace_back(i-1, 0);

    priority_queue<pair<int64_t,int>> q;
    q.emplace(0, 0);
    bool checked[100000] = {0};
    while(!q.empty()){
        auto t = q.top();
        q.pop();
        if(checked[t.second]) continue;
        checked[t.second] = true;
        if(t.second == n-1){
            cout << (-t.first) << endl;
            return 0;
        }
        for(auto to : edges[t.second]){
            if(checked[to.first]) continue;
            q.emplace(t.first-to.second, to.first);
        }
    }
    cout << -1 << endl;

    return 0;
}

/*

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

int main(){
    int n, m;
    cin >> n >> m;
    vector<pair<int,int64_t>> edges[100000];
    for(int i=0;i<m;++i){
        int l, r, c;
        cin >> l >> r >> c;
        edges[l-1].emplace_back(r-1, c);
    }
    for(int i=1;i<n;++i) edges[i].emplace_back(i-1, 0);

    priority_queue<pair<int64_t,int>> q;
    q.emplace(0, 0);
    bool checked[100000] = {0};
    while(!q.empty()){
        auto t = q.top();
        q.pop();
        if(checked[t.second]) continue;
        checked[t.second] = true;
        if(t.second == n-1){
            cout << (-t.first) << endl;
            return 0;
        }
        for(auto to : edges[t.second]){
            if(checked[to.first]) continue;
            q.emplace(t.first-to.second, to.first);
        }
    }
    cout << -1 << endl;

    return 0;
}

/*

*/


Compiler output:
a.cc:43:5: error: redefinition of 'int main()'
   43 | int main(){
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main(){
      |     ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <queue>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pii;
const ll maxn = 1e6+10;
const ll inf = 1e14;

vector<pii> ve[maxn];
ll dis[maxn];
priority_queue<pii,vector<pii>,greater<pii>> heap;
int N,M;

void init(){
	for(int i = 1;i<=N;i++) dis[i] = inf;
	for(int i = 1;i<=N;i++) ve[i].push_back({0,i-1});
	
}

ll Dji(){
	heap.push({0,1});
	dis[1] = 0;
	
	while(heap.size(){
		auto cur = heap.top();heap.pop();
		cout<<cur.first<<cur.second<<"\n";
		ll d = cur.first,id = cur.second;
		for(auto v:ve[id]){
			ll w = v.first,id2 = v.second;
			cout<<v.first<<v.second<<"\n";
			if(d+w<dis[id2]){
				dis[id2] = d+w;
				heap.push({dis[id2],id2});
			}
		}
	}
	if(dis[N] == inf) return -1;
	return dis[N];
}

int main(){
	cin>>N>>M;
	init();
	int a,b,c;
	for(int i = 0;i<M;i++){
		scanf("%d%d%d",&a,&b,&c);
		ve[a].push_back({c,b});
	}
	cout<<Dji()<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'll Dji()':
a.cc:25:26: error: expected ')' before '{' token
   25 |         while(heap.size(){
      |              ~           ^
      |                          )
Language: C++

#include<iostream>
#include<vector>
#include<string.h>
#include<queue>
using namespace std;
const long long N = 4e6 + 7;
struct node {
	long long to, cost;
}r;
struct que {
	long long x, y;
	bool friend operator < (que a, que b) {
		return a.x > b.x;
	}
}w;
long long vis[N];
long long dis[N];
vector<node>v[N];
long long n, m, x, y, z;
void push(long long x, long long y, long long z) {
	r.to = y; r.cost = z;
	v[x].push_back(r);
}
long long inf = 214722121483647;
priority_queue<que> q;
long long slove(long long x) {
	filong long(dis, dis + N, inf);
	w.x = 0; w.y = 1;
	dis[1] = 0;
	q.push(w);
	while (!q.empty()) {
		w = q.top(); q.pop();
		long long pos = w.y;
		if (dis[pos] < w.x) continue;
		for (long long i = 0; i < v[pos].size(); i++) {
			node e = v[pos][i];
			if (dis[e.to] > dis[pos] + e.cost) {
				dis[e.to] = dis[pos] + e.cost;
				w.x = dis[e.to]; w.y = e.to;
				q.push(w);
			}
		}
		
	}
	return dis[n];
}
int main() {
	cin >> n >> m;
	for (long long i = 1; i <= n; i++) {
		push(i, i - 1, 0);
	}
	while (m--) {
		cin >> x >> y >> z;
		push(x, y, z);
	}
	if (slove(1) == inf) cout << "-1\n";
	else cout << dis[n] << '\n';
	return 0;
}



Compiler output:
a.cc: In function 'long long int slove(long long int)':
a.cc:27:9: error: 'filong' was not declared in this scope; did you mean 'ulong'?
   27 |         filong long(dis, dis + N, inf);
      |         ^~~~~~
      |         ulong
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <limits>
#include <chrono>
using namespace std;
 
typedef long long ll;
typedef pair<ll, ll> Pl;

ll dist[100005];
vector<Pl> graph[100005];

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

    int n, m;
    cin >> n >> m;
    for(int i = 0; i < m; ++i){
        int l, r;
        ll c;
        cin >> l >> r >> c;
        --l, --r;
        graph[l].push_back(Pl(r, c));
    }
    for(int i = 0; i < n-1; ++i){
        graph[i+1].push_back(Pl(i, 0));
    }
    
    fill(dist, dist+n, (ll)1e+17);
    dist[0] = 0;
    priority_queue<Pl, vector<Pl>, greater<Pl>> que;
    que.push(Pl(0, 0));
    while(!que.empty() && t.elapsed() < 1950){
        Pl p = que.top();
        que.pop();
        ll d = p.first;
        int u = p.second;
        if(dist[u] < d)     continue;
        for(int i = 0; i < (int)graph[u].size(); ++i){
            int v = graph[u][i].first;
            ll cost = graph[u][i].second;
            if(dist[v] > dist[u] + cost){
                dist[v] = dist[u] + cost;
                que.push(Pl(dist[v], v));
            }
        }
    }
    if(dist[n-1] == (ll)1e+17)  dist[n-1] = -1;
    cout << dist[n-1] << "\n";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:27: error: 't' was not declared in this scope
   37 |     while(!que.empty() && t.elapsed() < 1950){
      |                           ^
Language: C++

#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <queue>
#include <set>
#include <cstdio>
#include <vector>
#include <cstring>
#include <math.h>
#include <iomanip>
#include <bitset>
#include <map>
#include <stack>
#include <cmath>
#define LL long long 
using namespace std; 

int value[10010],to[10010],next[10010];
int head[10010],total;
int book[10010];
int dis[10010];
int n,m;

void adl(int a,int b,int c)
{
    total++;
    to[total]=b;
    value[total]=c;
    next[total]=head[a];
    head[a]=total;
}

void dijkstra(int u)
{
    memset(dis,88,sizeof(dis));
    memset(book,0,sizeof(book));
    dis[u]=0;
    for(int i=1;i<=n;i++)
    {
        int start=-1;
        for(int j=1;j<=n;j++)
            if(book[j]==0 && (dis[start]>dis[j] || start==-1))
                start=j;
        book[start]=1;
        for(int e=head[start];e;e=next[e])
            dis[to[e]]=min(dis[to[e]],dis[start]+value[e]);
    }
}

int main()
{
    cin>>n>>m;
    for(int i=1;i<=m;i++)
    {
        int a,b,c;
        cin>>a>>b>>c;
        adl(a,b,c);
        for(int j=b-1;j>=a;j--)
        	adl(b,j,0);
     } 
     dijkstra(1);
     if(dis[n]!=1482184792)
     	cout<<dis[n]<<endl;
    else
    	cout<<-1<<endl;
}

Compiler output:
a.cc: In function 'void adl(int, int, int)':
a.cc:29:5: error: reference to 'next' is ambiguous
   29 |     next[total]=head[a];
      |     ^~~~
In file included from /usr/include/c++/14/string:47,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:18:28: note:                 'int next [10010]'
   18 | int value[10010],to[10010],next[10010];
      |                            ^~~~
a.cc: In function 'void dijkstra(int)':
a.cc:45:35: error: reference to 'next' is ambiguous
   45 |         for(int e=head[start];e;e=next[e])
      |                                   ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:18:28: note:                 'int next [10010]'
   18 | int value[10010],to[10010],next[10010];
      |                            ^~~~
Language: C++

#include <cstdio>
#include <iostream>
using namespace std;
typedef long long int ll;
const ll inf = 9223372036854775807;
ll n,s,a,b,c;
ll m[20000][20000];
ll dis[20000];
int main(){
    cin >> n >> s;
    for(int i = 1; i <= n; i++){
        for(int j = 1; j <= n; j++){
            m[i][j] = inf;
            m[i][i] = 0;
        }
    }
    for(int i = 1; i <= s; i++){
        cin >> a >> b >> c;
        for(int p = a; p <= b - 1; p++){
            for(int k = p + 1; k <= b; k++){
                if(m[p][k] > c){
                    m[p][k] = c;
                }
            }
        }
    }
    for(int i = 1; i <= n; i++){
        dis[i] = m[1][i];
    }
    int num;
    int s = 2;
    while(s <= n){
    for(int i = s; i <= n; i++){
    ll min = inf;
        if(dis[i] < min){
            min = dis[i];
            num = i;
        }
        for(int i = 1; i <= n; i++){
            if((m[num][i] != inf) && (m[num][i] != 0) && (dis[i] >= dis[num]+m[num][i])){
                    dis[i] = dis[num] + m[num][i];
            }
        }
    }
        s++;
    }
    //  for(int i = 1; i <= n; i++){
    //     cout << dis[i] << ' ';
    // }
    // cout << endl;
    if(dis[n] == inf) {
        cout << -1 << endl;
    }
    else {
        cout << dis[n] << endl;
    }
    return 0;
}

Compiler output:
/tmp/ccqO3nol.o: in function `main':
a.cc:(.text+0x214): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccqO3nol.o
a.cc:(.text+0x267): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccqO3nol.o
a.cc:(.text+0x285): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccqO3nol.o
a.cc:(.text+0x31f): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccqO3nol.o
a.cc:(.text+0x337): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccqO3nol.o
a.cc:(.text+0x37f): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccqO3nol.o
a.cc:(.text+0x3c3): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccqO3nol.o
a.cc:(.text+0x42b): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccqO3nol.o
a.cc:(.text+0x47c): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccqO3nol.o
collect2: error: ld returned 1 exit status
Language: C++

#include <cstdio>
#include <iostream>
using namespace std;
typedef long long int ll;
const ll inf = 9223372036854775807;
ll n,s,a,b,c;
ll m[90000][90000];
ll dis[90000];
int main(){
    cin >> n >> s;
    for(int i = 1; i <= n; i++){
        for(int j = 1; j <= n; j++){
            m[i][j] = inf;
            m[i][i] = 0;
        }
    }
    for(int i = 1; i <= s; i++){
        cin >> a >> b >> c;
        for(int p = a; p <= b - 1; p++){
            for(int k = p + 1; k <= b; k++){
                if(m[p][k] > c){
                    m[p][k] = c;
                }
            }
        }
    }
    for(int i = 1; i <= n; i++){
        dis[i] = m[1][i];
    }
    int num;
    int s = 2;
    while(s <= n){
    for(int i = s; i <= n; i++){
    ll min = inf;
        if(dis[i] < min){
            min = dis[i];
            num = i;
        }
        for(int i = 1; i <= n; i++){
            if((m[num][i] != inf) && (m[num][i] != 0) && (dis[i] >= dis[num]+m[num][i])){
                    dis[i] = dis[num] + m[num][i];
            }
        }
    }
        s++;
    }
    //  for(int i = 1; i <= n; i++){
    //     cout << dis[i] << ' ';
    // }
    // cout << endl;
    if(dis[n] == inf) {
        cout << -1 << endl;
    }
    else {
        cout << dis[n] << endl;
    }
    return 0;
}

Compiler output:
/tmp/ccEJyLVJ.o: in function `main':
a.cc:(.text+0x214): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccEJyLVJ.o
a.cc:(.text+0x267): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccEJyLVJ.o
a.cc:(.text+0x285): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccEJyLVJ.o
a.cc:(.text+0x31f): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccEJyLVJ.o
a.cc:(.text+0x337): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccEJyLVJ.o
a.cc:(.text+0x37f): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccEJyLVJ.o
a.cc:(.text+0x3c3): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccEJyLVJ.o
a.cc:(.text+0x42b): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccEJyLVJ.o
a.cc:(.text+0x47c): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccEJyLVJ.o
collect2: error: ld returned 1 exit status
Language: C++

#include <cstdio>
#include <iostream>
using namespace std;
typedef long long int ll;
const ll inf = 9223372036854775807;
ll n,s,a,b,c;
ll m[100000][100000];
ll dis[100000];
int main(){
    cin >> n >> s;
    for(int i = 1; i <= n; i++){
        for(int j = 1; j <= n; j++){
            m[i][j] = inf;
            m[i][i] = 0;
        }
    }
    for(int i = 1; i <= s; i++){
        cin >> a >> b >> c;
        for(int p = a; p <= b - 1; p++){
            for(int k = p + 1; k <= b; k++){
                if(m[p][k] > c){
                    m[p][k] = c;
                }
            }
        }
    }
    for(int i = 1; i <= n; i++){
        dis[i] = m[1][i];
    }
    int num;
    int s = 2;
    while(s <= n){
    for(int i = s; i <= n; i++){
    ll min = inf;
        if(dis[i] < min){
            min = dis[i];
            num = i;
        }
        for(int i = 1; i <= n; i++){
            if((m[num][i] != inf) && (m[num][i] != 0) && (dis[i] >= dis[num]+m[num][i])){
                    dis[i] = dis[num] + m[num][i];
            }
        }
    }
        s++;
    }
    //  for(int i = 1; i <= n; i++){
    //     cout << dis[i] << ' ';
    // }
    // cout << endl;
    if(dis[n] == inf) {
        cout << -1 << endl;
    }
    else {
        cout << dis[n] << endl;
    }
    return 0;
}

Compiler output:
/tmp/ccNucYsw.o: in function `main':
a.cc:(.text+0x214): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccNucYsw.o
a.cc:(.text+0x267): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccNucYsw.o
a.cc:(.text+0x285): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccNucYsw.o
a.cc:(.text+0x31f): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccNucYsw.o
a.cc:(.text+0x337): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccNucYsw.o
a.cc:(.text+0x37f): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccNucYsw.o
a.cc:(.text+0x3c3): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccNucYsw.o
a.cc:(.text+0x42b): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccNucYsw.o
a.cc:(.text+0x47c): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccNucYsw.o
collect2: error: ld returned 1 exit status
Language: C++

#include <cstdio>
#include <iostream>
using namespace std;
const int inf = 990990990;
int n,s;
int a,b,c;
int m[200000][200000];
int dis[200000];
int main(){
    cin >> n >> s;
    for(int i = 1; i <= n; i++){
        for(int j = 1; j <= n; j++){
            m[i][j] = inf;
            m[i][i] = 0;
        }
    }
    for(int i = 1; i <= s; i++){
        cin >> a >> b >> c;
        for(int p = a; p <= b - 1; p++){
            for(int k = p + 1; k <= b; k++){
                if(m[p][k] > c){
                    m[p][k] = c;
                }
            }
        }
    }
    for(int i = 1; i <= n; i++){
        dis[i] = m[1][i];
    }
    int num;
    int s = 2;
    while(s <= n){
    for(int i = s; i <= n; i++){
    int min = 10000;
        if(dis[i] < min){
            min = dis[i];
            num = i;
        }
        for(int i = 1; i <= n; i++){
            if((m[num][i] != inf) && (m[num][i] != 0) && (dis[i] >= dis[num]+m[num][i])){
                    dis[i] = dis[num] + m[num][i];
            }
        }
    }
        s++;
    }
    //  for(int i = 1; i <= n; i++){
    //     cout << dis[i] << ' ';
    // }
    // cout << endl;
    if(dis[n] == inf) {
        cout << -1 << endl;
    }
    else {
        cout << dis[n] << endl;
    }
    return 0;
}

Compiler output:
/tmp/ccEvusBr.o: in function `main':
a.cc:(.text+0x1db): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccEvusBr.o
a.cc:(.text+0x21f): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccEvusBr.o
a.cc:(.text+0x23b): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccEvusBr.o
a.cc:(.text+0x2c8): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccEvusBr.o
a.cc:(.text+0x2df): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccEvusBr.o
a.cc:(.text+0x323): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccEvusBr.o
a.cc:(.text+0x364): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccEvusBr.o
a.cc:(.text+0x3b7): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccEvusBr.o
a.cc:(.text+0x400): relocation truncated to fit: R_X86_64_PC32 against symbol `dis' defined in .bss section in /tmp/ccEvusBr.o
collect2: error: ld returned 1 exit status