Advertisement
rengetsu

Codeforces_580A

Jul 31st, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. //Codeforces Round 580A
  2. #include <iostream>
  3. using namespace std;
  4. int main()
  5. {
  6.     int n, answ=1, max=1, nn[100001];
  7.     cin >> n;
  8.     for(int i=0;i<n;i++)
  9.     {
  10.         cin >> nn[i];
  11.     }
  12.     for(int i=0;i<n;i++)
  13.     {
  14.         if(i!=0)
  15.         {
  16.             if(nn[i]>=nn[i-1])
  17.             {
  18.                 answ++;
  19.             }
  20.             else
  21.             {
  22.                 answ=1;
  23.             }
  24.             if(answ>max){max=answ;}
  25.         }
  26.     }
  27.     cout << max;
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement