# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
77227 | farukkastamonuda | Untitled (POI11_tem) | C++14 | 340 ms | 33792 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 <bits/stdc++.h>
#define li 1000005
#define inf 1000000007
using namespace std;
int n,x[li],y[li],cev,ans;
int main(){
scanf("%d",&n);
if(n==1){
printf("1\n");
return 0;
}
int konum=-inf;
for(int i=1;i<=n;i++){
scanf("%d %d",&x[i],&y[i]);
if(y[i]>=konum){
cev++;
konum=max(konum,x[i]);
ans=max(ans,cev);
}
else{
ans=max(ans,cev);
konum=x[i];
cev=1;
ans=max(ans,cev);
}
}
konum=inf;
for(int i=n;i>=1;i--){
//scanf("%d %d",&x[i],&y[i]);
if(x[i]<=konum){
cev++;
konum=min(konum,x[i]);
ans=max(ans,cev);
}
else{
ans=max(ans,cev);
konum=x[i];
cev=1;
ans=max(ans,cev);
}
}
printf("%d\n",ans);
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... |
# | 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... |