fork download
  1. #include<bits/stdc++.h>
  2. #define int long long
  3. #define endl "\n"
  4. using namespace std;
  5.  
  6. signed main()
  7. {
  8. int n,i,a[100001],kq=0,length=0; a[0]=0;
  9. cin>>n;
  10. for(i=1;i<=n;i++)
  11. {
  12. cin>>a[i];
  13. if (a[i]>=a[i-1])
  14. {
  15. length++; kq=max(kq,length);
  16. }
  17. else length=1;
  18. }
  19. cout<<kq;
  20. }
Success #stdin #stdout 0.01s 5300KB
stdin
3
4 2 3
stdout
2