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;
}

 

全部评论

相关推荐

天天困啊:个人建议第一点就是熟悉Redis这里不要这么写,写上Redis比较核心的技术,什么缓存一致性,雪崩穿透击穿那些,掌握cos其实不用写在专业技能里这个你做了鱼皮的这个项目面试官默认应该认为你应该懂了,鱼皮这个项目核心挺多建议多啃啃,在做一个鱼皮的微服务项目俩项目在一起比较好哦
你的简历改到第几版了
点赞 评论 收藏
分享
06-18 20:07
中南大学 C++
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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