Saleh127

CF 1029B

Jul 15th, 2020
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define test int t; cin>>t; while (t--)
  4. #define ll long long int
  5. #define fellow_junior ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  6. int main()
  7. {
  8. fellow_junior
  9.  
  10. ll a[200000],c,d=0,e,f,i,j,k,l;
  11. cin>>c;
  12. for(i=0;i<c;i++)
  13. {
  14. cin>>a[i];
  15. }
  16. for(i=0;i<c;i++)
  17. {
  18. j=i;
  19. while(j+1<c && a[j+1]<=a[j]*2)
  20. {
  21. j++;
  22. }
  23. d=max(d,j-i+1);
  24. i=j;
  25. }
  26. cout<<d<<endl;
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment