Problem hidden
|This problem was hidden by Editorial Board member probably because it has incorrect language|version or invalid test data, or description of the problem is not clear.|

RGB7616 - Дараалан ижил

Өгөгдсөн натурал тоон дарааллаас дараалан ижил тоонууд орсон хамгийн урт дэд дарааллын уртыг ол.  

Input

Эхний мөрөнд натурал тоо n өгөгдөнө. n<=100.

Дараагийн мөрөнд n ширхэг натурал тоо зайгаар тусгаарлагдан өгөгдөнө. Тоонууд 1000-гаас бага.

Output

Дараалан ижил тоо байх дэд дарааллуудын хамгийн урт.

Example

Input:
10
1 3 3 2 2 2 3 3 4 2
Output: 3

Нэмсэн:Bataa
Огноо:2013-02-13
Хугацааны хязгаарлалт:1s
Эх кодын хэмжээний хязгаарлалт:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Програмчлалын хэлүүд:ADA95 ASM32 BASH BF C NCSHARP CSHARP C++ 4.3.2 CPP C99 CLPS LISP sbcl LISP clisp D ERL FORTRAN HASK ICON ICK JAVA JS-RHINO JULIA LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PHP PIKE PRLG-swi PYTHON PYPY3 PYTHON3 RUBY SCALA SCM guile ST TCL WHITESPACE

hide comments
2020-11-20 14:14:58
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b[100],d=1,i,j,max=1,c[100];
cin>>a;
for(i=0;i<=a-1;i++){
cin>>b[i];
}
for( i=0;i<=a-1;i++){
for( j=i;j<=a-1;j++){
if(b[j+1]==b[j]){
d++;
}else{
c[i]=d;
d=1;
break;
}


}

}
for(i=0;i<=a-1;i++){
if(c[i]>max)max=c[i];
}
cout<<max;
}

Last edit: 2020-11-20 14:15:43
2020-08-14 12:19:36
#include <bits/stdc++.h>
using namespace std;

main(){
int n,a,max=0,u=1;
cin>>n;
for(int i=1; i<=n; i++){
n<=100;
cin>>a;
}
for(int i=1; i<=n; i++){
a<1000;
max=(a+max)+u;
}
cout<<max/10;
}
2020-08-14 12:08:20
bna
2020-08-14 12:00:11
hariu bnu?

Last edit: 2020-08-14 12:00:25
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.