이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#pragma GCC target("avx2,bmi2")
#include <bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#define getchar_unlocked() getchar()
#endif
inline int read() {
  int x = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    ch = getchar_unlocked();
  }
  while (ch >= '0' && ch <= '9') {
	x = (x << 3) + (x << 1) + ch - '0';
	ch = getchar_unlocked();
  }
  return x;
}
int x[10000000], y[10000000];
const int inf = 1e9;
using T = pair<int, int>;
int main() {
  int n = read();
  for (int i = 0; i < n; i++) {
	x[i] = read();
	y[i] = read();
  }
  vector<pair<int, int>> ds(n);
  for (int i = 0; i < n; i++) {
    ds[i] = make_pair(x[i] - y[i], x[i] + y[i]);
  }
  sort(ds.begin(), ds.end(), [](const T& a, const T& b) {
    if (a.first == b.first) {
      return (a.second > b.second);
    }
    return (a.first < b.first);
  });
  int mx = -inf, ans = 0;
  for (int i = 0; i < n; i++) {
    if (mx < ds[i].second) {
      ans++;
    }
    mx = max(mx, ds[i].second);
  }
  cout << ans << '\n';
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... |