delete pics to save space
This commit is contained in:
26
history_source/信息学奥赛一本通/1.5.1.15.cpp
Normal file
26
history_source/信息学奥赛一本通/1.5.1.15.cpp
Normal file
@ -0,0 +1,26 @@
|
||||
#include<iostream>
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
int n;
|
||||
cin>>n;
|
||||
int a[n];
|
||||
for(int i=0;i<n;i++) cin>>a[i];
|
||||
int maxn,max,num;
|
||||
num=a[0];
|
||||
maxn=max=1;
|
||||
for(int i=1;i<n;i++)
|
||||
{
|
||||
if(num==a[i]) max++;
|
||||
else
|
||||
{
|
||||
if(max>maxn) maxn=max;
|
||||
max=1;
|
||||
num=a[i];
|
||||
}
|
||||
}
|
||||
if(max>maxn) maxn=max;
|
||||
cout<<maxn<<endl;
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user