Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ar array
#define ll long long 
#define inf 0x3f3f3f3f
#define infll 0x3f3f3f3f3f3f3f3f
#define all(x) (x).begin(),(x).end()
#define f(i, a, b) for (int i=a; i<(signed)(b); ++i)
#define pc __builtin_popcount // counts number of 1's in bin(num)

const double pi = 2*acos(0.0);
//__gcd(n1, n2);
//cout << fixed;
//cout << setprecision(6); //fixes # of dp

onst int mxN=2e5, M=998244353;
int n;
ar<int, 2> a[mxN];
ll dp[mxN+1];

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

	cin >> n;
	for(i, 0, n){
		cin >> a[i][0] >> a[i][1];
    }
	sort(a, a+n);
	dp[n]=1;
	vector<ar<int, 2>> st{{n, (int)2e9}};
	for(int i=n-1; ~i; --i) {
		while(st.back()[1]<a[i][0]+a[i][1])
			st.pop_back();
		int p=st.back()[0];
		dp[i]=dp[p];
		st.push_back({i, a[i][0]});
		dp[i]=(dp[i]+dp[i+1])%M;
	}
	cout << dp[0];
}

// not my code but nice ans







Compiler output:
a.cc:16:1: error: 'onst' does not name a type; did you mean 'const'?
   16 | onst int mxN=2e5, M=998244353;
      | ^~~~
      | const
a.cc:18:14: error: 'mxN' was not declared in this scope
   18 | ar<int, 2> a[mxN];
      |              ^~~
a.cc:19:7: error: 'mxN' was not declared in this scope
   19 | ll dp[mxN+1];
      |       ^~~
a.cc: In function 'int main()':
a.cc:27:13: error: 'i' was not declared in this scope; did you mean 'pi'?
   27 |         for(i, 0, n){
      |             ^
      |             pi
a.cc:30:14: error: 'a' was not declared in this scope
   30 |         sort(a, a+n);
      |              ^
a.cc:31:9: error: 'dp' was not declared in this scope; did you mean 'dup'?
   31 |         dp[n]=1;
      |         ^~
      |         dup
a.cc:31:16: error: expected ')' before ';' token
   31 |         dp[n]=1;
      |                ^
      |                )
a.cc:27:12: note: to match this '('
   27 |         for(i, 0, n){
      |            ^
a.cc:34:36: error: 'a' was not declared in this scope
   34 |                 while(st.back()[1]<a[i][0]+a[i][1])
      |                                    ^
a.cc:37:17: error: 'dp' was not declared in this scope; did you mean 'p'?
   37 |                 dp[i]=dp[p];
      |                 ^~
      |                 p
a.cc:38:34: error: 'a' was not declared in this scope
   38 |                 st.push_back({i, a[i][0]});
      |                                  ^
a.cc:38:29: error: no matching function for call to 'std::vector<std::array<int, 2> >::push_back(<brace-enclosed initializer list>)'
   38 |                 st.push_back({i, a[i][0]});
      |                 ~~~~~~~~~~~~^~~~~~~~~~~~~~
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,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::array<int, 2>; _Alloc = std::allocator<std::array<int, 2> >; value_type = std::array<int, 2>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::vector<std::array<int, 2> >::value_type&' {aka 'const std::array<int, 2>&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::array<int, 2>; _Alloc = std::allocator<std::array<int, 2> >; value_type = std::array<int, 2>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<std::array<int, 2> >::value_type&&' {aka 'std::array<int, 2>&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
a.cc:39:39: error: 'M' was not declared in this scope
   39 |                 dp[i]=(dp[i]+dp[i+1])%M;
      |                                       ^
a.cc:41:17: error: 'dp' was not declared in this scope; did you mean 'dup'?
   41 |         cout << dp[0];
      |                 ^~
      |                 dup