-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathflymode.cpp
More file actions
40 lines (35 loc) · 718 Bytes
/
flymode.cpp
File metadata and controls
40 lines (35 loc) · 718 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include<bits/stdc++.h>
#define MAX 100000
#define DEBUG(x) do { std::cout << #x << ": " << x << std::endl; } while (0)
using namespace std;
int main(){
int t,n,i,m,j,len,count=0,temp,k,x,y;
//vector < pair<int,int> > c;
int c[MAX]={0};
cin>>n;
cin>>x;
for(i=1;i<n;++i)
{
cin>>y;
if(x<y)
{
for(j=x;j+0.5 < y;++j){
c[j-1]++;
}
x=y;
}
else{
for(j=y;j+0.5 < x;++j){
c[j-1]++;
}
x=y;
}
}
for(i=0;i<MAX;++i){
if(c[i]>count){
count=c[i];
}
}
cout<<count<<endl;
return 0;
}