Last active
October 15, 2015 20:58
-
-
Save pazthor/cb5d71a62708e54405dd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* | |
*Link to problem http://codeforces.com/contest/580/problem/A | |
* | |
*solution official : http://codeforces.com/blog/entry/20468 | |
*The next code, was my implementation for the problem. | |
*/ | |
#include<stdio.h> | |
int array[100003]; | |
int main(){ | |
int n,i,max,count; | |
scanf("%d",&n); | |
for( i =0; i< n; i++) | |
scanf("%d", &array[i]); | |
max = count =1; | |
for(i =1; i < n ; i++){ | |
if(array[i] >= array[i-1]) | |
count++; | |
else if(max < count){ | |
max = count; | |
count =1; | |
}else count =1; | |
} | |
if(max < count) max = count; | |
printf("%d",max); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment