AlenAntonelli

Maximum Increase 702/A

Oct 23rd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. /// https://trello.com/c/i4U2jyMu/28-problem-702a-codeforces
  2. /// http://codeforces.com/problemset/problem/702/A
  3.  
  4. #include <iostream>
  5. #include <vector>
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.     int n;
  11.     cin>>n;
  12.    
  13.     vector <long long> v (n);
  14.    
  15.     for (int i=0;  i<n; i++)
  16.         cin>>v[i];
  17.     v.push_back(0);
  18.    
  19.     long ulti = 0;
  20.     long cant = 0;
  21.     long may = 0;
  22.    
  23.     for (int i=0; i<=n; i++)
  24.     {
  25.         if (v[i] > ulti)
  26.             cant++;
  27.         else
  28.             cant=1;
  29.        
  30.         ulti = v[i];
  31.         may = max(may, cant);
  32.        
  33.     }
  34.    
  35.     cout<<may;
  36.    
  37.     return 0;
  38. }
Add Comment
Please, Sign In to add comment