Language: C++

#include <bits/stdc++.h>
//#define inf 0x3f3f3f3f3f3f3f3f
#define inf 0x3f3f3f3f
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define inv(x) Power(x, mod - 2)
#define fi first
#define se second
#define MP make_pair
#define PB push_back

using namespace std;
typedef pair<int,int> Pair;
typedef long double ld;
typedef long long ll;

const int mod = 1e9, MAX = 600000, N = 200005;
const long double Pi = 3.14159265358979323846l;
inline int add(int x, int y) { x += y; return x >= mod ? x - mod : x; };
inline void inc(int &x, int y) { x += y; x -= (x >= mod ? mod : 0); }
inline int mul(int x, int y) { return 1ll * x * y % mod; }
inline int Power(int x, int y) {
	int ans = 1;
	while (y) {
		if (y & 1) ans = mul(ans, x);
		x = mul(x, x), y >>= 1;
	} return ans;
}

template <class T> inline T	input() {
	T x; char ch; while (!isdigit(ch = getchar()));
	for (x = ch ^ 48; isdigit(ch = getchar()); x = x * 10 + (ch ^ 48));
	return x;
}

template <class T> inline bool chkmin(T &x, T y) { x = x < y ? x : y; return x == y; }
template <class T> inline bool chkmax(T &x, T y) { x = x > y ? x : y; return x == y; }
template <class T> inline T gcd(T x, T y) { return !y ? x : gcd(y, x % y); }
template <class T> inline T sqrm(T x) { return (ll) x * x % mod; }
template <class T> inline T sqr(T x) { return x * x; }

struct {
	inline operator int () { return input<int>(); }
	inline operator long long () { return input<long long>(); }
	template <class T> inline void operator () (T &x) { x = *this; }
	template<class T, class ...A> inline void operator () (T &x, A &...a)
	{ x = *this; this -> operator ()(a...); }
} read;

struct BIT {
	int Max[MAX + 5];
	void modify(int pos, int val) {
		for (int i = pos; i <= MAX; i += i & -i)
			chkmax(Max[i], val);
	}
	int query(int pos) {
		if (!pos) return 0;
		if (pos < 0) return -inf;
		int res = 0;
		for (int i = pos; i; i ^= i & -i)
			chkmax(res, Max[i]);
		return res;
	}
}bit;

int n;
struct Node {
	int l, r;
}a[N];
int num[N << 3], tot;

inline bool cmp(Node &a, Node &b) { return a.x < b.x; }

signed main() {
#ifdef local
	freopen("in", "r", stdin);
	freopen("out", "w", stdout);
	freopen("log", "w", stderr);
#endif
	ios::sync_with_stdio(false);

	cin >> n;
	for (int i = 1; i <= n; ++i) {
		int x, L;
		cin >> x >> L;
		a[i].l = x - L;
		a[i].r = x + L;
		num[++tot] = a[i].l;
		num[++tot] = a[i].r;
	}

	sort(num + 1, num + tot + 1);
	for (int i = 1; i <= n; ++i) {
		a[i].l = lower_bound(num + 1, num + tot + 1, a[i].l) - num;
		a[i].r = lower_bound(num + 1, num + tot + 1, a[i].r) - num;
	}
	sort(a + 1, a + n + 1, cmp);

	for (int i = 1; i <= n; ++i)
		bit.modify(a[i].r, bit.query(a[i].l - 1) + 1);
	printf("%d\n", bit.query(MAX));
	return 0;
}


Compiler output:
a.cc:47:3: error: '<unnamed struct> read' redeclared as different kind of entity
   47 | } read;
      |   ^~~~
In file included from /usr/include/x86_64-linux-gnu/bits/sigstksz.h:24,
                 from /usr/include/signal.h:328,
                 from /usr/include/c++/14/csignal:42,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:116,
                 from a.cc:1:
/usr/include/unistd.h:371:16: note: previous declaration 'ssize_t read(int, void*, size_t)'
  371 | extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur
      |                ^~~~
a.cc: In function 'bool cmp(Node&, Node&)':
a.cc:71:46: error: 'struct Node' has no member named 'x'
   71 | inline bool cmp(Node &a, Node &b) { return a.x < b.x; }
      |                                              ^
a.cc:71:52: error: 'struct Node' has no member named 'x'
   71 | inline bool cmp(Node &a, Node &b) { return a.x < b.x; }
      |                                                    ^