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

#include<bits/stdc++.h>
using namespace std;
#pragma region atcoder
#include <atcoder/fenwicktree>
#include <atcoder/modint>
using namespace atcoder;
#pragma endregion
#pragma region macros
using ll = long long;
using vi = vector<int>;
using vs = vector<string>;
using vl = vector<ll>;
using vb = vector<bool>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rrep(i, n) for(int i = n - 1; i >= 0; i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#pragma endregion
#pragma region debug for var, v, vv
#define debug(var)  do{std::cout << #var << " : ";view(var);}while(0)
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){cout << endl;int cnt = 0;for(const auto& v : vv){cout << cnt << "th : "; view(v); cnt++;} cout << endl;}
#pragma endregion

const ll mod = 998244353;
const int inf = 1001001001;
const ll INF = 1001001001001001001;
const int MAX = 2000005;

using mint = modint998244353;
//These are for segment tree
/*int op(int a, int b){return max(a, b);}
int e(){return -1;}
bool f(int v){ return v < target;}
*/

int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

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 (b<a) { a=b; return 1; } return 0; }
ll modpow(ll a, ll p){ll ret = 1; while(p){if(p & 1){ret = ret * a % mod;} a = a * a % mod; p >>= 1;} return ret;}

/*--------------------------------------------------------------------------------------------------------------------------------*/
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n, k; cin >> n >> k;
	vector<int> l(k), r(k);
	fenwick_tree<mint> d(n + 1);
	for(int i = 0; i < k; i++){
		cin >> l[i] >> r[i];
	}
	d.add(1, 1);
	for(int i = 2; i <= n; i++){
		mint cnt = 0;
		for(int j = 0; j < k; j++){
			cnt += d.sum(max(0, i - r[j]), max(0, i - l[j]) + 1);	
		}
		d.add(i, cnt);
	}
	mint ans = d.sum(n, n + 1);
	cout << ans.val() << endl;
} 

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

#include<iostream>
#include<cstring>
#include<stdio.h>
#define int long long
using namespace std;
const int N=5e5,M=15,MOD=998244353;
int a[N];
int f[N];
int x[M],y[M];
int n,m;
int qzh[N];
inline modbez(int a,int b){
	register int res=a%b;
	if(res<0)
		return res+b;
	else
		return res;
}
void DP(){
	f[n]=1;
	for(int i=n;i>=1;i--){
		for(int j=1;j<=m;j++){
			f[i]=modbez(f[i]+qzh[i+x[j]]-qzh[i+y[j]+1],MOD);
//			cout<<i<<" "<<j<<" "<<qzh[i+x[j]]<<" "<<qzh[i+y[j]+1]<<" "<<qzh[i+x[j]]-qzh[i+y[j]+1]<<" "<<f[i]<<endl;
		}
		qzh[i]=modbez(qzh[i+1]+f[i],MOD);
//		cout<<"qzh "<<i<<" ="<<qzh[i]<<endl;
	}
//	for(int i=1;i<=n;i++)
//		cout<<qzh[i]<<" ";
//	cout<<endl;
//	for(int i=1;i<=n;i++){
//		cout<<f[i]<<" ";
//	}
//	cout<<endl;
	cout<<f[1]%MOD<<endl;
}
void common_DP(){//O(n^2)
	f[n]=1;
	for(int i=n;i>=1;i--)
		for(int j=1;j<=m;j++)
			for(int k=x[j];k<=y[j];k++){
				if(i+k<=n){
					f[i]=(f[i]+f[i+k])%MOD;
				}
			}
	cout<<f[1]<<endl;
}
signed main(){
	memset(f,0,sizeof(f));
	memset(a,0,sizeof(a));
	cin>>n>>m;
	for(int i=1;i<=m;i++){
		cin>>x[i]>>y[i];
	}
	if(n>1e4)
		common_DP();
	else
		DP();
}










Compiler output:
a.cc:12:8: error: ISO C++ forbids declaration of 'modbez' with no type [-fpermissive]
   12 | inline modbez(int a,int b){
      |        ^~~~~~
a.cc: In function 'int modbez(long long int, long long int)':
a.cc:13:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   13 |         register int res=a%b;
      |                      ^~~
Language: C++

#include<iostream>
#include<cstring>
#define int long long
using namespace std;
const int N=5e5,M=15,MOD=998244353;
int a[N];
int f[N];
int x[M],y[M];
int n,m;
int qzh[N];
inline modbez(int a,int b){
	register int res=a%b;
	if(res<0)
		return res+b;
	else
		return res;
}
void DP(){
	f[n]=1;
	for(int i=n;i>=1;i--){
		for(int j=1;j<=m;j++){
			f[i]=modbez(f[i]+qzh[i+x[j]]-qzh[i+y[j]+1],MOD);
//			cout<<i<<" "<<j<<" "<<qzh[i+x[j]]<<" "<<qzh[i+y[j]+1]<<" "<<qzh[i+x[j]]-qzh[i+y[j]+1]<<" "<<f[i]<<endl;
		}
		qzh[i]=modbez(qzh[i+1]+f[i],MOD);
//		cout<<"qzh "<<i<<" ="<<qzh[i]<<endl;
	}
//	for(int i=1;i<=n;i++)
//		cout<<qzh[i]<<" ";
//	cout<<endl;
//	for(int i=1;i<=n;i++){
//		cout<<f[i]<<" ";
//	}
//	cout<<endl;
	cout<<f[1]%MOD<<endl;
}
void common_DP(){//O(n^2)
	f[n]=1;
	for(int i=n;i>=1;i--)
		for(int j=1;j<=m;j++)
			for(int k=x[j];k<=y[j];k++){
				if(i+k<=n){
					f[i]=(f[i]+f[i+k])%MOD;
				}
			}
	cout<<f[1]<<endl;
}
signed main(){
	memset(f,0,sizeof(f));
	memset(a,0,sizeof(a));
	cin>>n>>m;
	for(int i=1;i<=m;i++){
		cin>>x[i]>>y[i];
	}
	if(n>1e4)
		common_DP();
	else
		DP();
}










Compiler output:
a.cc:11:8: error: ISO C++ forbids declaration of 'modbez' with no type [-fpermissive]
   11 | inline modbez(int a,int b){
      |        ^~~~~~
a.cc: In function 'int modbez(long long int, long long int)':
a.cc:12:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   12 |         register int res=a%b;
      |                      ^~~
Language: C++

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


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

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

	int* l = new int[k] {0};
	int* r = new int[k] {0};
	
	for (int i = 0; i < k; i++)
		cin >> l[i] >> r[i];

	long long* s = new int[k] {0};
	long long dp[200000] = { 0 };
	long long temp;

	dp[1] = 1;

	const int m = 998244353;

	for (int i = 2; i <= n; i++) {
		for (int j = 0; j < k; j++) {
			if (i - l[j] >= 1)
				s[j] = (s[j] + dp[i - l[j]]) % m;			
			if (i - r[j] - 1 >= 1) {
				temp = s[j] - dp[i - r[j] - 1];
				if (temp < 0)
					temp += m;
				s[j] = temp;
			}
			dp[i] = (dp[i] + s[j]) % 998244353;
		}		
	}

	cout << dp[n];



	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:37: error: cannot convert 'int*' to 'long long int*' in initialization
   19 |         long long* s = new int[k] {0};
      |                                     ^
Language: C++

#include<bits/stdc++.h>
#define mod (long long int) (1e9+7)
using namespace std;
int main(){
   int n,k;cin>>n>>k;
   int l[k],r[k];
   for(int i=0;i<k;i++){
    cin>>l[i]>>r[i];
   }
   int dp[n+1]={0};
   int pre[n+1]={0};
   dp[1]=1;pre[1]=1;
   for(int i=2;i<=n;i++){
    for(int j=0;j<k;j++){
        if(i<=l[j]) continue;
        int left=l[j];
        int right=min(r[j],i-1);
        int val = (pref[i - left] - pref[i- right - 1] + mod) % mod;
            
            dp[i] = (dp[i] + val ) % mod;
        }
        pref[i] = (pref[i - 1] % mod + dp[i] % mod) % mod;
    }
    cout << dp[n]; return 0;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:18:20: error: 'pref' was not declared in this scope; did you mean 'pre'?
   18 |         int val = (pref[i - left] - pref[i- right - 1] + mod) % mod;
      |                    ^~~~
      |                    pre
a.cc:22:9: error: 'pref' was not declared in this scope; did you mean 'pre'?
   22 |         pref[i] = (pref[i - 1] % mod + dp[i] % mod) % mod;
      |         ^~~~
      |         pre
Language: C++

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;


int main() {
	int n,k;
    cin>>n>>k;
    long long mod = 998244353;
    vector<int> A;
    int l,r;
    long long count = 0;
    for(int i=0; i<k; i++){
        cin>>l>>r;
        for(int j=l; j<=r; j++) A.push_back(j);
    }
    sort(A.begin(), A.end());
    stack<int> s;
    s.push(1);
    while(!s.empty()){
    	int temp = s.top();
    	s.pop();
    	for(int i=0;i<A.size();i++){
    		if(temp+A[i]==n){
    			count++:
			}
			else if(temp+A[i]<n){
				s.push(temp+A[i]);
			}
			else{
				break;
			}
		}
	}
	cout<<count%mod;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:32: error: expected ';' before ':' token
   29 |                         count++:
      |                                ^
      |                                ;
Language: C++

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;


int main() {
	int n,k;
    cin>>n>>k;
    long long mod = 998244353;
    vector<int> A;
    int l,r;
    long long count = 0;
    for(int i=0; i<k; i++){
        cin>>l>>r;
        for(int j=l; j<=r; j++) A.push_back(j);
    }
    sort(A.begin(), A.end());
    stack<int> s;
    s.push(1);
    while(!s.empty()){
    	int temp = s.top();
    	s.pop();
    	for(int i=0;i<A.size();i++){
    		if(temp+A[i]==5){
    			count++:
			}
			else if(temp+A[i]<5){
				s.push(temp+A[i]);
			}
		}
	}
	cout<<count%mod;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:32: error: expected ';' before ':' token
   29 |                         count++:
      |                                ^
      |                                ;
Language: C++

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;


int main() {
	int n,k;
    cin>>n>>k;
    long long mod = 998244353;
    vector<int> A;
    int l,r;
    long long count = 0;
    for(int i=0; i<k; i++){
        cin>>l>>r;
        for(int j=l; j<=r; j++) A.push_back(j);
    }
    sort(A.begin(), A.end());
    stack<int> s;
    s.push(1);
    while(!s.empty()){
    	int temp = s.top();
    	s.pop();
    	for(int i=0;i<A.size());i++){
    		if(temp+A[i]==5){
    			count++:
			}
			else if(temp+A[i]<5){
				s.push(temp+A[i]);
			}
		}
	}
	cout<<count%mod;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:31: error: expected ';' before ')' token
   27 |         for(int i=0;i<A.size());i++){
      |                               ^
      |                               ;
a.cc:27:33: error: 'i' was not declared in this scope
   27 |         for(int i=0;i<A.size());i++){
      |                                 ^
Language: C++

#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;

template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define ll long long
#define ull unsigned long long
#define pii pair<int, int>
#define all(x) x.begin(), x.end()
const int N = 2e5+ 2, mod = 998244353;

void add(int& a, int b){
    if ((a += b) >= mod) a -= mod;
}


void solve() {
    int n, k;
    cin >> n >> k;
    vector<pii> p(k);
    for(int i = 0; i < k; i++) {
        cin >> p[i].first >> p[i].second;
    }
    vector<int> sum(n + 1);
    dp[1] = 1;
    for(int i = 2; i < n; i++) {
        ll curr = 0;
        for(int j = 0; j < k; j++) {
            if(v[j].first >= i) {
                continue;
            }
            int l = max(1, i - v[j].second);
            int r = i - v[j].first;
            curr += sum[r] - sum[l - 1];
        }
        curr %= mod;
        if(curr < 0) {
            curr += mod;
        }
        sum[i] = (sum[i - 1] + curr) % mod;
    }
    ll ans = sum[n] - sum[n - 1];
    if(ans < 0) {
        ans += mod;
    }
    cout << ans;   
}    


int main() {
  int tt = 1;
  // cin >> tt;
  for (int tc = 1; tc <= tt; tc++) {
    // cout << "Case #:" << tc << " ";
    solve();
  }
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:30:5: error: 'dp' was not declared in this scope; did you mean 'p'?
   30 |     dp[1] = 1;
      |     ^~
      |     p
a.cc:34:16: error: 'v' was not declared in this scope
   34 |             if(v[j].first >= i) {
      |                ^
a.cc:37:32: error: 'v' was not declared in this scope
   37 |             int l = max(1, i - v[j].second);
      |                                ^
Language: C++


#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#include <ctime>
#include<deque>
using namespace std;

#define fr                first
#define se                second
#define int               long long
#define pb                push_back
#define mp                make_pair
#define pii               pair<int,int>
#define vi                vector<int>
#define vvi                vector<vector<int>>
#define mi                map<int,int>
#define pq                priority_queue<int>
#define set_bits(x)       __builtin_popcountll(x)
#define mod               1000000007
#define inf               1e18                        //Defining infinity the overflow of int
#define ps(x,y)           fixed<<setprecision(y)<<x   //for defining the precision of the decimal upto y places.
#define zrosetbits(x)     __builtin_ctzll(x)         //it will give no of 0's before the first 1 from the right.
#define mk(a,n,type)      type *a=new type[n];
#define test(t)           int t; cin>>t; while(t--)
#define no                cout<<"No\n";
#define yes               cout<<"Yes\n";
#define NO                cout<<"NO\n";
#define YES               cout<<"YES\n";
//#define for(i,n)          for(int i=0;i<n;i++)
//#define for(j,n)          for(int j=0;j<n;j++)
// #define forn(i,n)               for(int i=0;i<n;i--)



//**********************************************************************************************************
struct custom_hash
{
  static uint64_t splitmix64(uint64_t x)
  {
    // http://xorshift.di.unimi.it/splitmix64.c
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }

  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};

#define safemap               unordered_map<int,int,custom_hash>

//*********************************************************************************************************

void io()
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin.tie(0);
}


int helper(int cell, vector<int> &v, vi &dp, int n)
{
  //Base Case
  if (cell == n)
    return 1;

  if (dp[cell] != -1)
    return dp[cell];

  //recursive Case
  int res = 0;

  for (int i = 0; i < v.size(); i++)
  {
    if (cell + v[i] <= n)
      res = (res % 998244353 + helper( cell + v[i], v, dp, n) % 998244353) % 998244353;

    else
      break;
  }

  dp[cell] = res;

  return res;
}



int32_t main()
{
  int n, k;
  cin >> n >> k;

  map<int, int> mp;

  for (int i = 0; i < k; i++)
  {
    cin >> p >> q;

    mp[p]++;
    mp[q]++;
  }

  vi v;

  for (auto x : mp)
    v.pb(x.first);

  sort(v.begin(), v.end());

  vi dp(n + 1, -1);

  cout <<  helper(1, v, dp, n) % 998244353 << "\n";

  return 0;
}


Compiler output:
a.cc: In function 'int32_t main()':
a.cc:102:12: error: 'p' was not declared in this scope
  102 |     cin >> p >> q;
      |            ^
a.cc:102:17: error: 'q' was not declared in this scope
  102 |     cin >> p >> q;
      |                 ^
Language: C++

#include <bits/stdc++.h>
#include <atcoder/all>
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define ALL(x) x.begin(), x.end()
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
using namespace atcoder;
random_device rnd;
mt19937 mt(rnd());
using ll = long long;
using lld = long double;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<ll>;
using VVL = vector<VL>;
using PII = pair<int, int>;
const int IINF = 1 << 30;
const ll INF = 1ll << 60;
const ll MOD = 998244353;
ll op(ll a, ll b)
{
    return (a + b) % MOD;
}

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

int main()
{
    int n, k;
    cin >> n >> k;
    segtree<ll, op, e> seg(n + 10);
    vector<PII> v(k);
    rep(i, k)
    {
        cin >> v[i].first >> v[i].second;
    }
    seg.set(0, 1);
    rep(i, 1, n)
    {
        rep(j, k)
        {
            ll cur = seg.get(i);
            ll tmp = (cur + seg.prod((ll)max(0ll, (ll)i - v[j].second), (ll)max(0, i - v[j].first + 1)) % MOD) % MOD;
            seg.set(i, tmp);
        }
    }
    cout << seg.get(n - 1) << 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/segtree>
#include <atcoder/modint>
using namespace std;
using namespace atcoder;

typedef long long ll;

const long long MOD = 998244353;
using mint = modint998244353;

mint op(mint lhs, mint rhs) {
  return lhs + rhs;
}

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

void solve(long long N, long long K, std::vector<long long> L, std::vector<long long> R){
  segtree<mint, op, e> dp(N);
  dp.set(0, 1);
  for (ll i = 1; i < N; ++i) {
    mint t = 0;
    for (ll j = 0; j < K; ++j) {
      ll l = max(i - R[j], 0ll);
      ll r = max(i - L[j]+1, 0ll);
      t += dp.prod(l,r);
    }
    dp.set(i, t);
  }
  cout << dp.get(N-1).val() << endl;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long N;
  std::cin >> N;
  long long K;
  std::cin >> K;
  std::vector<long long> L(K);
  std::vector<long long> R(K);
  for(int i = 0 ; i < K ; i++){
    std::cin >> L[i];
    std::cin >> R[i];
  }
  solve(N, K, std::move(L), std::move(R));
  return 0;
}


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

#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define sz size()
#define ll long long
#define all(_v) _v.begin(), _v.end()
#define pii pair <int, int>
#define pll pair <ll, ll>
#define pvllvll pair <vector <ll>, vector <ll> >
#define ld long double
#define veci vector <int>
#define vecll vector <ll>


const int dx[4] = {1, -1, 0, 0};
const int dy[4] = {0, 0, -1, 1};
const double PI = 3.1415926535897932384626433832795;
const double eps = 1e-9;
const int MOD1 = 1e9 + 7;
const int MOD2 = 998244353;

const int MAXN = 2e5 + 10;
int n, k;
set <int> s;
int dp[MAXN];
int dfs(int v = 1) {
    if(~dp[v]) return dp[v];
    int res = (v == n);
    for(auto to : s)
        if(v + to <= n)
            res = (res + dfs(v + to) % MOD2;
    return dp[v] = res;
}

void solve() {
    memset(dp, -1, sizeof(dp));
    cin >> n >> k;
    for(int i = 1; i <= k; ++i) {
        int l, r;
        cin >> l >> r;
        while(l <= r) s.insert(l++);
    }
    cout << dfs();
}

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int T = 1;
    ///cin >> T;
    while(T--) solve(), cout << '\n';
    return 0;
}


Compiler output:
a.cc: In function 'int dfs(int)':
a.cc:34:44: error: expected ')' before ';' token
   34 |             res = (res + dfs(v + to) % MOD2;
      |                   ~                        ^
      |                                            )
Language: C++

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

int main() {
    int n,k;
    cin>>n>>k;
    vector<int> s;
    int l,r;
    rep(j,k){
        cin>>l>>r;
        for (int i = l-1; i < r; i++)s.push_back(i+1);
    }

    vector<ll> dp(n+1,0);
    rep(i,s.size())dp[s[i]-1]=1;
    int b=s.size();
    rep(i,n){
        for(int j=0; j<b; j++){
            if(i-s[j]>=0){
                dp[i]+=dp[i-s[j]];

                }

        }

    }
    dp[i]%=LIMIT;
    cout<<dp[n-2]<<endl;
    return 0;
}

//5 2
//1 1
//3 4

//4

Compiler output:
a.cc: In function 'int main()':
a.cc:31:8: error: 'i' was not declared in this scope
   31 |     dp[i]%=LIMIT;
      |        ^
Language: C++

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

int main() {
  int N, K;
  cin >> N >> K;
  // 集合S
  vector<int> S;
  rep(i,K){
    int a, b;
    cin >> a >> b;
    for(int j=a; j<=b; j++){
      S.push_back(j);
    }
  }
  //sort(S.begin(), S.end()); //S昇順に並べ替え いる??
  //移動距離はN-1
  int len = S.size();
  vector<long long> A(N);
  A.at(N-1)=1;
  rep(i,N-1){
    for(int j=len-1,j>=0; j--){
      if(N-1-i>=S.at(j)){
        A.at(N-1-i-S.at(j))+=A.at(N-1-i);
        //if(A.at(N-1-i-S.at(j))>998244353) A.at(N-1-i-S.at(j))%=998244353;
      }
    }
    //A.at(N-1-i)=0;
    A.erase(A.begin()+N-1-i);
  }
  
  
  cout << A.at(0)%998244353 << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:22: error: expected ';' before '>=' token
   23 |     for(int j=len-1,j>=0; j--){
      |                      ^~
      |                      ;
a.cc:23:22: error: expected primary-expression before '>=' token
   23 |     for(int j=len-1,j>=0; j--){
      |                      ^~
Language: C++

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repab(i, a, b) for (int i = a; i <= (int)(b); i++)
#define ll long long
#define vec vector
#define pb push_back
#define ft first
#define sd second
#define all(vec) vec.begin(), vec.end()
#define endl "\n"

typedef pair<int, int> P;

const int MOD = 1e9 + 7;
const int INF = 1001001001;
const int dx[4] = {1, 0,-1, 0};
const int dy[4] = {0, 1, 0,-1};

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

int n, k;
int s[20];
ll dp[200001];
ll ans = 0;

int main(){
  cin >> n >> k;
  rep(i, k){
    int l, r;
    cin >> l >> r;
    s[2*i] = l;
    s[2*i+1] = r;
  }

  rep(i, n){
    dp[i] = 0;
  }

  dp[1] = 1;
  rep(p, n){
    rep(i, k){
      for(int j=s[2*i]; j<=s[2*i+1]; j++){
        if(i+1 + j <= n){
          dp[i+1 + j] += dp[i+1];
          dp[i+1 + j] =% 998244353;
        }
      }
    }
  }

  

  cout << dp[n] % 998244353 << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:47:24: error: expected primary-expression before '%' token
   47 |           dp[i+1 + j] =% 998244353;
      |                        ^
Language: C++

/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

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

using namespace std;

ll dp[200003][200003];

vector<ll> s;

ll n;

ll solve(ll i, ll d){
    if(i+d==n) return (ll)1;
    if(i+d>n) return (ll)0;
    
    if(dp[i][d]!=-1) return dp[i][d];
    
    ll sum=0;
    for(auto ele:s){
        sum+=solve(i+d,ele)%(ll)998244353;
    }
    return dp[i][d]=sum;
}

ll ans(ll x){
    ll sum=0;
    for(auto ele:s) sum+=solve(x,ele)%(ll)998244353;
    return sum;
}

int main()
{
    ll k;
    cin>>n>>k;
    
    memset(dp,-1,sizeof(dp));
    
    for(ll i=0;i<k;i++){
        ll l,r;
        cin>>l>>r;
        for(ll j=l;j<=r;j++) s.push_back(j);
    }
    
    cout<<ans(1)<<'\n';
    
    return 0;
}


Compiler output:
/tmp/ccJDYmo5.o: in function `solve(long long, long long)':
a.cc:(.text+0x1e): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccJDYmo5.o
a.cc:(.text+0x3f): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccJDYmo5.o
a.cc:(.text+0xb2): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/ccJDYmo5.o
/tmp/ccJDYmo5.o: in function `ans(long long)':
a.cc:(.text+0x1cc): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/ccJDYmo5.o
/tmp/ccJDYmo5.o: in function `main':
a.cc:(.text+0x285): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccJDYmo5.o
a.cc:(.text+0x314): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/ccJDYmo5.o
/tmp/ccJDYmo5.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x37f): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/ccJDYmo5.o
a.cc:(.text+0x398): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/ccJDYmo5.o
collect2: error: ld returned 1 exit status
Language: C++

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

#define _GLIBCXX_DEBUG
#define all(v) (v).begin(),(v).end()

using ll=long long;
using pii=pair<int, int>;
using vi=vector<int>;
using vii=vector<vector<int>>;

const ll LINF=1LL<<60;
const int INF=1<<29;
const ll MOD=998244353;

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


int main(){
    int N, K; cin >> N >> K;
    vi L(K), R(K);
    for(int i=0; i<K; i++){
        cin >> L[i] >> R[i];
    }
    vector<ll> dp(N+1, 0);
    for(int i=0; i<K; i++){
        dp[L[j]]=1;
        dp[R[j]]=1;
    }
    for(int i=1; i<=N; i++){
        dp[i]=dp[i-1];
        for(int j=0; j<K; j++){
            if(i-R[j] >= 0) dp[i]=(dp[i]+dp[i-R[j]])%MOD;
            if(i-L[j]-1 >= 0) dp[i]=(dp[i]-dp[i-L[j]-1])%MOD;
        }
    }

    if(dp[N] < 0) dp[N]+=MOD;
    cout << dp[N] << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:14: error: 'j' was not declared in this scope
   28 |         dp[L[j]]=1;
      |              ^
Language: C++

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#include <atcoder/all>

using namespace std;
using namespace atcoder;

#define all(v) (v).begin(),(v).end()
using ll = long long;
constexpr ll INF = 1e18;
constexpr ll MOD = 998244353;

// https://qiita.com/drken/items/3b4fdf0a78e7a138cd9a
long long mod(long long val, long long m) {
  long long res = val % m;
  if (res < 0) res += m;
  return res;
}

int main(void) {
    ll N, K;
    cin >> N >> K;
    vector<ll> L(K), R(K);
    for (ll i = 0; i < K; i++) {
        cin >> L[i] >> R[i];
    }

    vector<ll> map(N*3);
    // vector<ll> dmap(N*2);
    map[0] = 0;
    map[1] = -1;
    ll c = 1;
    for (ll i = 0; i < N; i++) {
        c += map[i];
        for (ll j = 0; j < K; j++) {
            map[i+L[j]] = (map[i+L[j]] + c) % MOD;
            map[i+R[j]+1] = mod((map[i+R[j]+1] - c) % MOD, MOD);
        }
    }
    cout << c << endl;
    return 0;
}


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

#include <bits/stdc++.h>


typedef long long ll;

using namespace std;


const ll mod=998244353;


//int dp[200001][200001];



int main(){

    ll N,K;

    cin>>N>>K;

    ll L,R;

    vector<ll> vec;

    for(ll i=0;i<K;i++){

        cin>>L>>R;
        for(ll j=L;j<=R;j++){
            vec.push_back(j);
        }
    }

    sort(vec.begin(),vec.end());
/*
    cout<<"sort"<<endl;
    for(int i=0;i<vec.size();i++){
        cout<<vec[i]<<" ";
    }
    cout<<endl;
    */
 ll last=N/vec[0]+1;
    vector<ll>dp(N+1,0);
    dp[1]=1;

   
/*
    cout<<last<<endl;


    cout<<"===="<<endl;
*/

   ll ans=0;

    for(ll i=1;i<=last;i++){
         vector<ll>dp_n(N+1,0);
        for(ll j=1;j<=N;j++){
            for(ll k=0;k<(ll)vec.size();k++){
                if(j+vec[k]<=N){
                    dp_n[j+vec[k]]=(dp_n[j+vec[k]]+dp[j])%mod;
                }else{
                    break;
                }
            }
            
        }
        ans=(ans+dp_n[N]);

        swap(dp,dp_n);


    }
/*
    for(int i=0;i<=last;i++){
        for(int j=0;j<=N;j++){
            cout<<dp[i][j]<<" ";
        }
        cout<<endl;
    }
*/
    ll ans=0;

    cout<<ans<<endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:82:8: error: redeclaration of 'll ans'
   82 |     ll ans=0;
      |        ^~~
a.cc:54:7: note: 'll ans' previously declared here
   54 |    ll ans=0;
      |       ^~~
Language: C++

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

using ll = long long;
//print(fixed << setprecision(10));
#define rep(i,n) for(ll i = 0; i < (n); i++)
#define repk(i,n,k) for(ll i = k; i < (n); i++)
#define all(n) n.begin(), n.end()
#define print(n) cout << n << endl
double PI = acos(-1.0);
int INF = 1e9;
ll LINF = 1e18;
ll MOD = 1e9+7;
ll mods = 998244353;

int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    
    ll n;
    int k;
    cin >> n >> k;
    vector<ll> s(k*2);
    ll l,r,lmin=n;
    rep(i,k){
        cin >> l >> r;
        s[i*2] = l;
        s[i*2+1] = r;
        lmin = min(l,min); 
    }
    vector<ll> tb(n+1,0);
    tb[1]=1;
    for(ll i=1;i<n-lmin;i++){
        if(tb[i]==0) continue;
        rep(j,k){
            l = s[j*2];
            r = s[j*2+1];
            rep(m,r-l+1){
                if(i+l+m>n) break;
                tb[i+l+m] += tb[i];
                if(tb[i+l+m]>mods) tb[i+l+m]%=mods;
            }
        }
    }
    print(tb[n]);
    return 0;
}


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

//xenowitz -- Jai Shree Ram
#include<bits/stdc++.h>
using namespace std;

#define fori(i,a,b) for (long int i = a; i <= b ; ++i)
#define ford(i,a,b) for(long int i = a;i >= b ; --i)
#define mk make_pair
#define mod 998244353
#define pb push_back
#define eb emplace_back
#define vec vector<long long int>
#define ll long long
#define rnd mt19937_64 rng(chrono::high_resolution_clock::now().time_since_epoch().count())
#define pi pair<long long int,long long int>
#define sc second
#define fs first
#define stf shrink_to_fit

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

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

  vector<pair<ll,ll> > v;
  fori(i,1,k) {
      cin >> l >> r;
      v.pb(mk(l, r));
  }

  vector<ll> dp(410005, 0);
  dp[1] = 1;

  fori(i, 1, n) {
     dp[i] = (dp[i] + dp[i-1])%mod;
     for (auto x : v) {
         arr[i+x.fs] = (dp[i] + arr[i+x.fs])%mod;
         arr[i+x.sc+1] = (-dp[i] + arr[i+x.sc+1])%mod;
     }
  }

  cout << dp[n]%mod << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:10: error: 'arr' was not declared in this scope
   39 |          arr[i+x.fs] = (dp[i] + arr[i+x.fs])%mod;
      |          ^~~
Language: C++

#include <bits/stdc++.h>

using ll = long long;
const ll mod = 998244353;
using namespace std;
#define int ll
struct node{
	ll val = 0;
	ll lz = 0;
} st[1 << 19];

void push(int p,int l = 0,int r = 0){
	st[p].val %= mod;
	st[p].val += st[p].lz * (r - l + 1);
	st[p].val %= mod;
	st[p*2].lz += st[p].lz;
	st[p*2].lz %= mod;
	st[p*2+1].lz += st[p].lz;
	st[p*2+1].lz %= mod;
	st[p].lz = 0;
}
void update(int p,int l,int r,int i,int j,ll val){
	push(p);
	if(r < i || j < l) return;
	if(i <= l && r <= j){
		st[p].lz = val;
		push(p,l,r);
	}else{
		int m = (l+r)/2;
		update(p*2,l,m,i,j,val);
		update(p*2+1,m+1,r,i,j,val);
	}
}

int qry(int p,int l,int r,int i){
	push(p);
	if(l == r){
		return st[p].val;
	}else{
		int m = (l+r)/2;
		if(i <= m){
			return qry(p*2,l,m,i);
		}else{
			return qry(p*2+1,m+1,r,i);
		}
	}
}

int main(){
	int n,k;
	cin >> n >> k;
	vector<pair<int,int>> segs;
	while(k--){
		int l,r;
		cin >> l >> r;
		segs.emplace_back(l,r);
	}
	update(1,0,n-1,0,0,1);
	for(int i = 0; i < n-1; i++){
		for(auto p: segs){
			int l,r;
			l = p.first; r = p.second;
			if(i + l < n){
				update(1,0,n-1,i+l,min(n-1,i+r),qry(1,0,n-1,i)%mod);
			}
		}
	}
	cout << qry(1,0,n-1,n-1);
}

Compiler output:
a.cc:6:13: error: '::main' must return 'int'
    6 | #define int ll
      |             ^~
a.cc:49:1: note: in expansion of macro 'int'
   49 | int main(){
      | ^~~
Language: C++

int main() {
	//cout << "" << endl; // prints
	int N, K;
	const int mod = 998244353;
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin >> N >> K;
	int dp[N+1];
		dp[0] = 0;
		dp[1] = 1;
	for(int a = 2; a <= N; a++){
		dp[a] = 0;
	}
	int LR[K+1][3];
	int LRmax = 0;
	int LRmin = 200001;
	bool TF[N+1];
	for(int i = 0; i <= N; i++){
		TF[i] = false;
	}
	for(int i = 1; i <= K; i++){
		cin >> LR[i][1] >> LR[i][2];
		for(int j = LR[i][1]; j <= LR[i][2]; j++){
			TF[j] = true;
		}
		if(LR[i][1] < LRmin){
			LRmin = LR[i][1];
		}
		if(LR[i][2] > LRmax){
			LRmax = LR[i][2];
		}
	}

	for(int i = 1; i <= N; i++){
		for(int j = i - LRmax; j < i; j++){
			if(TF[i - j] == true){
				dp[i] += dp[j];
			}
			dp[i] = dp[i] % mod;
		}
	}
	cout << dp[N] << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope
    5 |         cin.tie(0);
      |         ^~~
a.cc:6:9: error: 'ios' has not been declared
    6 |         ios::sync_with_stdio(false);
      |         ^~~
a.cc:42:9: error: 'cout' was not declared in this scope
   42 |         cout << dp[N] << endl;
      |         ^~~~
a.cc:42:26: error: 'endl' was not declared in this scope
   42 |         cout << dp[N] << endl;
      |                          ^~~~
Language: C++

int main(){
    int N,K;
    cin>>N>>K;
    int L[K],R[K];
    vector<int> S;
    int M[N];
    for(int i=0;i<K;i++){
        cin>>L[i]>>R[i];
        for(int j=L[i];j<=R[i];j++){
            S.push_back(j);
        }
    }
    for(int i=0;i<N;i++){
        M[i]=0;
    }
    int ans = 0;
    int maxElementIndex = std::min_element(S.begin(),S.end()) - S.begin();
    int min = *std::min_element(S.begin(), S.end());
    M[N-min-1] = 1;   //最後のところからは一通り。
    ans=1;
    sort(S.begin(),S.end());//昇順ソート
    for(int i=N-min-2;i>=0;i--){  //最後から二番目からスタート
        for(int j=0;(j<K)&&(i+S.at(j))<N;j++){
            M[i] = S.at(j)+M[i+S.at(j)];
            ans++;
            ans %= 998244353;
        }
    }
    cout<<M[0]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin>>N>>K;
      |     ^~~
a.cc:5:5: error: 'vector' was not declared in this scope
    5 |     vector<int> S;
      |     ^~~~~~
a.cc:5:12: error: expected primary-expression before 'int'
    5 |     vector<int> S;
      |            ^~~
a.cc:10:13: error: 'S' was not declared in this scope
   10 |             S.push_back(j);
      |             ^
a.cc:17:32: error: 'min_element' is not a member of 'std'
   17 |     int maxElementIndex = std::min_element(S.begin(),S.end()) - S.begin();
      |                                ^~~~~~~~~~~
a.cc:17:44: error: 'S' was not declared in this scope
   17 |     int maxElementIndex = std::min_element(S.begin(),S.end()) - S.begin();
      |                                            ^
a.cc:18:21: error: 'min_element' is not a member of 'std'
   18 |     int min = *std::min_element(S.begin(), S.end());
      |                     ^~~~~~~~~~~
a.cc:21:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   21 |     sort(S.begin(),S.end());//昇順ソート
      |     ^~~~
      |     short
a.cc:29:5: error: 'cout' was not declared in this scope
   29 |     cout<<M[0]<<endl;
      |     ^~~~
a.cc:29:17: error: 'endl' was not declared in this scope
   29 |     cout<<M[0]<<endl;
      |                 ^~~~
Language: C++

#include <bits/stdc++.h>
#include <string>
#include <algorithm>
using namespace std; //std::の省略のため
using ll = long long;

#define INF 1000000000000 //10^12:∞
#define MOD 998244353
#define MAXR 100000 //10^5:配列の最大のrange
const int MAX = 510000;

long long fac[MAX], finv[MAX], inv[MAX];

ll cnt = 0;
ll size;
ll n, k;
string d;

void solve(ll sum)
{
    if (sum == n)
    {
        cnt++;
        cnt %= MOD;
        return;
    }
    else if (sum > n)
    {
        return;
    }

    for (ll i = 0; i < size; i++)
    {
        solve(sum + d[i]);
    }
}

int main()
{
    cin >> n >> k;

    ll r, l;

    for (ll i = 0; i < k; i++)
    {
        cin >> l >> r;
        for (ll j = l; j <= r; j++)
        {
            d += j;
        }
    }

    size = d.size();

    solve(1);

    cout << cnt << endl;
}


Compiler output:
a.cc: In function 'void solve(ll)':
a.cc:32:24: error: reference to 'size' is ambiguous
   32 |     for (ll i = 0; i < size; i++)
      |                        ^~~~
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:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:15:4: note:                 'll size'
   15 | ll size;
      |    ^~~~
a.cc: In function 'int main()':
a.cc:53:5: error: reference to 'size' is ambiguous
   53 |     size = d.size();
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:15:4: note:                 'll size'
   15 | ll size;
      |    ^~~~
Language: C++

#include <bits/stdc++.h>
#include <string>
#include <algorithm>
using namespace std; //std::の省略のため
using ll = long long;

#define INF 1000000000000 //10^12:∞
#define MOD 998244353
#define MAXR 100000 //10^5:配列の最大のrange
const int MAX = 510000;

long long fac[MAX], finv[MAX], inv[MAX];

ll cnt = 0;
ll size;
ll n, k;
string d;

void solve(ll sum)
{
    if (sum == n)
    {
        cnt++;
        cnt %= MOD;
        return;
    }
    else if (sum > n)
    {
        return;
    }

    for (ll i = 0; i < size; i++)
    {
        solve(sum + d[i]);
    }
}

int main()
{
    cin >> n >> k;

    ll tmp = 0;

    ll r, l;

    for (ll i = 0; i < k; i++)
    {
        cin >> l >> r;
        for (ll j = l; j <= r; j++)
        {
            d += j;
        }
    }

    size = d.size();
    cout << size << endl;

    solve(1);

    cout << cnt << endl;
}


Compiler output:
a.cc: In function 'void solve(ll)':
a.cc:32:24: error: reference to 'size' is ambiguous
   32 |     for (ll i = 0; i < size; i++)
      |                        ^~~~
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:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:15:4: note:                 'll size'
   15 | ll size;
      |    ^~~~
a.cc: In function 'int main()':
a.cc:55:5: error: reference to 'size' is ambiguous
   55 |     size = d.size();
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:15:4: note:                 'll size'
   15 | ll size;
      |    ^~~~
a.cc:56:13: error: reference to 'size' is ambiguous
   56 |     cout << size << endl;
      |             ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:15:4: note:                 'll size'
   15 | ll size;
      |    ^~~~
Language: C++

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

using namespace std;

ll dp[200003][200003];

unordered_set<ll> s;

ll n;

ll solve(ll i, ll d){
    if(i+d==n) return (ll)1;
    if(i+d>n) return (ll)0;
    
    if(dp[i][d]!=-1) return dp[i][d];
    
    ll sum=0;
    for(auto ele:s){
        sum+=solve(i+d,ele)%(ll)998244353;
    }
    return dp[i][d]=sum;
}

ll ans(ll x){
    ll sum=0;
    for(auto ele:s) sum+=solve(x,ele)%(ll)998244353;
    return sum;
}

int main()
{
    ll k;
    cin>>n>>k;
    
    memset(dp,-1,sizeof(dp));
    
    for(ll i=0;i<k;i++){
        ll l,r;
        cin>>l>>r;
        for(ll j=l;j<=r;j++) s.insert(j);
    }
    
    cout<<ans(1)<<'\n';
    
    return 0;
}


Compiler output:
/tmp/ccjEBPnf.o: in function `solve(long long, long long)':
a.cc:(.text+0x1e): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccjEBPnf.o
a.cc:(.text+0x3f): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccjEBPnf.o
a.cc:(.text+0xb2): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/ccjEBPnf.o
/tmp/ccjEBPnf.o: in function `ans(long long)':
a.cc:(.text+0x1cc): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/ccjEBPnf.o
/tmp/ccjEBPnf.o: in function `main':
a.cc:(.text+0x285): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccjEBPnf.o
a.cc:(.text+0x314): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/ccjEBPnf.o
/tmp/ccjEBPnf.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x37f): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/ccjEBPnf.o
a.cc:(.text+0x398): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/ccjEBPnf.o
collect2: error: ld returned 1 exit status
Language: C++

from collections import deque

N, K = map(int, input().split())
d = [0]*(N+1)
l = []
for i in range(K):
    l.append(list(map(int, input().split())))
for i in range(K):
    a, b = l[i][0], l[i][1]
    for j in range(b-a+1):
        d[a+j] = 1
di = []
for i in range(len(d)):
    if d[i]==1:
        di.append(i)

adj = {}
for i in range(N-1):
    lis = [i+1+j for j in di if i+1+j<=N]
    adj[i+1] = lis

ans = [0]*(N+1)
ans[1] = 1
for i in range(N-1):
    #i+1番目
    li = adj[i+1]
    for x in li:
        ans[x] = ans[x] + ans[i+1]
        if(ans[x]>998244353):
            ans[x] = ans[x]%998244353
print (ans[-1]%998244353)

Compiler output:
a.cc:25:6: error: invalid preprocessing directive #i; did you mean #if?
   25 |     #i+1番目
      |      ^
      |      if
a.cc:1:1: error: 'from' does not name a type
    1 | from collections import deque
      | ^~~~
a.cc:18:1: error: expected unqualified-id before 'for'
   18 | for i in range(N-1):
      | ^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;
long long d[200000];
long long go(int n, vector<int> &s)
{
	if (n <= 0)
		return 0;
	if (n == 1)
		return 1;
	if (d[n] != -1)
		return d[n];


	long long sum = 0;
	for (int step : s)
	{
		long long temp = go(n - step, s);
		sum += temp;
		sum %= 998244353;
	}
	
	d[n] = sum;

	return sum;
}

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());

	memset(d, -1, 200000*sizeof(long long));

	cout << go(n, s) << endl;
	

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:9: error: 'memset' was not declared in this scope
   45 |         memset(d, -1, 200000*sizeof(long long));
      |         ^~~~~~
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 |
Language: C++

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

int main(){
	long long N,K;
	cin >> N >> K;
	vector<long long> pos;
	long long a,b;
	for(int loop=0;loop<K;loop++){
		cin >> a >> b;
		while(a<=b){
			pos.push_back(a);
			a++;
		}
	}
	vector<long long> dp(N,0);
	dp[0]=1;
	for(int loop=0;loop<N-1;loop++){
		for(int loop2=0;loop2<pos.size();loop2++){
			if(loop+pos[loop2]<N){
				dp[loop+pos[loop2]]=(dp[loop+pos[loop2]]+dp[loop])%=998244353;
			}
		}
	}
	cout << dp[N-1] << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:73: error: lvalue required as left operand of assignment
   21 |                                 dp[loop+pos[loop2]]=(dp[loop+pos[loop2]]+dp[loop])%=998244353;
      |                                                     ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~