#include <bits/stdc++.h>
using ll = long long;
using namespace std;
inline int readInt() {
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];
int main(){
int n = readInt();
for(int i = 0; i < n; i++) {
x[i] = readInt();
y[i] = readInt();
}
if(n<= 2000 and n>=2){
ll c = 0;
for(int i = 0 ; i < n ; i++){
ll found = false;
ll j = 0;
while ( j < n and found == false){
if(i == j ){
j = j;
}
else if(std::abs(x[j] - x[i]) <= y[j] - y[i]){
found = true;
}
j++;
}
if(found != true){
c++;
}
}
std::cout << c;
}
else{
std::cout << n;
}
return 0;
}
| # | 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... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |