# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
131264 | FedericoS | Lightning Rod (NOI18_lightningrod) | C++14 | 2058 ms | 152964 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <algorithm>
using namespace std;
int N;
int X[10000007];
int Y[10000007];
bool B[10000007];
int ans,a;
bool comp(int a, int b){
return Y[a]>Y[b];
}
int main(){
scanf("%d", &N);
for(int i=0;i<N;i++)
scanf("%d %d", &X[i], &Y[i]);
a=-2e9-5;
for(int i=0;i<N;i++){
if(a<X[i]+Y[i])
a=X[i]+Y[i];
else
B[i]=true;
}
a=-2e9-5;
for(int i=N-1;i>=0;i--){
if(a<-X[i]+Y[i])
a=-X[i]+Y[i];
else
B[i]=true;
}
for(int i=0;i<N;i++)
ans+=!B[i];
printf("%d\n", ans);
}
Compilation message (stderr)
# | 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... |