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

#include <bits/stdc++.h>

#define ll                  long long
#define ld                  long double
#define pb                  push_back
#define mp                  make_pair
#define fi                  first
#define se                  second
#define all(c)              (c).begin(),(c).end()
#define for0(i, n)          for (ll i = 0; i < n; ++i)
#define for1(i, n)          for (ll i = 1; i <= n;++i)
#define for2(i, n)          for (ll i = 1; i < n; ++i)
#define for3(i, k, n)       for (ll i = k; i < n; ++i)
#define input(a, i, n)      for (int i = 0; i < n; ++i) {cin >> a[i]; }
#define output(a, i, n)     for (int i = 0; i < n; ++i) {cout << a[i] << ' '; }
//cout.precision(12);

using namespace std;

int64_t TN = 1;

void solve()
{
    int64_t n, k;
    cin >> n >> k;
    vector <int64_t> v;
    set <int64_t> st;
    for (int i = 0; i < k; ++i) {
        cin >> a >> b;
        for (int j = a; j <= b; ++j) st.insert(j);
    }
    for (auto it : st) v.pb(it);
    vector <int64_t> cur(n + 1);
    cur[1] = 1;
    for (int i = 2; i <= n; ++i) {
        for (auto it : st) {
            if (i - it > 0) {
                cur[i] += cur[i - it];
            }
            else break;
        }
    }
    cout << cur[n] % 998244353;
}

int main()
{
    //cin >> TN;
    for (int i = 0; i < TN; ++i) {
        solve();
    }
    return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:29:16: error: 'a' was not declared in this scope
   29 |         cin >> a >> b;
      |                ^
a.cc:29:21: error: 'b' was not declared in this scope
   29 |         cin >> a >> b;
      |                     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n,k;
  cin>>n>>k;
  vector<int>s;
  vector<int64_t>&a(n-1);
  for(int i=0;i<k;i++){
    int a,b;
    cin>>a>>b;
    for(int j=a;j<=b;j++){
      s.push_back(j);
    }
  }
  sort(s.begin(),s.end());
  for(int i=0;i<n-1;i++){
    for(int j=0;j<s.size();j++){
      if(s.at(j)<i+1){
        a.at(i)+=a.at(i-s.at(j));
      }
      else if(s.at(j)==i+1){
        a.at(i)++;
      }
      else break;
    }
  }
  cout<<a.at(n-2)%998244353;
}
  
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: error: invalid initialization of non-const reference of type 'std::vector<long int>&' from an rvalue of type 'int'
    8 |   vector<int64_t>&a(n-1);
      |                     ~^~
Language: C++

	#include<bits/stdc++.h>
	using namespace std;
	typedef long long ll;
	const int mod = 998244353;
	void solve(set<ll> coins,ll n)
	{
			n--;
	ll count[n+1];
	 memset(count,0,sizeof(count));
		count[0]=1;
		for(int i = 1;i<=n;i++)
		{
			for(auto c : coins)
			{
				if(i-(c)>=0)
				{
					count[i]+=count[i-c];
					count[i]=count[i]%mod;
				}
			}
		}
	printf("%lld\n",count[n]);
	}
	
	int main()
	{
	  ios::sync_with_stdio(0);
	  cin.tie(0);
	ll n ,k;
	scanf("%lld %lld",&n,&k);
	//vector<ll> v;
	//vector<vector<ll>> vec;
	set<ll> s;
	 for(int i = 0;i<k;i++)
	{
		ll l,r;
	scanf("%lld %lld",&l,&r);
		
		for(int j = l,j<=r;j++) s.insert(j);
		
		}
	
	  
	solve(s,n);
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:32: error: expected ';' before '<=' token
   39 |                 for(int j = l,j<=r;j++) s.insert(j);
      |                                ^~
      |                                ;
a.cc:39:32: error: expected primary-expression before '<=' token
   39 |                 for(int j = l,j<=r;j++) s.insert(j);
      |                                ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define FOR(i,l,r) for(i=l;i<r;i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define P pair<ll,ll>
#define F first
#define S second
vector<ll>S;ll mod=998244353;
ll solve(ll SUM,vector<ll>&X){
  if(X.at(SUM)==-1){
    ll ans=0;
    for(ll i=0;i<S.size()&&S.at(i)<=SUM;i++){
      ans+=solve(SUM-S.at(i),X);ans%=mod;if(X.at(SUM)!=-1)break;
    }
    if(X.at(SUM)!=-1)break;X.at(SUM)=ans%mod;
  }
  return X.at(SUM);
}
signed main(){
  ll N,K,i,j,L,R;cin>>N>>K;vector<ll>X(N,-1);
  REP(i,K){cin>>L>>R;FOR(j,L,R+1)S.push_back(j);}sort(ALL(S));
  REP(i,S.at(0))X.at(i)=0;X.at(i)=1;X.at(0)=1;
  cout<<solve(N-1,X)<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'll solve(ll, std::vector<long long int>&)':
a.cc:17:22: error: break statement not within loop or switch
   17 |     if(X.at(SUM)!=-1)break;X.at(SUM)=ans%mod;
      |                      ^~~~~
Language: C++

#include<bits/stdc++.h>
#define ll long long


using namespace std;

const int M = 998244353;
int main(){

	int n,k,l,r;
	cin>>n>>k;

	set<int> s;
    
	int dp[n+1]={0};
	
	while(k--)
    {
		cin>>l>>r;
		s.insert(l);
		s.insert(r);
	}
    
	dp[0]=1;
	dp[1]=1;
	for(int i=1;i<=n;i++){
		dp[i] = 0x3f;
       for(auto it:s){
		   if(n-it>=0)
			   dp[i] = min(dp[i], dp[i-it]+1);
	   }
	}
    cout<<dp[n]%M
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:18: error: expected ';' before '}' token
   33 |     cout<<dp[n]%M
      |                  ^
      |                  ;
   34 | }
      | ~
Language: C++

#include<iostream>
#include<cstdlib>
#include<vector>
using namespace std;
int main()
{
    int n,k;
    while(cin>>n>>k)
    {
        vector<int> list;
        int dp[n+1];
        for(int i=0;i<k;i++)
        {
            int left,right;
            cin>>left>>right;
            for(int kk=left;kk<=right;kk++)
            {
                list.push_back(kk);
            }
            
            
        }
        sort(list.begin(),list.end());
        memset(dp,0,sizeof(dp));
        dp[0] = 0;
        dp[1] = 1;
        
        for(int i=2;i<=n;i++)
        {
            for(int r=0;r<list.size();r++)
            {
                if( i - list[r] >= 0)
                {
                    //cout<<i<<" "<<list[r]<<endl;
                    dp[i] += dp[i-list[r]]%998244353;
                    //cout<<"cur:"<<dp[i]<<endl;
                }
            }
        }
        
        cout<<dp[n]%998244353<<endl;
        
    }
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   23 |         sort(list.begin(),list.end());
      |         ^~~~
      |         short
a.cc:24:9: error: 'memset' was not declared in this scope
   24 |         memset(dp,0,sizeof(dp));
      |         ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<vector>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

#include<bits/stdc++.h>
#define ll long long


using namespace std;

const int M = 998244353;
int main(){

	int n,k,l,r;
	cin>>n>>k;
.
	set<int> s;
    
	int dp[n+1]={0};
	
	while(k--)
    {
		cin>>l>>r;
		s.insert(l);
		s.insert(r);
	}
    
	dp[0]=1;
	dp[1]=1;
	for(int i=1;i<=n;i++){
		dp[i] = 0x3f;
       for(auto it:s){
		   if(n-it>=0)
			   dp[i] = min(dp[i], dp[i-it]+1);
	   }
	}
    cout<<dp[n]%M
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:1: error: expected primary-expression before '.' token
   12 | .
      | ^
a.cc:13:9: error: invalid use of 'class std::set<int>'
   13 |         set<int> s;
      |         ^~~~~~~~
a.cc:20:17: error: 's' was not declared in this scope
   20 |                 s.insert(l);
      |                 ^
a.cc:28:20: error: 's' was not declared in this scope
   28 |        for(auto it:s){
      |                    ^
a.cc:33:18: error: expected ';' before '}' token
   33 |     cout<<dp[n]%M
      |                  ^
      |                  ;
   34 | }
      | ~
Language: Java

import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner s=new Scanner(System.in);
    int n=s.nextInt();
    int k=s.nextInt();
    ArrayList<Integer> arr=new ArrayList<>();
    for(int i=0;i<k;i++){
      int a=s.nextInt();
      int b=s.nextInt();
      if(!arr.contains(a))
        arr.add(a);
      if(!arr.contains(b))
        arr.add(b);
      }
      int num=arr.size();
      int ans=getCount(arr,num,n);
      System.out.println(ans);
    }
    public static int getCount(ArrayList<Integer> arr,int n,int sum){
      long[] table = new long[n+1];
      Arrays.fill(table, 0);
      table[0] = 1; 
      for (int i=0; i<m; i++) 
            for (int j=arr.get(i); j<=n; j++) 
                table[j] += table[j-arr.get(i)]; 
  
        return table[n]; 
    }
}


Compiler output:
Main.java:25: error: cannot find symbol
      for (int i=0; i<m; i++) 
                      ^
  symbol:   variable m
  location: class Main
Main.java:29: error: incompatible types: possible lossy conversion from long to int
        return table[n]; 
                    ^
2 errors
Language: C++

#pragma GCC optimize("O3")

#define _GLIBCXX_DEBUG
#include <iostream>
#include <vector>
#include <string>
#include <string_view>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <cassert>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
using namespace std;

/*----------macros----------*/

//output================
#define endl '\n'
#define fcout cout << fixed << setprecision(15)

//typedef===============
typedef long long       ll;
typedef long double     ld;
typedef pair<int, int>  Pii;
typedef pair<ll, ll>    Pll;

//const number==========
constexpr ll INF9   = (ll)1e9 + 1;
constexpr ll INF18  = (ll)1e18 + 1;
constexpr ll MOD    = 1000000007;
constexpr ld PI     = 3.141592653589793L;

//member================
#define pb push_back
#define eb emplace_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second

//others================
#define all(x)          (x).begin(), (x).end()
#define rall(x)         (x).rbegin(), (x).rend()
#define rep(i, n)       for(int i = 0; (i) < (n); ++(i))
#define reps(i, n)       for(int i = 1; (i) <= (n); ++(i))
#define rrep(i, n)      for(int i = n - 1; (i) >= 0 ; --(i))
#define CtoI(c)         int((c)) - int('0')
#define ItoC(c)         char((c) + '0')

//functions=============
template<typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }

template<typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

//vector<int> dx = {1, 0, -1, 0}, dy = {0, 1, 0, -1};
//vector<int> dx2 = { 1,1,0,-1,-1,-1,0,1 }, dy2 = { 0,1,1,1,0,-1,-1,-1 };

/*--------additional--------*/

#define MOD2 998244353
int dp[200005];

/*----------main------------*/

int main() {
/*----------fastio----------*/
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);
    std::ios::sync_with_stdio(false);
/*----------solve-----------*/

    int n, k; cin >> n >> k;
    vector<int> L(k), R(k);
    vector<int> s;
    s.reserve(200005);

    rep(i, k){
        cin >> L[i] >> R[i];
        if(L[i] == R[i]) s.pb(L[i]);
        else if(L[i] < R[i]){
            for(int j = L[i]; j <= R[i]; ++j) s.pb(j);
        }
    }

    sort(all(s));

    ll ans = 0, sum = 0;
    for(auto &x : s){
        sum += x;
    }

    for(int i = 1; i <= n; ++i){
        if(sum )
    }

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:101:5: error: expected primary-expression before '}' token
  101 |     }
      |     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi   = vector<int>;
using vll  = vector<ll>;
using vc   = vector<char>;
using vvll  = vector<vll>;
using vvi  = vector<vi>;
using vvc  = vector<vc>;
using vb   = vector<bool>;
using vvb  = vector<vb>;
using pii  = pair<int,int>;
using vpii = vector<pii>;
using posteriority_queue = priority_queue<int, vi, greater<int>>;

map<ll, ll> memo;
posteriority_queue empty;
ll constant = 998244353;

ll loop(posteriority_queue que, ll x) {
    ll ans = 0;
    posteriority_queue tmp_que = que;
    while(!tmp_que.empty()) {
        ll tmp = x - tmp_que.top();
        tmp_que.pop();
        if (tmp == 0) {
            ans++;
            break;
        }else if (tmp < 0) {
            break;
        } else if (memo.count(tmp)) {
            ans = (ans + memo.at(tmp)) % constant;
        } else {
            ans = (ans + loop(que, tmp)) % constant;
        }
    }
    swap(tmp_que, empty);
    memo[x] = ans % constant;
    return ans % constant;
}

int main() {
    ll N, K; cin >> N >> K;
    posteriority_queue que;
    for(ll i = 0; i < K; i++) {
        ll tmp1, tmp2; cin >> tmp1 >> tmp2;
        for(ll i = tmp1; i <= tmp2; i++) {
            que.push(i);
        }
    }
    cout << loop(que, N-1);

}


Compiler output:
a.cc: In function 'll loop(posteriority_queue, ll)':
a.cc:37:19: error: reference to 'empty' is ambiguous
   37 |     swap(tmp_que, empty);
      |                   ^~~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:302:5: note: candidates are: 'template<class _Tp> constexpr bool std::empty(initializer_list<_Tp>)'
  302 |     empty(initializer_list<_Tp> __il) noexcept
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:292:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr bool std::empty(const _Tp (&)[_Nm])'
  292 |     empty(const _Tp (&)[_Nm]) noexcept
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:282:5: note:                 'template<class _Container> constexpr decltype (__cont.empty()) std::empty(const _Container&)'
  282 |     empty(const _Container& __cont) noexcept(noexcept(__cont.empty()))
      |     ^~~~~
a.cc:17:20: note:                 'posteriority_queue empty'
   17 | posteriority_queue empty;
      |                    ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi   = vector<int>;
using vll  = vector<ll>;
using vc   = vector<char>;
using vvll  = vector<vll>;
using vvi  = vector<vi>;
using vvc  = vector<vc>;
using vb   = vector<bool>;
using vvb  = vector<vb>;
using pii  = pair<int,int>;
using vpii = vector<pii>;
using posteriority_queue = priority_queue<int, vi, greater<int>>;

map<ll, ll> memo;
queue<int> empty;
ll constant = 998244353;

ll loop(posteriority_queue que, ll x) {
    ll ans = 0;
    posteriority_queue tmp_que = que;
    while(!tmp_que.empty()) {
        ll tmp = x - tmp_que.top();
        tmp_que.pop();
        if (tmp == 0) {
            ans++;
            break;
        }else if (tmp < 0) {
            break;
        } else if (memo.count(tmp)) {
            ans = (ans + memo.at(tmp)) % constant;
        } else {
            ans = (ans + loop(que, tmp)) % constant;
        }
    }
    swap(tmp_que, empty);
    memo[x] = ans % constant;
    return ans % constant;
}

int main() {
    ll N, K; cin >> N >> K;
    posteriority_queue que;
    for(ll i = 0; i < K; i++) {
        ll tmp1, tmp2; cin >> tmp1 >> tmp2;
        for(ll i = tmp1; i <= tmp2; i++) {
            que.push(i);
        }
    }
    cout << loop(que, N-1);

}


Compiler output:
a.cc: In function 'll loop(posteriority_queue, ll)':
a.cc:37:19: error: reference to 'empty' is ambiguous
   37 |     swap(tmp_que, empty);
      |                   ^~~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:302:5: note: candidates are: 'template<class _Tp> constexpr bool std::empty(initializer_list<_Tp>)'
  302 |     empty(initializer_list<_Tp> __il) noexcept
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:292:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr bool std::empty(const _Tp (&)[_Nm])'
  292 |     empty(const _Tp (&)[_Nm]) noexcept
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:282:5: note:                 'template<class _Container> constexpr decltype (__cont.empty()) std::empty(const _Container&)'
  282 |     empty(const _Container& __cont) noexcept(noexcept(__cont.empty()))
      |     ^~~~~
a.cc:17:12: note:                 'std::queue<int> empty'
   17 | queue<int> empty;
      |            ^~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
#define _GLIBCXX_DEBUG
ll mod = 998244353;

int main() {
  ll n, k; cin >> n >> k;
  vector<bool> s(200010,false);
  rep(i,k){
    int sta, end;
    cin >> sta >> end;
    for(int j = sta; j<=end; j++){
      s.at(j) = true;
    }
  }

  //rep(i,n) if(s.at(i)) cout << i << endl;

  vector<ll> dp(200010);
  dp[1] = 1;
  for(int i = 2; i <= n; i++){
    for(int j = 1; j < i; j++){
      if(s.at(j)) dp[i] += dp[i-j];
      dp[i] %= mod;
    }
  }
  cout << dp[i] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:14: error: 'i' was not declared in this scope
   29 |   cout << dp[i] << endl;
      |              ^
Language: Java

import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner s=new Scanner(System.in);
    int n=s.nextInt();
    int k=s.nextInt();
    ArrayList<Integer> arr=new ArrayList<>();
    for(int i=0;i<k;i++){
      int a=s.nextInt();
      int b=s.nextInt();
      if(!arr.contains(a))
        arr.add(a);
      if(!arr.contains(b))
        arr.add(b);
      }
      int num=arr.size();
      int ans=getCount(arr,num,n);
      System.out.println(ans);
    }
    public static int getCount(ArrayList<Integer> arr,int num,int sum){
      int dp[][]=new int[sum+1][num+1];
      for(int i=0;i<=n;i++){
        dp[0][i]=1;
      }
      for(int i=1;i<=sum;i++){
        dp[i][0]=0;
      }
      for(int i=1;i<=sum;i++){
        for(int j=1;j<=n;j++){
          dp[i][j]=dp[i][j-1];
          if(arr.get(j-1)<=i)
            dp[i][j]+=dp[i-arr.get(j-1)][i];
        }
      }
      return dp[sum][n];
    }
}


Compiler output:
Main.java:23: error: cannot find symbol
      for(int i=0;i<=n;i++){
                     ^
  symbol:   variable n
  location: class Main
Main.java:30: error: cannot find symbol
        for(int j=1;j<=n;j++){
                       ^
  symbol:   variable n
  location: class Main
Main.java:36: error: cannot find symbol
      return dp[sum][n];
                     ^
  symbol:   variable n
  location: class Main
3 errors
Language: Java

import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner s=new Scanner(System.in);
    int n=s.nextInt();
    int k=s.nextInt();
    ArrayList<Integer> arr=new ArrayList<>();
    for(int i=0;i<k;i++){
      int a=s.nextInt();
      int b=s.nextInt();
      if(!arr.contains(a))
        arr.add(a);
      if(!arr.contains(b))
        arr.add(b);
      }
      int num=arr.size();
      int ans=getCount(arr,num,n);
      System.out.println(ans);
    }
    public static int getCount(ArrayList<Integer> arr,int num,int sum){
      int dp[sum+1][num+1];
      for(int i=0;i<=n;i++){
        dp[0][i]=1;
      }
      for(int i=1;i<=sum;i++){
        dp[i][0]=0;
      }
      for(int i=1;i<=sum;i++){
        for(int j=1;j<=n;j++){
          dp[i][j]=dp[i][j-1];
          if(arr.get(j-1)<=i)
            dp[i][j]+=dp[i-arr.get(j-1)][i];
        }
      }
      return dp[sum][n];
    }
}


Compiler output:
Main.java:22: error: ']' expected
      int dp[sum+1][num+1];
             ^
Main.java:22: error: not a statement
      int dp[sum+1][num+1];
                ^
Main.java:22: error: ';' expected
      int dp[sum+1][num+1];
                  ^
Main.java:22: error: not a statement
      int dp[sum+1][num+1];
                       ^
Main.java:22: error: ';' expected
      int dp[sum+1][num+1];
                         ^
5 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define reps(i, s, n) for(int i = (s); i < (n); i++)
#define rrep(i, n) for(int i = (n) - 1; i >= 0; i--)
#define rreps(i, s, n) for(int i = (n) - 1; i >= (s); i--)
#define INF ~(1 << 31)
#define INFL ~(1LL << 63)
#define mod 998244353LL

int main()
{
    int n, k;
    cin >> n >> k;
    vector<pair<int, int>> d(k);
    rep(i, k){
        cin >> d[i].first >> d[i].second;
    }

    vector<ll> dp(n+1);
    dp[1] = 1;
    reps(i, 2, n+1){
        rep(j, k){
            int f = i - d[j].first, s = max(i - d[j].second, 1);
            if(f < 1) continue;
            else if(s == 1) dp[i] = (dp[i] + dp[f]) % mod;
            else dp[i] = (dp[i] - dp[s-1] + dp[f]) % mod;
        }
        dp[i] = (dp[i] + dp[i-1]) % mod;
    }
    if(dp[i] < dp[i-1]) dp[i] += mod;
    cout << dp[n] - dp[n-1] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:11: error: 'i' was not declared in this scope
   32 |     if(dp[i] < dp[i-1]) dp[i] += mod;
      |           ^
Language: C++

#include <bits/stdc++.h>

#include <atcoder/modint>
#include <iostream>
#include <vector>

using namespace std;
using namespace atcoder;
using ll = long long;
using mint = modint998244353;

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

    vector<int> list;
    for (int i = 0; i < K; i++) {
        int l, r;
        cin >> l >> r;
        for (int j = l; j <= r; j++) {
            list.push_back(j);
        }
    }

    vector<mint> dp(N, 0);
    dp[0] = 1;

    for (int i = 0; i < N; i++) {
        for (int j = 0; j < list.size(); j++) {
            if (i - list[j] >= 0) {
                // cout << i << ":" << i - list[j] << endl;
                dp[i] += dp[i - list[j]].val();
            }
        }
    }
    // for (int i = 0; i < N; i++) {
    // cout << dp[i].val() << endl;
    // }

    cout << dp[N - 1].val() << endl;

    return 0;
}


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

#include <stdio.h>
#include <math.h>
#include <string.h>

typedef long long ll;

int n, k;
int l[15], r[15];
int in_s[200005];
ll ans[200005];
ll ans_sum[15];
ll mod = 998244353;

ll getans(int x)
{
	if (x <= 0)
	{
		return 0;
	}
	if (ans[x] != -1)
	{
		return ans[x];
	}
	ll s = 0;
	for (int i = 0; i < k; i++)
	{
		s += getanssum(x - i);
		s %= mod;
	}
	ans[x] = s;
	return s;
	
}
ll getanssum(int ki)
{
	if (ans_sum[ki] != -1)
	{
		return ans_sum[ki];
	}
	ll s = 0;
	for (int i = k; i <= r; i++)
	{
		s += getans(i);
		s %= mod;
	}
	ans_sum[ki] = s;
	return s;
}

int main() {
	scanf("%d %d", &n, &k);
	for (int i = 0; i < k; i++)
	{
		scanf("%d %d", l[i], r[i]);
		for (int i = l; i <= r; i++)
		{
			in_s[i] = 1;
		}
		
	}
	for (int i = 0; i <= n; i++)
	{
		ans[i] = -1;
	}
	ans[1] = 1;
	for (int i = 0; i < k; i++)
	{
		ans_sum[i] = -1;
	}
	printf("%lld", getans(n));
	
	
	
	return 0;
}



Compiler output:
main.c: In function 'getans':
main.c:27:22: error: implicit declaration of function 'getanssum'; did you mean 'getans'? [-Wimplicit-function-declaration]
   27 |                 s += getanssum(x - i);
      |                      ^~~~~~~~~
      |                      getans
main.c: At top level:
main.c:34:4: error: conflicting types for 'getanssum'; have 'll(int)' {aka 'long long int(int)'}
   34 | ll getanssum(int ki)
      |    ^~~~~~~~~
main.c:27:22: note: previous implicit declaration of 'getanssum' with type 'int()'
   27 |                 s += getanssum(x - i);
      |                      ^~~~~~~~~
main.c: In function 'getanssum':
main.c:41:27: warning: comparison between pointer and integer
   41 |         for (int i = k; i <= r; i++)
      |                           ^~
main.c: In function 'main':
main.c:55:30: error: initialization of 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion]
   55 |                 for (int i = l; i <= r; i++)
      |                              ^
main.c:55:35: warning: comparison between pointer and integer
   55 |                 for (int i = l; i <= r; i++)
      |                                   ^~
Language: C++

#include<bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
int main()
{
   int n,k,count=0,minx=9999999;
   cin>>n>>k;
   register ans[200005]={0};
   ans[1]=1;
   register yn[200005]={0};
   for(int i=1;i<=k;i++)
   {
      int a,b;
      cin>>a>>b;
      for(int i=a;i<=b;i++)
      {
         count++;
         yn[count]=i;
      }
      minx=min(a,minx);
   }   
   for(register int i(1);i<=n-minx;++i)
   {
      if(ans[i]>0)
      {
         for(int j=1;j<=count;j++)
         {
            int kk=i+yn[j];
            if(kk<=n)
            {
            ans[kk]+=ans[i];
            ans[kk]%=998244353;
            }
         }
      }
      /*
      for(int i=1;i<=n;i++)
      {
         cout<<ans[i]<<" ";
      }
      cout<<endl;
      */
   }
   cout<<ans[n]<<endl;
   return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 'ans' does not name a type
    8 |    register ans[200005]={0};
      |             ^~~
a.cc:9:4: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |    ans[1]=1;
      |    ^~~
      |    abs
a.cc:10:13: error: 'yn' does not name a type
   10 |    register yn[200005]={0};
      |             ^~
a.cc:18:18: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   18 |          yn[count]=i;
      |                  ^
a.cc:18:19: error: assignment of read-only location '*(yn + ((sizetype)count))'
   18 |          yn[count]=i;
      |          ~~~~~~~~~^~
a.cc:22:21: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   22 |    for(register int i(1);i<=n-minx;++i)
      |                     ^
a.cc:28:26: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   28 |             int kk=i+yn[j];
      |                          ^
a.cc:28:21: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   28 |             int kk=i+yn[j];
      |                    ~^~~~~~
a.cc:28:21: error: invalid conversion from 'double (*)(int, double) noexcept' to 'int' [-fpermissive]
   28 |             int kk=i+yn[j];
      |                    ~^~~~~~
      |                     |
      |                     double (*)(int, double) noexcept
Language: C++

#define errOut(s) \
  { std::cerr << __LINE__ << ":" << #s << ":" << (s) << std::endl; }

#include <bits/stdc++.h>

#include <atcoder/all>
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
//#include <boost/multi_array.hpp>
//#include <boost/optional.hpp>
//#include <boost/range/adaptors.hpp>
//#include <boost/range/algorithm.hpp>
//#include <boost/range/irange.hpp>
#pragma clang diagnostic pop

using namespace std;
using range_t = struct {
  int64_t l;
  int64_t r;
};
static constexpr int64_t MOD = 998244353;
static constexpr int64_t MaxN = 200000;
static std::vector<range_t> rgs;
static std::vector<int64_t> dp;
static int64_t n;

int64_t subSolve(int64_t p) {
  if (dp[p] >= 0) {
    return dp[p];
  }
  int64_t ret = 0;
  for (auto const& rg : rgs) {
    if (p - rg.l < 0) {
      break;
    }
    for (int64_t pp = rg.l; pp <= rg.r; pp++) {
      if (p - pp == 0) {
        ret += 1;
        ret %= MOD;
      }
      if (p - pp < 0) {
        break;
      }
      ret += subSolve(p - pp);
      ret %= MOD;
    }
  }
  dp[p] = ret;
  return ret;
}

int64_t solve(void) {
  dp.resize(n);
  for (auto& d : dp) {
    d = -1;
  }
  std::sort(rgs.begin(), rgs.end(),
            [](auto const& lhv, auto const& rhv) { return lhv.l < rhv.l; });
  return subSolve(n - 1);
}

int main() {
  std::cin.tie(nullptr);
  std::ios::sync_with_stdio(false);
  std::cin >> n;
  int64_t k;
  std::cin >> k;
  rgs.resize(k);
  for (int i = 0; i < k; i++) {
    std::cin >> rgs[i].l;
    std::cin >> rgs[i].r;
  }
  auto const res = solve();
  std::cout << res << std::endl;
  return 0;
}


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

N, K = map(int, input().split())

S = []

for i in range(K):
    l, r = map(int, input().split())
    for j in range(l, r + 1):
        S.append(j)

dp = [0] * N * 10

dp[1] = 1

# for i in range(2, N + 1):
#     count = 0
#     for s in S:
#         if i > s:
#             count = (count + dp[i - s]) % 998244353
#     dp[i] += count % 998244353

for i in range(1, N + 1):
    if dp[i] == 0:
        continue
    for s in S:
        if i + s <= N + 1:
            dp[i + s] = (dp[i + s] + dp[i]) % 998244353

print(dp[N])


Compiler output:
a.cc:14:3: error: invalid preprocessing directive #for
   14 | # for i in range(2, N + 1):
      |   ^~~
a.cc:15:7: error: invalid preprocessing directive #count
   15 | #     count = 0
      |       ^~~~~
a.cc:16:7: error: invalid preprocessing directive #for
   16 | #     for s in S:
      |       ^~~
a.cc:17:19: error:  ':' without preceding '?'
   17 | #         if i > s:
      |                   ^
a.cc:17: error: unterminated #if
   17 | #         if i > s:
a.cc:1:1: error: 'N' does not name a type
    1 | N, K = map(int, input().split())
      | ^
Language: C++

#include<iostream>
#include<vector>
#include<unordered_set>
#include<algorithm>
#include<stdlib.h>
#include<stdio.h>
#include<cstring>
using namespace std;
typedef long long int ll;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n,k;
    cin>>n>>k;
    vector<pair<ll,ll> >v;
    for(ll i=0;i<k;i++)
    {
        ll a,b;
        cin>>a>>b;
        v.push_back(make_pair(a,b));
    }
    vector<ll>s;
     for(int i=0;i<k;i++)
     {
         for(int j=v[i].first;j<=v[i].second;j++)
            s.push_back(j);
     }
      vector<ll>::iterator it;
      vector<ll>a(n+1,0);
      a[0]=0 ;
      a[1]=1;
      for(ll i=2;i<=n;i++)
      {
          for(it=s.begin();it!=s.end();it++)
          {
              if(i-(*it)>0)
              {
                  a[i]+=a[i-(*it)];
              }
          }
          //cout<<a[i]<<" ";
      }
      cout<<a[n]%998244353<<"\n";


Compiler output:
a.cc: In function 'int main()':
a.cc:44:34: error: expected '}' at end of input
   44 |       cout<<a[n]%998244353<<"\n";
      |                                  ^
a.cc:11:1: note: to match this '{'
   11 | {
      | ^
Language: C++

#pragma GCC optimize ("Ofast")
#pragma GCC target ("tune=native")
#pragma GCC target ("avx")
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=(0);(i)<(int)(n);++(i))
using ll = long long;
using P = pair<int, int>;
using namespace std;

#define INF ((1<<30)-1)
#define LLINF (1LL<<60)
#define EPS (1e-10)

const ll mod = 998244353;

ll L[11], R[11];
vector<ll> sum;
ll dp[202020];

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

    // 一番最初の地点で1を足す
    rep(i, K) {
        cin >> L[i] >> R[i];
        for (int j = L[i]; j <= R[i]; ++j) sum.push_back(j);
    }
    sort(sum.begin(), sum.end());

    fill(dp, dp+N+1, -1);

    int len = sum.size();
    dp[1] = 1LL;
    for (int i = 1; i < N; ++i) {

        if (dp[i] == -1) continue;

        for (int j = 0; j < len; ++j) {
            if (i + sum[j] <= N) {
                if (dp[i + sum[j]] == -1) dp[i + sum[j]] = 0;

                dp[i + sum[j]] = (dp[i + sum[j]] + dp[i]) % mod;
            }
            else {
                break;
            }
        }

        while (len > 0 and i + 1 + sum[len-1] > N) {
            len--;
        }
    }

    if (dp[N] == -1) dp[N] = 0;
    cout << dp[N] % mod << endl;
}


Compiler output:
In file included from /usr/include/c++/14/string:43,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:4:
/usr/include/c++/14/bits/allocator.h: In destructor 'std::_Vector_base<long long int, std::allocator<long long int> >::_Vector_impl::~_Vector_impl()':
/usr/include/c++/14/bits/allocator.h:182:7: error: inlining failed in call to 'always_inline' 'std::allocator< <template-parameter-1-1> >::~allocator() noexcept [with _Tp = long long int]': target specific option mismatch
  182 |       ~allocator() _GLIBCXX_NOTHROW { }
      |       ^
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/usr/include/c++/14/bits/stl_vector.h:132:14: note: called from here
  132 |       struct _Vector_impl
      |              ^~~~~~~~~~~~
Language: Java

package Time_and_Space;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class atcode
{
    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;
        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }
        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
 
        int nextInt()
        {
            return Integer.parseInt(next());
        }
 
        long nextLong()
        {
            return Long.parseLong(next());
        }
 
        double nextDouble()
        {
            return Double.parseDouble(next());
        }
 
        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
 
//    public static void main(String[] args)
//    {
//        FastReader s=new FastReader();
//        int n=s.nextInt();
//        int[] dp=new int[n+1];
//        dp[1]=1;
//        dp[2]=2;
//        int sum=dp[1]+dp[2];
//        for(int i=3;i<=n;i++) {
//        	dp[i]=sum;
//        	sum+=dp[i];
//        }
//        System.out.println(dp[n]);
//    }
    
    public static void main(String[] args)
    {
    	int mod=998244353;
        FastReader s=new FastReader();
        int n=s.nextInt();
        int k=s.nextInt();
        
        int[] jump=new int[2*k];
        int idx=0;
        for(int i=0;i<k;i++) {
        	int x=s.nextInt();
        	int y=s.nextInt();
        	jump[idx++]=x;
        	jump[idx++]=x==y?-1:y;
        }
        
        int[] dp=new int[n+1];
        dp[n]=1;
        
        for(int i=n-1;i>=1;i--) {
        	for(int j=0;j<jump.length;j++) {
        		if(jump[j]==-1 || i+jump[j]>n) continue;
        		dp[i]+=dp[i+jump[j]];
        		dp[i]=dp[i]%mod;
        	}
        }
        System.out.println(dp[1]);
    }
}

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

#include <iostream>
#include <vector>
using namespace std;
int main(void){
    // Your code here!
    int N,K,a,b;
    cin >> N >> K;
    vector<__int64_t> count(N+1,0);
    count[1] = 1;
    vector<int> v(0);
    for(int i=0;i<K;i++){
        cin >> a >> b;
        for(int j=a;j<=b;j++){
            v.push_back(j);
        }
    }
    std::sort(v.begin(), v.end() );
    
    for(int i=2;i<=N;i++){
		for (int j : v)
		{
		    if(i-j<=0){break;}
		    count[i] += count[i-j];
		    count[i] = count[i]%998244353;
		}
    }
	cout << count[N]%998244353 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   17 |     std::sort(v.begin(), v.end() );
      |          ^~~~
      |          qsort
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main(void){
    // Your code here!
    int N,K,a,b;
    cin >> N >> K;
    vector<__int64_t> count(N+1,0);
    count[1] = 1;
    vector<int> v(0);
    for(int i=0;i<K;i++){
        cin >> a >> b;
        for(int j=a;j<=b;j++){
            v.push_back(j);
        }
    }
    sort(v.begin(), v.end() );
    
    for(int i=2;i<=N;i++){
		for (int j : v)
		{
		    if(i-j<=0){break;}
		    count[i] += count[i-j];
		    count[i] = count[i]%998244353;
		}
    }
	cout << count[N]%998244353 << endl;
}


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

#include<bits/stdc++.h>

using namespace std;

#define endl "\n"
#define lln long long int
#define IOS ios::sync_with_stdio(0);cin.tie(0);

const int MOD = 998244353;

int main(){
	IOS;

	int n,k;
	cin >> n >> k;
	vector<int> ans(n+1);
	set<int> moves;
	for(int i=0;i<k;i++){
		int x,y;
		cin >> x >> y;
		for(int j=x;j<=y;j++) moves.insert(j);
	}
	ans[1] = 1;
	for(int i=1;i<=n;i++){
		if(!a[i]) continue;
		for(auto j : moves){
			if(i+j<=n){
				ans[i+j] = (ans[i+j] + ans[i]) % MOD;
			}
		}
	}
	cout << ans[n] << endl;
	return 0;    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:21: error: 'a' was not declared in this scope
   25 |                 if(!a[i]) continue;
      |                     ^
Language: C++

#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std;

const int N = 200005;
const int mod = 998244353;
int dp[N];
int n, m;
int a[N];
int pos = 0;

int main() {
  scanf("%d%d", &n, &m);
  int le, ri;
  pos = 0;
  while (m--) {
    scanf("%d%d", &le, &ri);
    for (int i = le ; i <= ri; i++) {
      a[pos++] = i;
    }
    sort(a, a + pos);
    memset(dp, 0, sizeof(dp));
    dp[1] = 1;
    for (int i = 1; i < n; i++) {
      if (dp[i] == 0) {
        continue;
      }
      for (int j = 0; j < pos && i + a[j] <= n; j++) {
        dp[i + a[j]] = (dp[i + a[j]] + dp[i]) % mod;
      }
    }
    printf("%d\n", dp[n]);
  }
  return 0;
}


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

#include<bits/stdc++.h>

using namespace std;

#define endl "\n"
#define lln long long int
#define IOS ios::sync_with_stdio(0);cin.tie(0);

const int MOD = 998244353;

int main(){
	IOS;

	int n,k;
	cin >> n >> k;
	vector<int> ans(n+1);
	set<int> moves;
	for(int i=0;i<k;i++){
		int x,y;
		cin >> x >> y;
		for(int j=x;j<=y;j++) moves.insert(j);
	}
	ans[1] = 1;
	for(int i=1;i<=n;i++){
		if(!a[i+j]) continue;
		for(auto j : moves){
			if(i+j<=n){
				ans[i+j] = (ans[i+j] + ans[i]) % MOD;
			}
		}
	}
	cout << ans[n] << endl;
	return 0;    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:21: error: 'a' was not declared in this scope
   25 |                 if(!a[i+j]) continue;
      |                     ^
a.cc:25:25: error: 'j' was not declared in this scope
   25 |                 if(!a[i+j]) continue;
      |                         ^
Language: C++

#include<iostream>
#include<vector>

using namespace std;

const long long MOD = 998244353;

int main(){
  int n,k;  cin >> n >> k;
  vector<int>S;

  for(int i=0;i<k;i++){
    int l,r;  cin >> l >> r;
    for(int j=l;j<=r;j++){
      S.push_back(j);
    }
  }
  sort(S.begin(),S.end());
  vector<long long>dp(n+1,0);
  dp.at(1) = 1;

  for(int i=2;i<=n;i++){
    for(int j=0;j<S.size();j++){
      if(0 < i - S.at(j)){
        dp.at(i) += dp.at(i - S.at(j));
        dp.at(i) %= MOD;
      }
      else  break;
    }
  }
  cout << dp.at(n) << endl;
}


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

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

int main() {
    cout << fixed << setprecision(0);
    int64_t N, K;
    cin >> N >> K;
    vector<int64_t> L(K), R(K);
    for(int i = 0; i < K; i++) {
        cin >> L[i] >> R[i];
    }

    const int64_t MOD = 998244353;
    vector<int64_t> ans(N), sm(N);
    ans[0] = 1;
    sm[0] = 1;

    for(int64_t i = 1; i < N; i++) {
        for(int64_t j = 0; j < K; j++) {
            if(i - L[j] < 0)
                continue;
            int64_t s = max(0LL, i - R[j]);
            int64_t g = min(i - 1, i - L[j]);
            ans[i] =
                (sm[g] + MOD - (s - 1 >= 0 ? sm[s - 1] : 0) + ans[i]) % MOD;
        }
        sm[i] = (sm[i - 1] + ans[i]) % MOD;
    }

    cout << ans[N - 1] << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:28: error: no matching function for call to 'max(long long int, int64_t)'
   22 |             int64_t s = max(0LL, i - R[j]);
      |                         ~~~^~~~~~~~~~~~~~~
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:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:22:28: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int64_t' {aka 'long int'})
   22 |             int64_t s = max(0LL, i - R[j]);
      |                         ~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:22:28: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   22 |             int64_t s = max(0LL, i - R[j]);
      |                         ~~~^~~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<vector>
#define all(x) x.begin(), x.end()
#define ff first
#define ss second
#define MOD 998244353
using namespace std;

int main() {
	int n, k;
	cin >> n >> k;
	vector<pair<int, int>> v, tmp;
	for (int i = 0; i < k; i++) {
		int x, y;
		cin >> x >> y;
		tmp.push_back({x, y});
	}
	sort(all(tmp));
	int px = 0, py = 0;
	for (auto g : tmp) {
		if (g.ff <= py) {
			py = g.ss;
		}
		else {
			if (px != 0 && py != 0)
				v.push_back({px, py});
			px = g.ff;
			py = g.ss;
		}
	}
	v.push_back({px, py});
	vector<int> A(n + 1);
	A[1] = 1;
	A[2] = -1;
	for (int i = 1; i <= n; i++) {
		A[i] += A[i - 1];
		if (A[i] >= MOD) A[i] -= MOD;
		for (auto g : v) {
			A[i + g.ff] += A[i];
			if (A[i] >= MOD) A[i] -= MOD;
			A[i + g.ss + 1] -= A[i];
			if (A[i] < 0) A[i] += MOD;
		}	
	}
	cout << A[n];
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   18 |         sort(all(tmp));
      |         ^~~~
      |         short
Language: C++

#include <iostream>
#include <vector>
#include <numeric>
#include <algorithm>
#include <climits>

constexpr int SINT_MAX = std::numeric_limits<int>::max();
constexpr int SINT_MIN = std::numeric_limits<int>::min();

using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;

template<class T>
T choose(bool b, T t, T f)
{
    if (b) return t;
    else return f;    
}

const char *YesNo(bool b)
{
    return choose(b, "Yes", "No");
}

const char *YESNO(bool b)
{
    return choose(b, "YES", "NO");
}

template<class NumT>
NumT diffabs(NumT l, NumT r)
{
    if (l < r) return r-l;
    else return l-r;    
}

struct myinout_t {} io;

template<class T>
myinout_t &operator >>(myinout_t &my, T &i)
{
    cin >> i;
    return my;
}

myinout_t &operator >>(myinout_t &my, int &i)
{
    int r = scanf("%d", &i);
    if (r != 1) exit(EXIT_FAILURE);
    return my;
}

myinout_t &operator >>(myinout_t &my, ll &i)
{
    int r = scanf("%lld", &i);
    if (r != 1) exit(EXIT_FAILURE);
    return my;
}

template<class T>
myinout_t &operator <<(myinout_t &my, const T &i)
{
    cout << i;
    return my;
}

myinout_t &operator <<(myinout_t &my, int i)
{
    printf("%d", i);
    return my;
}

myinout_t &operator <<(myinout_t &my, ll i)
{
    printf("%lld", i);
    return my;
}

myinout_t &operator <<(myinout_t &my, double i)
{
    printf("%.20f", i);
    return my;
}

constexpr char BR = '\n';


///////////////////////////////////////////////////

constexpr int MOD = 998244353;
#include "atcoder/lazysegtree"
using namespace atcoder;

int op(int l, int r)
{
    return (l + r) % MOD;
}

int e()
{
    return 0;
}

int mapping(int l, int r)
{
    return (l + r) % MOD;
}

int composition(int l, int r)
{
    return (l + r) % MOD;
}

int id()
{
    return 0;
}

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

    int L[10], R[10];
    for (int i = 0; i < K; i++)
    {
        io >> L[i] >> R[i];
        R[i]++;
    }
    
    lazy_segtree<int, op, e, int, mapping, composition, id> seg(N);
    seg.set(0, 1);

    for (int i = 0; i < N; i++)
    {
        int ai = seg.get(i);
        for (int k = 0; k < K; ++k)
        {
            if (i + L[k] < N)
            {
                seg.apply(i + L[k], min(i + R[k], N), ai);
            }
        }
    }
    
    io << seg.get(N-1) << BR;
}

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

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

int main(int argc, char const *argv[])
{
    int mod = 998244353;
    int n, k; cin >> n >> k;
    //int step[200010] = {};
    //cout << step[3] << endl;
    int l[15], r[15];
    for (int i = 0; i < k; i++) {
        cin >> l[i] >> r[i];
    }
    
    sort(l,l+k);
    sort(r,r+k);
    rep(i,k) w[i] = r[i] - l[i];
    
    /*
    for (int i = 0; i < k; i++)
    {
        cin >> l >> r;
        for (int j = l; j <= r; j++)
        {
            step[j] = 1;
        }
    }
    */
    long long int dp[200010] = {};
    dp[1] = 1;
    for (int i = 2; i <= n; i++)
    {
        for (int j = 0; j < k; j++)
        {
            if (l[j] >= i) break;
            for (int m = l[j]; m <= min(i,r[j]); m++)
            {
                dp[i] += dp[i-m];
                dp[i] %= mod;
            }
        }
    }
    cout << dp[n] << endl;


    

    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:21:14: error: 'w' was not declared in this scope
   21 |     rep(i,k) w[i] = r[i] - l[i];
      |              ^