# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
138935 | thebes | Lightning Rod (NOI18_lightningrod) | C++14 | 2070 ms | 71272 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.
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,ssse3,sse3,sse4,popcnt,avx,mmx,abm,tune=native")
#include <bits/stdc++.h>
using namespace std;
int n, i, x, y, f, a, b, sz=-1;
pair<int,int> st[10000005];
int main(){
for(scanf("%d",&n),i=1;i<=n;i++){
scanf("%d%d",&x,&y); f=0;
while(sz!=-1){
a = st[sz].first, b = st[sz].second;
if(x-a<=b-y) break;
else if(y-b>=x-a) sz--;
else{f=1; break;}
}
if(sz==-1||f) st[++sz]={x,y};
}
printf("%d\n",sz+1);
return 0;
}
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... |