Creating the Contest

https://codeforces.com/contest/1029/problem/B

/*
*@Author:   STZG
*@Language: C++
*/
#include <bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<cstdlib>
#include<cstring>
#include<cstdio>
#include<string>
#include<vector>
#include<bitset>
#include<queue>
#include<deque>
#include<stack>
#include<cmath>
#include<list>
#include<map>
#include<set>
//#define DEBUG

using namespace std;
typedef long long ll;
const int N=2e5+100;
const double PI = acos(-1.0);
const double EXP = 1E-8;
const int INF = 0x3f3f3f3f;
int t,n,m;
int a[N];
int main()
{
#ifdef DEBUG
	freopen("input.in", "r", stdin);
	//freopen("output.out", "w", stdout);
#endif
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
        scanf("%d",&a[i]);
    int l=1,r=1;
    int ans=1;
    for(int i=2;i<=n;i++){
        if(a[i-1]<a[i]&&2*a[i-1]>=a[i]){
            r++;
        }else{
            ans=max(ans,r-l+1);
            l=i;
            r=i;
        }
    }
    ans=max(ans,r-l+1);
    cout << ans << endl;
    //cout << "Hello world!" << endl;
    return 0;
}

 

全部评论

相关推荐

07-30 13:50
门头沟学院 Java
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
昨天 18:38
点赞 评论 收藏
分享
想按时下班的大菠萝在...:隔壁学校的,加油多投, 实在不好找可以下个学期开学找,把算法八股准备好,项目有空再换换
投了多少份简历才上岸
点赞 评论 收藏
分享
嗨害嗨我来了:感谢我吧,上次我在食堂敲打了一个姓雷的,他说马上给大学生们准备hc
不卡学历的大厂有哪些?
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务