fork download
  1. #include<iostream>
  2. #include<math.h>
  3. #include<algorithm>
  4. #include<stdio.h>
  5. #include<map>
  6. #include<vector>
  7. #include<set>
  8. #include<iomanip>
  9. #define F first
  10. #define S second
  11. #define P system("PAUSE");
  12. #define H return 0;
  13. #define pb push_back
  14. using namespace std;
  15. const long long A=100000000000000LL,N=228228;
  16.  
  17. long long a[N],k,o,i,j,n,m;
  18.  
  19. int main(){
  20. cin>>n;
  21. for(i=0;i<n;i++)scanf("%d",&a[i]);
  22. k=1;
  23. for(i=1;i<n;i++)if(a[i]>=a[i-1])k++;else o=max(o,k),k=1;
  24. o=max(o,k);
  25. cout<<o;
  26. }
Success #stdin #stdout 0.01s 5280KB
stdin
7 1
1 0 1 1 0 0 0
1 2
1 3
2 4
2 5
3 6
3 7
stdout
3