Enjoy It

Codeforces Round #506 (Div. 3) ---B. Creating the Contest
http://codeforces.com/contest/1029/problem/B#include <...
扫描右侧二维码阅读全文
25
2018/08

Codeforces Round #506 (Div. 3) ---B. Creating the Contest

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

#include <bits/stdc++.h>
using namespace std;
int a[200005];
int main(int argc, char const *argv[])
{
    /* code */
    int n;
    cin>>n;
    int sum,res = -1;
    for(int i=1;i<=n;i++){
        cin>>a[i];
        if(a[i]>a[i-1]*2)sum=1;
        else sum++;
        res = max(res,sum);
    }
    cout<<res<<endl;
    return 0;
}
最后修改:2018 年 08 月 25 日 09 : 21 AM
如果觉得我的文章对你有用,请随意赞赏

发表评论