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;

#define fbo find_by_order
#define ook order_of_key
#define fi first
#define se second
#define long long long
typedef pair<int,int> ii;
typedef pair<int,ii> iii;
typedef vector<int> vi;
typedef vector<ii> vii;
// typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
// mt19937_64 rng(std::chrono::system_clock::now().time_since_epoch().count());

// /mnt/c/Users/vince/Desktop/POST-IOI/  


struct data
{
	long base;
	long val;
	data() { base = 0, val = 0; }
};

const long MOD = 998244353;
int n, q;
long pw10[200003];
int lazy[1000003];
data tree[1000003];

data merge(data a, data b)
{
	data res;
	res.base = (a.base+b.base)%MOD;
	res.val = (a.val+b.val)%MOD;
    return res;
}

void build(int pos, int kir, int kan)
{
	if(kir == kan)
	{
		// printf("%d %d %d\n", pos, kir, pw10[n-kir]);
		tree[pos].base = pw10[n-kir];
		tree[pos].val = pw10[n-kir];
		return;
	}
	int mid = (kir+kan)/2;
	build(pos*2, kir, mid);
	build(pos*2+1, mid+1, kan);
	tree[pos] = merge(tree[pos*2], tree[pos*2+1]);
}

void ceklazy(int pos, int kir, int kan)
{
	if(lazy[pos])
	{
		tree[pos].val = (1LL*lazy[pos]*tree[pos].base)%MOD;
		if(kir != kan)
		{
			lazy[pos*2] = lazy[pos];
			lazy[pos*2+1] = lazy[pos];
		}
		lazy[pos] = 0;
	}
}

void update(int pos, int kir, int kan, int qkir, int qkan, int val)
{
	ceklazy(pos, kir, kan);
	if(qkir <= kir && kan <= qkan)
	{
		lazy[pos] = val;
		ceklazy(pos, kir, kan);
		return;
	}
	if(qkan < kir || kan < qkir) return;

	int mid = (kir+kan)/2;
	update(pos*2, kir, mid, qkir, qkan, val);
	update(pos*2+1, mid+1, kan, qkir, qkan, val); 
	tree[pos] = merge(tree[pos*2], tree[pos*2+1]);
}

data query(int pos, int kir, int kan, int qkir, int qkan)
{
	ceklazy(pos, kir, kan);
	if(qkir <= kir && kan <= qkan) return tree[pos];
	if(qkan < kir || kan < qkir) return data();

	int mid = (kir+kan)/2;
	data a = query(pos*2, kir, mid, qkir, qkan);
	data b = query(pos*2+1, mid+1, kan, qkir, qkan);
	return merge(a, b);
}

int main()
{
	// ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	// freopen("input.in", "r", stdin);

	pw10[0] = 1;
	for(int i = 1; i <= 200000; i++)
		pw10[i] = (pw10[i-1]*10LL)%MOD;

	scanf("%d %d", &n, &q);


	build(1, 1, n);
	while(q--)
	{
		int l, r, d;
		scanf("%d %d %d", &l, &r, &d);
		update(1, 1, n, l, r, d);
		printf("%lld\n", tree[1].val);
	}
}






Compiler output:
a.cc:34:1: error: reference to 'data' is ambiguous
   34 | data tree[1000003];
      | ^~~~
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:23:8: note:                 'struct data'
   23 | struct data
      |        ^~~~
a.cc:36:1: error: reference to 'data' is ambiguous
   36 | data merge(data a, data b)
      | ^~~~
/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:23:8: note:                 'struct data'
   23 | struct data
      |        ^~~~
a.cc: In function 'void build(int, int, int)':
a.cc:49:17: error: 'tree' was not declared in this scope; did you mean 'free'?
   49 |                 tree[pos].base = pw10[n-kir];
      |                 ^~~~
      |                 free
a.cc:56:9: error: 'tree' was not declared in this scope; did you mean 'free'?
   56 |         tree[pos] = merge(tree[pos*2], tree[pos*2+1]);
      |         ^~~~
      |         free
a.cc: In function 'void ceklazy(int, int, int)':
a.cc:63:17: error: 'tree' was not declared in this scope; did you mean 'free'?
   63 |                 tree[pos].val = (1LL*lazy[pos]*tree[pos].base)%MOD;
      |                 ^~~~
      |                 free
a.cc: In function 'void update(int, int, int, int, int, int)':
a.cc:87:9: error: 'tree' was not declared in this scope; did you mean 'free'?
   87 |         tree[pos] = merge(tree[pos*2], tree[pos*2+1]);
      |         ^~~~
      |         free
a.cc: At global scope:
a.cc:90:1: error: reference to 'data' is ambiguous
   90 | data query(int pos, int kir, int kan, int qkir, int qkan)
      | ^~~~
/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:23:8: note:                 'struct data'
   23 | struct data
      |        ^~~~
a.cc: In function 'int main()':
a.cc:120:34: error: 'tree' was not declared in this scope; did you mean 'free'?
  120 |                 printf("%lld\n", tree[1].val);
      |                                  ^~~~
      |                                  free