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

#include <bits/stdc++.h>

#include <atcoder/all>
#include <atcoder/mincostflow>
#include <atcoder/twosat.hpp>
#include <vector>
using namespace atcoder;

using namespace std;
using ll = long long;

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

    // mcf_graph<int, int> graph(N + 1);
    // for (int i = 0; i < N; i++) {
    // int a;
    // cin >> a;
    // for (int j = 0; j <= i; j++) {
    // graph.add_edge(j, i + 1, a, 1);
    // }
    // // graph.add_edge(i, i + 1, a, 1);
    // }

    // pair<int, int> p = graph.flow(0, N, K);
    // cout << p.first << " " << p.second << endl;
    vector<int> A(N);
    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }

    two_sat ts(N);
    for (int i = 0; i < N; i++) {
        for (int j = i + 1; j < N; j++) {
            if (abs(A[i] - A[j]) > K) {
                ts.add_clause(i, true, j, true);
            }
        }
    }

    if (!ts.satisfiable()) {
        cout << "No" << endl;
        return 0;
    }

    vector<bool> ans = ts.answer();
    int output = 0;
    for (int i = 0; i < N; i++) {
        if (ans[i]) output++;
    }

    cout << output << endl;

    return 0;
}


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

#include<atcoder/all>
#include<iostream>
using namespace std;
using namespace atcoder;

int op(int a, int b) { return max(a, b); }
int e() { return 0; }

int main() {
  int N,K; cin>>N>>K;
  segtree<int, op, e> s(300010);
  int max_l = 0;
  for (int i = 0; i < N; i++) {
    int a;cin>>a;
    int prod = s.prod(max(0, a-K), min(300010, a+K+1));
    max_l = max(max_l, prod+1);
    s.set(a, prod+1);
  }
  cout<<max_l<<endl;
}

Compiler output:
a.cc:1:9: fatal error: atcoder/all: No such file or directory
    1 | #include<atcoder/all>
      |         ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
#include<atcoder/all>

using namespace std;
using namespace atcoder;
using ll = long long;
using ull = unsigned long long;
using P = pair<int,int>;
#define rep(i,n) for(ll i = 0;i < (ll)n;i++)
#define ALL(x) (x).begin(),(x).end()
#define MOD 1000000007



template<typename T>
class Segtree{
  public:
  using F = function<T(T,T)>;
  int n;
  F f;
  T ti;
  vector<T> dat;
  Segtree(){};
  Segtree(F f,T ti): f(f),ti(ti){}
  void init(int N){
    n = 1;
    while(n < N)n <<= 1;
    dat.assign(n << 1,ti);
  }
  void build(const vector<T> &v){
    int N = v.size();
    init(N);
    rep(i,N)dat[n+i] = v[i];
    for(int i = n-1;i >= 0;i--)dat[i] = f(dat[(i << 1)|0],dat[(i << 1)|1]);
  }
  void set(int k,T x){
    k += n;
    dat[k] = max(dat[k],x);
    while(k >>= 1){
      dat[k] = f(dat[(k << 1)|0],dat[(k << 1)|1]);
    }
  }
  T get(int l,int r){
    T vl = ti,vr = ti;
    for(l += n,r += n;l < r;l >>= 1,r >>= 1){
      if(l & 1)vl = f(vl,dat[l++]);
      if(r & 1)vr = f(dat[--r],vr);
    }
    return f(vl,vr);
  }
};

int main(){
  
  int n,k;
  cin >> n >> k;
  vector<int> v(n);
  rep(i,n)cin >> v[i];
  auto f = [](int a,int b){return max(a,b);};
  Segtree<int> seg(f,-1);
  seg.build(vector<int>(300010,0));
  rep(i,n){
    int s = seg.get(max(0,v[i]-k),min(v[i]+k,300000)+1);
    seg.set(v[i],s+1);
  }
  cout << seg.get(0,300001) << "\n";

  



  return 0;
}

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

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
template <typename T> using vec = vector<T>;
template <typename T> using vvec = vector<vector<T>>;

constexpr int64_t mpow(int64_t a, int64_t b, int64_t mod = 1000000007) {
    if (b <= 0) { return 1; } if (b == 1) { return a % mod; } if (b == 2) { return (a * a) % mod; }
    return (max(a * (b & 1), (int64_t)1) * mpow(mpow(a, b / 2, mod), 2, mod)) % mod;
}
constexpr int64_t mdiv(int64_t a, int64_t b, int64_t mod = 1000000007) {
    return (a * mpow(b, mod - 2, mod)) % mod;
}

int op(int a, int b) {
    return max(a, b);
}
int e() {
    return 0;
}

int main() {
    int n, k; cin >> n >> k;
    vec<int> a(n);
    for (auto &e : a) cin >> e;

    int size = 300000 + 1;
    segtree<int, op, e> dp(size);
    for (int i = 0; i < n; ++i) {
        dp.set(a[i], dp.prod(max(0, a[i] - k), min(size, a[i] + k + 1)) + 1);
    }

    cout << dp.all_prod() << endl;
}



Compiler output:
a.cc:2:10: fatal error: atcoder/all: No such file or directory
    2 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class B {
    private static FastScanner fs = new FastScanner();
    public static void main(String[] args) {

        int n = fs.nextInt();
        int k = fs.nextInt();
        int arr[] = new int [n];
        for(int i=0;i<n;i++) arr[i] = fs.nextInt();
        int dp[] = new int [n];
        Arrays.fill(dp,1);
        for(int i=1;i<n;i++) {
            for (int j = 0; j < i; j++) {
                if(Math.abs(arr[j]-arr[i])<=k)
                {
                    dp[i] = Math.max(dp[i],dp[j]+1);
                }

            }
        }
        System.out.println(dp[n-1]);
    }



    static class FastScanner {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer("");

        String next() {
            while (!st.hasMoreTokens())
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] readArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++) a[i] = nextInt();
            return a;
        }

        long nextLong() {
            return Long.parseLong(next());
        }
        int  gcd(int a,int b)
        {
            while (b > 0)
            {
                int  temp = b;
                b = a % b;
                a = temp;
            }
            return a;
        }
        private int upper(int arr[],int key){
            int low = 0;
            int high = arr.length-1;
            while(low < high){
                int mid = low + (high - low+1)/2;
                if(arr[mid] <= key){
                    low = mid;
                }
                else{
                    high = mid-1;
                }
            }
            return low;
        }
        public int lower(int arr[],int key){
            int low = 0;
            int high = arr.length-1;
            while(low < high){
                int mid = low + (high - low)/2;
                if(arr[mid] >= key){
                    high = mid;
                }
                else{
                    low = mid+1;
                }
            }
            return low;
        }
    }
}

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

#include <iostream>
#include <bitset>
#include <algorithm>        // sort()
#include <vector>           // for vectors
#include <map>              // for ordered map
#include <unordered_map>
#include <list>             // for list
#include <iomanip>          // for setprecision()
#include <cmath>            // for pow(), sqrt(), log(), log10(), ....
#include <cstring>          // for memset()
#include <unordered_set>    // for unordered_set
#include <climits>          // for INT_MAX & INT_MIN
#include <set>     
using namespace std; 

int main() 
{ 
  int n, k, a, b, x;
        cin >> n >> k;
        ll s[n];
        for(ll i=0; i<n; i++) {
            cin >> s[i];
        }
	vector<int> dp(n, 0); 

	int max_length[300001] = {0}; 

	for (int i = 0; i < n; i++) 
	{
		int curr = s[i]; 
		
		int lower = max(0, curr - k); 
		
		int upper = min(300000, curr + k); 
		
		for (int j = lower; j < upper + 1; j++) 
		{ 
			dp[i] = max(dp[i], max_length[j] + 1); 
		} 
		max_length[curr] = max(dp[i], max_length[curr]); 
	} 

	int ans = 0; 

	for(int i:dp) {
      ans = max(i, ans); 
    }
  cout << ans << endl;
	return 0; 
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: 'll' was not declared in this scope
   20 |         ll s[n];
      |         ^~
a.cc:21:15: error: expected ';' before 'i'
   21 |         for(ll i=0; i<n; i++) {
      |               ^~
      |               ;
a.cc:21:21: error: 'i' was not declared in this scope
   21 |         for(ll i=0; i<n; i++) {
      |                     ^
a.cc:22:20: error: 's' was not declared in this scope
   22 |             cin >> s[i];
      |                    ^
a.cc:30:28: error: 's' was not declared in this scope
   30 |                 int curr = s[i];
      |                            ^
Language: C++

#include <iostream>
#include <bitset>
#include <algorithm>        // sort()
#include <vector>           // for vectors
#include <map>              // for ordered map
#include <unordered_map>
#include <list>             // for list
#include <iomanip>          // for setprecision()
#include <cmath>            // for pow(), sqrt(), log(), log10(), ....
#include <cstring>          // for memset()
#include <unordered_set>    // for unordered_set
#include <climits>          // for INT_MAX & INT_MIN
#include <set>     
using namespace std; 

int main() 
{ 
  ll n, k, a, b, x, ans=NINF, ma=NINF;
        cin >> n >> k;
        ll s[n];
        for(ll i=0; i<n; i++) {
            cin >> s[i];
        }
	vector<int> dp(n, 0); 

	int max_length[300001] = {0}; 

	for (int i = 0; i < n; i++) 
	{
		int curr = s[i]; 
		
		int lower = max(0, curr - k); 
		
		int upper = min(300000, curr + k); 
		
		for (int j = lower; j < upper + 1; j++) 
		{ 
			dp[i] = max(dp[i], max_length[j] + 1); 
		} 
		max_length[curr] = max(dp[i], max_length[curr]); 
	} 

	int ans = 0; 

	for(int i:dp) {
      ans = max(i, ans); 
    }
  cout << ans << endl;
	return 0; 
} 

// This code is contributed by Mohit Kumar 


Compiler output:
a.cc: In function 'int main()':
a.cc:18:3: error: 'll' was not declared in this scope
   18 |   ll n, k, a, b, x, ans=NINF, ma=NINF;
      |   ^~
a.cc:19:16: error: 'n' was not declared in this scope; did you mean 'yn'?
   19 |         cin >> n >> k;
      |                ^
      |                yn
a.cc:19:21: error: 'k' was not declared in this scope
   19 |         cin >> n >> k;
      |                     ^
a.cc:20:11: error: expected ';' before 's'
   20 |         ll s[n];
      |           ^~
      |           ;
a.cc:21:15: error: expected ';' before 'i'
   21 |         for(ll i=0; i<n; i++) {
      |               ^~
      |               ;
a.cc:21:21: error: 'i' was not declared in this scope
   21 |         for(ll i=0; i<n; i++) {
      |                     ^
a.cc:22:20: error: 's' was not declared in this scope
   22 |             cin >> s[i];
      |                    ^
a.cc:30:28: error: 's' was not declared in this scope
   30 |                 int curr = s[i];
      |                            ^
Language: C++

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

int main() 
{ 
  ll n, k, a, b, x, ans=NINF, ma=NINF;
        cin >> n >> k;
        ll s[n];
        for(ll i=0; i<n; i++) {
            cin >> s[i];
        }
	vector<int> dp(n, 0); 

	int max_length[300001] = {0}; 

	for (int i = 0; i < n; i++) 
	{
		int curr = s[i]; 
		
		int lower = max(0, curr - k); 
		
		int upper = min(300000, curr + k); 
		
		for (int j = lower; j < upper + 1; j++) 
		{ 
			dp[i] = max(dp[i], max_length[j] + 1); 
		} 
		max_length[curr] = max(dp[i], max_length[curr]); 
	} 

	int ans = 0; 

	for(int i:dp) {
      ans = max(i, ans); 
    }
  cout << ans << endl;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'll' was not declared in this scope
    6 |   ll n, k, a, b, x, ans=NINF, ma=NINF;
      |   ^~
a.cc:7:16: error: 'n' was not declared in this scope; did you mean 'yn'?
    7 |         cin >> n >> k;
      |                ^
      |                yn
a.cc:7:21: error: 'k' was not declared in this scope
    7 |         cin >> n >> k;
      |                     ^
a.cc:8:11: error: expected ';' before 's'
    8 |         ll s[n];
      |           ^~
      |           ;
a.cc:9:15: error: expected ';' before 'i'
    9 |         for(ll i=0; i<n; i++) {
      |               ^~
      |               ;
a.cc:9:21: error: 'i' was not declared in this scope
    9 |         for(ll i=0; i<n; i++) {
      |                     ^
a.cc:10:20: error: 's' was not declared in this scope
   10 |             cin >> s[i];
      |                    ^
a.cc:18:28: error: 's' was not declared in this scope
   18 |                 int curr = s[i];
      |                            ^
Language: C++

// #include "bits/stdc++.h"
#include <bits/stdc++.h>
using namespace std;
// using namespace atcoder;
using ll = long long;

template <typename T>
void print_vec(const vector<T>& v, bool is_reverse=false, ll num=0){
  if(num == 0) num = (ll)v.size();
  cout << endl; cout << "i=  ";for(ll i=0; i<num; i++) cout << i << "   ";cout << endl;  
  cout << "    ";
  if(is_reverse) for(ll i=num-1; i>=0; i--){ cout<<v[i]; if(i!=0) cout<<"   ";}
  else for(ll i=0; i<num; i++){ cout<<v[i]; if(i!=num-1) cout<<"   ";}
  cout << endl;
}

// template <typename T>
// void print_pairvec(const vector<T> &v, ll num=0){
//   if(num == 0) num = (ll)v.size();
//   cout << endl; for(ll i=0; i<num; i++){ cout << v[i].first << " " << v[i].second << endl;}
// }
template <typename T>
void print_pairvec(const T &_pair, ll num=0){
  cout << endl; for(pair<ll, int> x: _pair){ cout << x.first << " " << x.second << endl;}
}

template <typename T>
void print_vec2(const vector<vector<T>>& v){
  cout << endl; cout << "       ";
  for(ll i=0; i<v[0].size(); i++) cout << i << "   "; 
  cout << endl;
	for(ll i=0; i<v.size(); i++){
		cout << "i=" << i << ":   ";
		for(ll j=0; j<v[i].size(); j++){
			if(v[i][j] == 0) cout << "\x1B[0m" << v[i][j] << "   ";
      else cout << "\x1B[31m" << v[i][j] << "   ";//https://stackoverrun.com/ja/q/12618775
		}
		cout << "\x1B[0m" << endl;
	}
}

  
// #include <atcoder/string>
#include <atcoder/all> 
int main(){
  ll n, k;
  cin >> n >> k;
  vector<ll> a(n);
  for(int i=0; i<n; i++) cin >> a[i];

  // const ll MAX =3e5+k + 10;
  // vector<ll> dp(MAX + 5, 0);

  // for(int i=0; i<N; i++){
  //   for(int j)
  // }

  vector<stack<ll>> st;
  for(int i=0; i<n; i++){
    bool is_add = false;
    ll size = (ll)st.size();
    for(int j=0; j<size; j++){
      ll x = st[j].top();
      if(abs(x - a[i]) <= k){ 
        stack<ll> b;
        b = st[j];  
        b.push(a[i]);
        st.push_back(b); 
        is_add = true;
      }
    }

    if(is_add == false){
      stack<ll> b;
      b.push(a[i]);
      st.push_back(b);
    }  
  }


  ll ans = 0;
  for(stack<ll> x: st) ans = max(ans, (ll)x.size());

  cout << ans << endl;




  return 0;
  // cout << fixed;//小数点を確実に10桁で表示するためのもの
  // cout << setprecision(10); 
}


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

#include <atcoder/fenwicktree>
#include <bits/stdc++.h>

using namespace std;
using namespace atcoder;

typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;

#define faster ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define read freopen("in.txt", "r", stdin)
#define write freopen("out.txt", "w", stdout)
#define mem(x, n) memset(x, n, sizeof(x))
#define all(x) x.begin(), x.end()
#define endl "\n"

int main() {
	faster;

	int n, k;
	cin >> n >> k;

	fenwick_tree<int> fw(int(6e5 + 5));
	int mx = 0;

	for (int i = 0; i < n; i++) {
		int x;
		cin >> x;
		fw.add(x, 1);
		int high = x + k, low = x-k;
		if(low < 0) low = 0;
		mx=max(mx,int(fw.sum(low,high)));
	}

	cout << mx << endl;

	return 0;
}

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

#include <atcoder/fenwicktree>
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;

#define faster ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define read freopen("in.txt", "r", stdin)
#define write freopen("out.txt", "w", stdout)
#define mem(x, n) memset(x, n, sizeof(x))
#define all(x) x.begin(), x.end()
#define endl "\n"

int main() {
	faster;

	int n, k;
	cin >> n >> k;

	fenwick_tree<int> fw(int(3e5 + 5));
	int mx = 0;

	for (int i = 0; i < n; i++) {
		int x;
		cin >> x;
		fw.add(x, 1);
		mx=max(mx,int(fw.sum(x-k,x+k)));
	}

	cout << mx << endl;

	return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
#define BE(x) x.begin(), x.end()

int main() {
    int n, k;
    cin >> n >> k;
    vector<int> a(n);
    for (int i = 0; i < n; i++) cin >> a[i];

    vector<int> b(n);
    b.back() = 1;
    for (int i = n-2; i >= 0; i--) {
        int cnt = 1;
        for (int j = i+1; j < n; j++) {
            if (abs(a[i]-a[j]) <= k)
                cnt = max(b[j]+1, cnt);
        }
        b[i] = cnt;
    }
    cout << b[0] << endl;
}


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

#include<stdio.h>
int main(void){
    int i,j,k;
    int x = 0;
    int count = 1;
    scanf("%d",&k);
    int abc[k-1];
    for(i=0;i<k;i++){
        scanf("%d",&abc[i]);
    }
    for(j=1;j<k;j++){
        if(abc[x] >= abc[j]){
        if ((abc[x] - abc[j])<k){
        count = count + 1;
        x = x + 1;
        }
        else 
        {
            if ((abc[j] - abc[x])<k){
            count = count + 1;
            x = x + 1;
        }
        
    }
    }
    printf("%d",count);
    return 0;

}

Compiler output:
main.c: In function 'main':
main.c:29:1: error: expected declaration or statement at end of input
   29 | }
      | ^
Language: C++

#include<bits/stdc++.h>

using namespace std;
int abslt (int a,int b){
  if(a>b) return a-b;
  else return b-a;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n,k;
  cin>>n>>k;
  vector<int> a(n);
  for (int i=0;i<n-1;i++){
  	cin>> a[i];
  }
 sort(a.begin() ,a.end());
  int max=0;
  int c=0;
  for(int i=0;i<n-1;i++){
  	if( a[i+1]-a[i]<=k ){
  		if(c==1){
  			max++;
  		}else{
  			if(prev-a[i]<=k){
  			c=1;
  			max+=2;
  		}
  		}
  	}else{
  		c=0;
  	}
  }
   cout<<max;
   return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:32: error: invalid operands of types '<unresolved overloaded function type>' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} to binary 'operator-'
   26 |                         if(prev-a[i]<=k){
Language: C++

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

int op(int a, int b) {
    return max(a, b);
}

int e() {
    return (int)(0);
}

segtree<int, op, e> seg(600600);

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, k;
    cin >> n >> k;
    vector<int> a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }

    int ans = 0;
    const int geta = 300300;
    for (int i = 0; i < n; ++i) {
        int l = a[i] - k, r = a[i] + k + 1;
        auto cur = seg.prod(geta + l, geta + r);
        cur++;
        ans = max(ans, cur);
        seg.set(geta + a[i], cur);
    }
    cout << ans << endl;
}




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

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define fi first
#define se second
long long mo = 1000000007;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
typedef pair<ll,Pll> PlP;
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
template<class A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}cout << "\n";}
ld PI=3.14159265358979323846;
using namespace atcoder;

int op(int a, int b) {
    return max(a, b);
}

int e() {
    return (int)(0);
}

int target = 0;

int main(){
    int N,K;
    cin >> N >> K;
    vector<int> A(N);//memo(N+1);
    rep(i,N){
        cin >> A[i];
    }
    segtree<int, op, e> seg(int(600010));
    rep(i,N){
        ll tmp = seg.prod(max(A[i]-K, 0), A[i]+K+1);
        seg.set(A[i],tmp+1);
    }

    cout << seg.all_prod() << endl;
}

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

#include<bits/stdc++.h>

using namespace std;
int abslt (int a,int b){
  if(a>b) return a-b;
  else return b-a;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n,k;
  cin>>n>>k;
  vector<int> a(n);
  for (int i=0;i<n-1;i++){
  	cin>> a[i];
  }
 a.sort(a.begin() ,a.end());
  int max=0;
  int c=0;
  for(int i=0;i<n;i++){
  	if( a[i+1]-a[i]<=k ){
  		if(c==1){
  			max++;
  		}else{
  			c=1;
  			max+=2;
  		}
  	}else{
  		c=0;
  	}
  }
   cout<<max;
   return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:4: error: 'class std::vector<int>' has no member named 'sort'
   18 |  a.sort(a.begin() ,a.end());
      |    ^~~~
Language: C++

signed main(){
  ios_base::sync_with_stdio(0); 
  cin.tie(0);
  // freopen("FDT.txt", "r", stdin);
  lazy_segment_tree tr;
  int n, k;
  cin >> n >> k;
  tr.init(300000);
  vector<int> a(n + 1);
  for(int i = 1; i <= n; i ++) cin >> a[i];
  for(int i = n; i >= 1; i --){
    int lf = a[i] - k;
    if(lf < 0) lf = 0;
    int rt = a[i] + k;
    if(rt > 300000) rt = 300000;
    int d = tr.get(1, 1, 300000, lf, rt);
    if(d < 0) d = 0;
    d ++;
    tr.update(1, 1, 300000, a[i], a[i], d);
  }
  cout << tr.get(1, 1, 300000, 0, 300000);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:2:3: error: 'ios_base' has not been declared
    2 |   ios_base::sync_with_stdio(0);
      |   ^~~~~~~~
a.cc:3:3: error: 'cin' was not declared in this scope
    3 |   cin.tie(0);
      |   ^~~
a.cc:5:3: error: 'lazy_segment_tree' was not declared in this scope
    5 |   lazy_segment_tree tr;
      |   ^~~~~~~~~~~~~~~~~
a.cc:8:3: error: 'tr' was not declared in this scope
    8 |   tr.init(300000);
      |   ^~
a.cc:9:3: error: 'vector' was not declared in this scope
    9 |   vector<int> a(n + 1);
      |   ^~~~~~
a.cc:9:10: error: expected primary-expression before 'int'
    9 |   vector<int> a(n + 1);
      |          ^~~
a.cc:10:39: error: 'a' was not declared in this scope
   10 |   for(int i = 1; i <= n; i ++) cin >> a[i];
      |                                       ^
a.cc:12:14: error: 'a' was not declared in this scope
   12 |     int lf = a[i] - k;
      |              ^
a.cc:21:3: error: 'cout' was not declared in this scope
   21 |   cout << tr.get(1, 1, 300000, 0, 300000);
      |   ^~~~
Language: C++

// #include "pch.h"
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <climits>
#include <string>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>
#include <ctime>
#include <cassert>
#include <fstream>
#include <stack>
#include <random>
#include <atcoder/segtree>

typedef long long ll;
typedef std::pair<int, int> Pii;
typedef std::pair<long long, long long> Pll;
typedef std::pair<double, double> Pdd;

#define rip(i, n, s) for (int i = (s);i < (int)( n ); i++)
#define all(a) a.begin(), a.end()
#define MM << " " <<

template<typename T>
using MaxHeap = std::priority_queue<T>;
template<typename T>
using MinHeap = std::priority_queue<T, std::vector<T>, std::greater<T>>;

template<typename T>
inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template<typename T>
inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}

template<typename T>
void vdeb(std::vector<T> &bb) {
    for (int i = 0;i < bb.size();i++) {
        if (i == bb.size() - 1) std::cout << bb[i];
        else std::cout << bb[i] << ' ';
    }
    std::cout << '\n';
}
template<typename T>
void vdeb(std::vector<std::vector<T>> &bb) {
    for (int i = 0;i < bb.size();i++) {
        std::cout << i << ' ';
        vdeb(bb[i]);
    }
    std::cout << '\n';
}

int op(int a, int b) {return std::max(a, b);}
int e() {return 0;}

using namespace std;

int main() {
    int n, k; cin >> n >> k;
    vector<int> da(n);
    rip(i,n,0) {
        cin >> da[i];
    }
    atcoder::segtree<int, op, e> st(300300);
    vector<int> dp(n);
    int ans = 0;
    rip(i,n,0) {
        int now = st.prod(max(da[i]-k, 0), min(da[i]+k+1, 300300));
        dp[i] = now+1;
        // cout << dp[i];
        st.set(da[i], dp[i]);
        chmax(ans, dp[i]);
    }
    cout << ans << endl;

}

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

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

int op(int a, int b){
    return max(a, b);
}

int e(){
    return 0;
}


signed main(){
    // cout << fixed << setprecision(10) << flush;

    int n, k;
    cin >> n >> k;
    vector<int> a(n);
    for(int i=0; i<n; i++){
        cin >> a[i];
    }

    segtree<int, op, e> sg(300001);

    for(int i=0; i<n; i++){
        int l = max(0, a[i]-k);
        int r = min(300000, a[i]+k);
        int next = max(sg.get(a[i]), sg.prod(l, r+1)+1);
        sg.set(a[i], next);
    }

    cout << sg.all_prod() << endl;


    return 0;
}

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

#include<iostream>
#include<vector>
#include<functional>
#include<atcoder/all>
using namespace std;
typedef long long li;
#define minimize(a,b) (a>(b)?a=(b),1:0)
#define maximize(a,b) (a<(b)?a=(b),1:0)
#define N_MAX 300010
#define M_MAX 1000000001
#define rep(i,n) for(int i=0;i<(n);i++)
#define df 0
template<class T> void print(const T& t){ cout << t << "\n"; }
template<class T, class... Ts> void print(const T& t, const Ts&... ts) { cout << t; if (sizeof...(ts)) cout << " "; print(ts...); }

struct mono{
  li ma;
  mono(li a=0){ma=a;};
};

mono e(){
  return mono();
}

mono op(mono m,mono n){
  return {max(m.ma,n.ma)};
}
// pair 型
std::ostream& operator<<(std::ostream& os, const mono& p){
  cout << p.ma ;
  return os;
}


int main(){
  int n,k; cin >>n >>k;
  atcoder::segtree<mono,op,e> sgt(k+N_MAX);
  rep(i,n){
    li x; cin >>x;
    li a=x-k,b=x+k+1;
    maximize(a,0); minimize(b,k+N_MAX);
    li m=sgt.prod(a,b).ma;
    if(df)print(a,b,m);
    sgt.set(x,m+1);
  }
  print(sgt.prod(0,N_MAX));
}


Compiler output:
a.cc:4:9: fatal error: atcoder/all: No such file or directory
    4 | #include<atcoder/all>
      |         ^~~~~~~~~~~~~
compilation terminated.
Language: C++


#include <string>
#include <vector>
#include <iostream>

#include <atcoder/lazysegtree.hpp>
#include <atcoder/modint.hpp>

#ifdef USE_PYTHON_LIKE_PRINT
#include "print.h"
#else
template<char SEP = ' ', char END = '\n'> inline void print(...){}
template<char SEP = ' ', char END = '\n'> inline void printe(...){}
template<char SEP = ' ', char END = '\n'> inline void printo(...){}
#define define_print(...)
#define define_print_with_names(...)
#define define_to_tuple(...)
#endif

using namespace std;

// apply(l, r, f)で、l～r-1の範囲の値をf増やす。
// prod(l, r)で、l～r-1の範囲の最大値を求める。
typedef int S;
typedef int F;
S op(S a, S b) { return a * b; }
S e() { return 1; }
S mapping(F f, S a) { return f + a; }
F composition(F f, F g) { return f + g; }
F id() { return 0; }

int main(void){
	int N, K;
	cin >> N;
	cin >> K;
	
	atcoder::lazy_segtree<S, op, e, F, mapping, composition, id> st(vector<S>(N + 1, 0));
	
	int A;
	cin >> A;
	st.apply(A, A + 1, 1);
	
	for(int i = 1; i < N; i ++){
		cin >> A;
		st.apply(max(A - K, 0), min(A + K, N), 1);
	}
	
	int result = 0;
	for(int i = 0; i < N; i ++){
		int count = st.prod(i, i + 1);
		if(count > result){
			result = count;
		}
	}
	cout << result << endl;
	
	return 0;
}


Compiler output:
a.cc:6:10: fatal error: atcoder/lazysegtree.hpp: No such file or directory
    6 | #include <atcoder/lazysegtree.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<atcoder/all>
using namespace atcoder;

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

int f(int a, int b) { return max(a, b); }
int e() { return 0; }

int main() {
    int N, K; cin >> N >> K;
    int A[300000]; rep(i, N) cin >> A[i];
    segtree<int, f, e> G(300001);
    int ans = 0;
    rep(i, N) {
        int tmp = 0;
        if (i) tmp = G.prod(max(0, A[i] - K), min(300001, A[i] + 1 + K));
        ans = max(ans, tmp + 1);
        G.set(A[i], tmp + 1);
    }

    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc:1:9: fatal error: atcoder/all: No such file or directory
    1 | #include<atcoder/all>
      |         ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
#include<atcoder/all>
using namespace atcoder;
using mint = modint998244353;
//using mint = modint1000000007;
#define rep(i, n) for (int i = 0; i < n; i++)
#define all(x)(x).begin(), (x).end() // 昇順ソート
#define rall(v)(v).rbegin(), (v).rend() // 降順ソート
#define INF 1LL << 60
typedef long long int LL;
typedef long long int ll;
#define pll pair < ll, ll >
#define F first
#define S second
const int MOD = 1000000007;
template < class T > bool chmax(T & a,const T & b) { if (a < b) { a = b; return true; } return false; }
template < class T > bool chmin(T & a,const T & b) { if (a > b) { a = b; return true; } return false; }
// 任意のlogは　対数の底の変換を使う    log(N) / log(任意の底)

vector<mint> ten,one;

// コンストラクタ
lazy_segtree<S, op, e, F, mapping, composition, id> seg(int n);
lazy_segtree<S, op, e, F, mapping, composition, id> seg(vector<T> v);

struct S {
    mint val;
    mint len;
};

S op(S sl,S sr){
    return {sl.val * ten[sr.len] + sr.val , sl.len + sr.len};
}

S e(){
    return {0,0};
}

struct F {
    mint a;
};

S mapping(F f,S s){
    if(f.a == -1)return s;// 恒等写像
    return {f.a * one[s.len] , s.len};
}

F composition(F f,F g){
    if(f.a == -1)return g;
    return f;
}

F id(){
    return -1;
}


int main() {
    int N,Q;cin >> N >> Q;
    ten.resize(N+1,0);
    one.resize(N+1,0);
    ten[0] = 1;
    rep(i,N)ten[i+1] = ten[i] * 10;
    rep(i,N)one[i+1] = one[i] + ten[i];

    lazy_segtree<S, op, e, F, mapping, composition, id> seg(vector<S>(N,{1,1}));

    rep(_,Q){
        int l,r,d;cin >> l >> r >> d;
        l--;
        seg.apply(l,r,d);
        cout << seg.all_prod().val.val() << endl;
    }
}

Compiler output:
a.cc:3:9: fatal error: atcoder/all: No such file or directory
    3 | #include<atcoder/all>
      |         ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define chmax(x,y) x = max(x,y);
#define chmin(x,y) x = min(x,y);
const int di[] = {-1, 0, 1, 0};
const int dj[] = {0, -1, 0, 1};
const int INF = 1001001001;

struct S {
    mint x, w;
    S(mint x=0, mint w=1):x(x),w(w) {}
};

S op(S a, S b) {
    return S(a.x*b.w + b.x, a.w*b.w);
}

S e() { return S();}

S mapping(int f, S a) {
    if (f == 0) return a;
    return S((a.w-1)*inv9*f, a.w);
}

int composition(int f, int g) {
    if (f == 0) return g;
    return f;
}

int id() { return 0;}

int main() {
    int n, q;
    cin >> n >> q;

    lazy_segtree<S,op,e,int,mapping,composition,id> t(n);
    rep(i,n) t.set(i, S(1,10));
    rep(qi,q) {
        int l, r, d;
        cin >> l >> r >> d;
        l--;
        t.apply(l,r,d);
        S ans = t.prod(0,n);
        cout << ans.x.val() << endl;
    }
    return 0;
}

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

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

using ll = long long;
using ull = unsigned long long;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
#define rep(i, n) REP(i, 0, n)
#define rep_rev(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
#define all(x) (x).begin(),(x).end()
ll t1,t2,t3;
const ll mod = 998244353;
const int INF = 1e9;
const ll INFLONG = 1e18;

vector<ll> score(200000);

using mint = modint998244353;

struct S {
    mint a;
    int size;
};

struct F {
    mint a, b;
};

S op(S l, S r) { return S{l.a + r.a, l.size + r.size}; }

S e() { return S{0, 0}; }

S mapping(F l, S r) { return S{r.a * l.a + r.size * l.b, r.size}; }

F composition(F l, F r) { return F{r.a * l.a, r.b * l.a + l.b}; }

F id() { return F{1, 0}; }

int main(){
    ll n,q;
    cin >> n >> q;
    vector<S> a(n);
    vector<ll> ans(q,1);
    t1 = 1;
    rep(i,n){
        score[n-1-i] = t1;
        ans[0] += t1;
        ans[0] %= mod;
        a[i] = S{1, 1};
        t1 *- 10;
        t1 %= mod;
    }
    lazy_segtree<S, op, e, F, mapping, composition, id> seg(a);
    ll ch;
    rep(i,q){
        cin >> t1 >> t2 >> t3;
        t1--,t2--;
        ch = mod - seg.prod(t1,t2).a.val();
        seg.apply(t1,t2,F{})
    }
    rep(i,q){
        cout << ans[i+1] << endl;
    }
}

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

#include <atcoder/lazysegtree>
#include <atcoder/modint>
#include <cstdio>
 
using namespace std;
using namespace atcoder;
 
using mint = modint998244353;

const int N=200005;
const mint in = mint(9).inv();
const minus_=mint(1);

mint A[N];

struct S {
    mint a;
    int size;
};
 
struct F {
    mint d;
    int time;
};
 
S op(S l, S r) { 
    return S{l.a*A[r.size] + r.a, l.size + r.size}; 
}
 
S e() { return S{0, 0}; }
 
S mapping(F l, S r) { 
    if(l.time==-1)
        return r;

    mint nw = (A[r.size]-minus_)*in*l.d;
    return S{nw,r.size}; 
}
 
F composition(F l, F r) {
     return l.time > r.time ? l : r; 
}
 
F id() { return F{0, -1}; }
 
int main() {
    int n, q;
    scanf("%d %d", &n, &q);
    
    vector<S> a(n);
    A[0]=mint(1);
    mint aa=mint(10);

    for (int i = 0; i < n; i++) {
        a[i] = S{1, 1};
        A[i+1]=aa*A[i];
    }
 
    lazy_segtree<S, op, e, F, mapping, composition, id> seg(a);
    
    //std::cout << seg.prod(1,n).a.val() << std::endl;
    for (int i = 0; i < q; i++) {
        int l, r, d;
        scanf("%d %d %d", &l, &r, &d);
        l--;
        r--;
        r++;
        seg.apply(l, r, F{mint(d), i});
        
        printf("%d\n", seg.prod(0,n).a.val());
    }
}

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

#include <atcoder/lazysegtree>
#include <atcoder/modint>
#include <cstdio>
 
using namespace std;
using namespace atcoder;
 
using mint = modint998244353;

const int N=200005;
const mint in = mint(9).inv();
const minus=mint(1);

mint A[N];

struct S {
    mint a;
    int size;
};
 
struct F {
    mint d;
    int time;
};
 
S op(S l, S r) { 
    return S{l.a*A[r.size] + r.a, l.size + r.size}; 
}
 
S e() { return S{0, 0}; }
 
S mapping(F l, S r) { 
    if(l.time==-1)
        return r;

    mint nw = (A[r.size]-minus)*in*l.d;
    return S{nw,r.size}; 
}
 
F composition(F l, F r) {
     return l.time > r.time ? l : r; 
}
 
F id() { return F{0, -1}; }
 
int main() {
    int n, q;
    scanf("%d %d", &n, &q);
    
    vector<S> a(n);
    A[0]=mint(1);
    mint aa=mint(10);

    for (int i = 0; i < n; i++) {
        a[i] = S{1, 1};
        A[i+1]=aa*A[i];
    }
 
    lazy_segtree<S, op, e, F, mapping, composition, id> seg(a);
    
    //std::cout << seg.prod(1,n).a.val() << std::endl;
    for (int i = 0; i < q; i++) {
        int l, r, d;
        scanf("%d %d %d", &l, &r, &d);
        l--;
        r--;
        r++;
        seg.apply(l, r, F{mint(d), i});
        
        printf("%d\n", seg.prod(0,n).a.val());
    }
}

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

//Let's join Kaede Takagaki Fan Club !!
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <atcoder/all>
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace atcoder;
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 fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int 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())
#define all(x) x.begin(),x.end()
template<class T>
void dmp(T a){
	rep(i,a.size()) cout << a[i] << " ";
	cout << endl;
}
template<class T>
bool chmax(T&a, T b){
	if(a < b){
		a = b;
		return 1;
	}
	return 0;
}
template<class T>
bool chmin(T&a, T b){
	if(a > b){
		a = b;
		return 1;
	}
	return 0;
}
template<class T>
void g(T &a){
	cin >> a;
}
template<class T>
void o(const T &a,bool space=false){
	cout << a << (space?' ':'\n');
}
//ios::sync_with_stdio(false);
const ll mod = 998244353;
template<class T>
void add(T&a,T b){
	a+=b;
	if(a >= mod) a-=mod;
}
struct S{
	ll sum, sum_base;
};
struct F{
	ll ch_digit;
};
S op(S l, S r){ return S{(l.sum+r.sum)%mod, (l.sum_base+r.sum_base)%mod}; }
S e(){ return S{0, 0}; }
S mapping(F l, S r){
	if(l.ch_digit == -1) return r;
	else return S{r.sum, (r.sum*l.ch_digit)%mod};
}
F composition(F l, F r){
	if(l.ch_digit == -1) return r;
	return l;
}
F id(){
	return F{-1};
}
int n, q;
int main(){
	cin >> n >> q;
	vector<S>ini;
	ll v = 1;
	for(int i=0;i<n;i++){
		ini.pb(S{v, v});
		v = v * 10LL % mod;
	}
	reverse(ini.begin(), ini.end());
	lazy_segtree<S, op, e, F, mapping, composition, id>kaede(ini);
	rep(i, q){
		int l, r; ll d; cin >> l >> r >> d; l--;
		kaede.apply(l, r, F{d});
		cout << kaede.all_prod().sum << '\n';
	}
}

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

#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using namespace atcoder;
typedef long long ll;
constexpr int Inf = 2100000010;
constexpr ll INF= 2000000000000000000;
constexpr ll MOD = 998244353;
const double PI = 3.1415926535897;
typedef pair<int,int> P;
typedef pair<int,P> PP;

template<class T> inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}

template<class T> inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return 1;
    }
    return 0;
}

ll mod(ll val, ll M) {
    val = val % M;
    if(val < 0) {
        val += M;
    }
    return val;
}

template<typename T>
T RS(T N, T P, T M){
    if(P == 0) {
        return 1;
    }
    if(P < 0) {
        return 0;
    }
    if(P % 2 == 0){
        ll t = RS(N, P/2, M);
        if(M == -1) return t * t;
        return t * t % M;
    }
    if(M == -1) {
        return N * RS(N,P - 1,M);
    }
    return N * RS(N, P-1, M) % M;
}

vector<ll> one(200020);

struct S {
    int len;
    ll val;
};

S op(S a,S b) {
    return S{a.len + b.len,(a.val * RS(10ll,(ll)b.len,MOD) + b.val) % MOD};
}

S e() {
    return S{0,0};
}

S mapping(int a,S x) {
    if(a == 0) {
        return x;
    }
    else {
        return S{x.len,one.at(x.len) * a % MOD};
    }
}

int composition(int f,int g) {
    if(f == 0) {
        return g;
    }
    else {
        return f;
    }
}

int id() {
    return 0;
}

int main() {
    int N,Q;
    cin >> N >> Q;
    for(int i = 1;i < N;i++) {
        one.at(i) = (one.at(i - 1) * 10 + 1) % MOD;
    }
    lazy_segtree<S,op,e,int,mapping,composition,id> seg(N);
    for(int i = 0;i < N;i++) {
        seg.set(i,S{1,1});
    }
    for(int i = 0;i < Q;i++) {
        int L,R,D;
        cin >> L >> R >> D;
        L--;
        R--;
        seg.apply(L,R + 1,D);
        S ret = seg.all_prod();
        cout << ret.val << endl;
    }
}

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

#include <atcoder/all>
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using namespace atcoder;
using ll = long long;
using P = pair<int,int>;

using mint=modint998244353;
const mint inv9 = mint(1)/9;
struct S {
	mint x,w;
	S(mint x=0, mint w=1): x(x), w(w) {}
};

S op(S a, S b) {
	return S(a.x * b.w + b.x, a.w*b.w);
}
S e() {return S();}

S mapping(int f, S a) {
	if (f ==0) return a;
	return S((a.w-1)*inv9*f,a.w);
}

int composition(int f, int g){
	if (f == 0) return g;
	return f;
}

int id() { return 0;}

int main() {
	int n,q;
	cin >> n >> q;
	lazy_segtree<S,op,e,int, mapping, composition, id> t(n);
	rep(i,n) t.set(i, S(1,10));
	rep(i,q) {
		int l,r,d;
		cin >> l >> r >> d;
		l--;
		t.apply(l, r, d);
		S ans = t.prod(0,n);
		printf("%d\n",ans.x.val());
	}
	return 0;
}


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

#include <iostream>
#include <unordered_map>
#include <algorithm>
using namespace std;
const int N=100010;
unordered_map<int,int> mp;
int A[N];int B[N];
int id[N];
int tr[N<<2];
void pushup(int u){
    tr[u]=max(tr[u<<1],tr[u<<1|1]);
}
void update(int l,int r,int a,int b,int d,int u)
{
    if(l<=a&&b<=r){
        tr[u]=max(tr[u],d);
        return ;
    }
    int mid=a+b>>1;
    if(l<mid)update(l,r,a,mid,d,u<<1);
    if(r>=mid)update(l,r,mid+1,r,d,u<<1|1);
    pushup(u);
}
int query(int l,int r,int a,int b,int u){
    if(l<=a&&b<=r){
        return tr[u];
    }
    int mid=a+b>>1;
    int maxv=0;
    if(l<mid)maxv=max(maxv,query(l,r,a,mid,u<<1));
    if(r>=mid)maxv=max(maxv,query(l,r,mid+1,r,u<<1|1));
    return maxv;
}
int main()
{
    int n,k;
    cin>>n>>k;
    for(int i=1;i<=n;++i){
        cin>>A[i];
        B[i]=A[i];
    }
    sort(B+1,B+n+1);
    int tot=1;
    for(int i=2;i<=n;++i){
        if(B[tot]!=B[i])B[++tot]=B[i];
    }
    int num=0;
    for(int i=1;i<=tot;++i)mp[B[i]]=++num;
    for(int i=1;i<=n;++i){
        id[i]=mp[A[i]];
    }
    for(int i=1;i<=n;++i){
        int tl=A[i]-k,tr=A[i]+k;
        int kl,kr;
        int l=1,r=tot;
        while(l<r){
            int mid=l+r>>1;
            if(B[mid]>=tl)r=mid;
            else l=mid+1;
        }
        kl=l;
        l=1,r=tot;
        while(l<r){
            int mid=l+r+1>>1;
            if(B[mid]<=tr)l=mid;
            else r=mid-1;
        }
        kr=l;
        int maxv=query(1,tot,kl,kr,1);
        update(1,tot,id[i],id[i],maxv,1);
        cout<<tr[1]<<endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:71:17: error: invalid types 'int[int]' for array subscript
   71 |         cout<<tr[1]<<endl;
      |                 ^
Language: C++

#include <iostream>
#include <unordered_map>
#inlcude <algorithm>
using namespace std;
const int N=100010;
unordered_map<int,int> mp;
int A[N];int B[N];
int id[N];
int tr[N<<2];
void pushup(int u){
    tr[u]=max(tr[u<<1],tr[u<<1|1]);
}
void update(int l,int r,int a,int b,int d,int u)
{
    if(l<=a&&b<=r){
        tr[u]=max(tr[u],d);
        return ;
    }
    int mid=a+b>>1;
    if(l<mid)update(l,r,a,mid,d,u<<1);
    if(r>=mid)update(l,r,mid+1,r,d,u<<1|1);
    pushup(u);
}
int query(int l,int r,int a,int b,int u){
    if(l<=a&&b<=r){
        return tr[u];
    }
    int mid=a+b>>1;
    int maxv=0;
    if(l<mid)maxv=max(maxv,query(l,r,a,mid,u<<1));
    if(r>=mid)maxv=max(maxv,query(l,r,mid+1,r,u<<1|1));
    return maxv;
}
int main()
{
    int n,k;
    cin>>n>>k;
    for(int i=1;i<=n;++i){
        cin>>A[i];
        B[i]=A[i];
    }
    sort(B+1,B+n+1);
    int tot=1;
    for(int i=2;i<=n;++i){
        if(B[tot]!=B[i])B[++tot]=B[i];
    }
    int num=0;
    for(int i=1;i<=tot;++i)mp[B[i]]=++num;
    for(int i=1;i<=n;++i){
        id[i]=mp[A[i]];
    }
    for(int i=1;i<=n;++i){
        int tl=A[i]-k,tr=A[i]+k;
        int kl,kr;
        int l=1,r=tot;
        while(l<r){
            int mid=l+r>>1;
            if(B[mid]>=tl)r=mid;
            else l=mid+1;
        }
        kl=l;
        l=1,r=tot;
        while(l<r){
            int mid=l+r+1>>1;
            if(B[mid]<=tr)l=mid;
            else r=mid-1;
        }
        kr=l;
        int maxv=query(1,tot,kl,kr,1);
        update(1,tot,id[i],id[i],maxv,1);
    }
    cout<<tr[1]<<endl;
}

Compiler output:
a.cc:3:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    3 | #inlcude <algorithm>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:42:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   42 |     sort(B+1,B+n+1);
      |     ^~~~
      |     short
Language: C++

#include <atcoder/all>
using namespace atcoder;

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
typedef int64_t Int;
typedef pair<Int, Int> P;

using mint = modint998244353;

vector<mint> pow10(200010, 1);
vector<mint> ones(200010, 0);

struct S { mint x; int l; }; // x: 区間の値, l:区間の長さ
S op(S a, S b){ return S{a.x * pow10[b.l] + b.x, a.l + b.l}; }
S e() { return S{0, 0}; }
using F = mint; // x-> F に更新
S mapping(F f, S a) {return (f == 0) ? a : S{ones[a.l] * f, a.l};}
F composition(F f, F g){ return (f==0) ? g : f; };
F id() { return 0; }

int main(){
    rep(i,200010){
        pow10[i+1] = pow10[i] * 10;
        ones[i+1] = ones[i]*10 + 1;
    }

    int N, Q; cin >> N >> Q;

    vector<S> V(N, S{1,1});
    lazy_segtree<S, op, e, F, mapping, composition, id> LST(V);

    rep(i,Q){
        int L, R, D;
        cin >> L >> R >> D;
        L--; R--;
        LST.apply(L, R+1, D);

        cout << LST.all_prod().x.val() << endl;
    }
}


Compiler output:
a.cc:1:10: fatal error: atcoder/all: No such file or directory
    1 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.