Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long 
#define MAXN 200010
#define mod 998244353
ll data[MAXN];

struct Tree
{
	ll sum;
	ll lazy;
};

Tree tree[MAXN * 4];

void build(int node, int low, int high)
{
	//cout << node << ' ' << low << ' ' << high << endl;
	if(low == high)
	{
		tree[node].sum = data[low];
		tree[node].lazy = 0;
		return;
	}

	int left = node * 2;
	int right = left + 1;
	int mid = (low + high) >> 1;

	build(left, low, mid);
	build(right, mid + 1, high);

	tree[node].sum = tree[left].sum + tree[right].sum;
	tree[node].lazy = 0;
}

void update(int node, int low, int high, int lr, int hr, ll val)
{
	if(tree[node].lazy)
	{
		tree[node].sum += (high - low + 1) * tree[node].lazy;

		if(low != high)
		{
			tree[node * 2].lazy += tree[node].lazy;
			tree[node * 2 + 1].lazy += tree[node].lazy;
		}

		tree[node].lazy = 0;
	}

	if(low > hr || high < lr)
		return;

	if(low >= lr && high <= hr)
	{
		tree[node].sum += (high - low + 1) * val;

		
		if(low != high)
		{
			tree[node * 2].lazy += val;
			tree[node * 2 + 1].lazy += val;
		}

		return;
	}

	int left = node * 2;
	int right = left + 1;
	int mid = (low + high) >> 1;

	update(left, low, mid, lr, hr, val);
	update(right, mid + 1, high, lr, hr, val);

	tree[node].sum = tree[left].sum + tree[right].sum;
}

ll query(int node, int low, int high, int lr, int hr)
{
	if(low > hr || high < lr)
		return 0;

	if(tree[node].lazy)
	{
		tree[node].sum += (high - low + 1) * tree[node].lazy;

		if(low != high)
		{
			tree[node * 2].lazy += tree[node].lazy;
			tree[node * 2 + 1].lazy += tree[node].lazy;
		}

		tree[node].lazy = 0;
	}

	if(low >= lr && high <= hr)
	{
		return tree[node].sum;
	}

	int left = node * 2;
	int right = left + 1;
	int mid = (low + high) >> 1;

	ll p = query(left, low, mid, lr, hr);
	p += query(right, mid + 1, high, lr, hr);

	return p;
}

ll l[11], r[11];

int main()
{
	ll i, j, n, m, k;

	scanf("%lld %lld", &n, &k);

	for(i=0; i<k; i++) scanf("%lld %lld", &l[i], &r[i]);

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


	data[n]=1;
	
	build(1, 1, n);

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

	for(i=n; i>1; i--)
	{
		ll val=query(1, 1, n, i, i);
		for(j=0; j<=k; j++)
		{
			if(i-l[j]<1) continue;
			ll lft=max(1LL, i-r[j]), rght=i-l[j];
			update(1, 1, n, lft, rght, val);
		}
	}

	ll res=query(1, 1, n, 1, 1);

	printf("%lld\n", res%mod);





	return 0;
}

Compiler output:
a.cc: In function 'void build(int, int, int)':
a.cc:21:34: error: reference to 'data' is ambiguous
   21 |                 tree[node].sum = data[low];
      |                                  ^~~~
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:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:6:4: note:                 'long long int data [200010]'
    6 | ll data[MAXN];
      |    ^~~~
a.cc: In function 'int main()':
a.cc:125:9: error: reference to 'data' is ambiguous
  125 |         data[n]=1;
      |         ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:6:4: note:                 'long long int data [200010]'
    6 | ll data[MAXN];
      |    ^~~~