首页 > 其他 > 详细

B. Creating the Contest(水题)

时间:2019-04-12 19:01:39      阅读:145      评论:0      收藏:0      [点我收藏+]

直接水过

#include<iostream>
#include<algorithm>
using namespace std;
const int maxn=2e5+10;
int a[maxn];
int n, u,maxx;

int main(){
    cin>>n; u=1;
    for(int i=0;i<n;++i)cin>>a[i];
    for(int i=0;i<n-1;++i){
        if(a[i]*2>=a[i+1]){ ++u; }
        else{     maxx=max(maxx, u);   u=1;      }
    }
    maxx=max(maxx, u);
    cout<<maxx<<endl;
}

 

B. Creating the Contest(水题)

原文:https://www.cnblogs.com/ALINGMAOMAO/p/10697862.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!