B. Creating the Contest(水题)

直接水过

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

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

时间: 2024-11-09 16:20:22

B. Creating the Contest(水题)的相关文章

HDU 4006 The kth great number (基本算法-水题)

The kth great number Problem Description Xiao Ming and Xiao Bao are playing a simple Numbers game. In a round Xiao Ming can choose to write down a number, or ask Xiao Bao what the kth great number is. Because the number written by Xiao Ming is too mu

HDU 4007 Dave (基本算法-水题)

Dave Problem Description Recently, Dave is boring, so he often walks around. He finds that some places are too crowded, for example, the ground. He couldn't help to think of the disasters happening recently. Crowded place is not safe. He knows there

UESTCOJ-BiliBili, ACFun… And More!(水题)

BiliBili, ACFun… And More! Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Others) Some of you may have already noticed, there is a team in our final contest whose name is UESTC_BiliBilii, with user id as ACfun. Actually,

HDU1985 Conversions【水题】

Conversions Time Limit: 1000/500 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1674    Accepted Submission(s): 986 Problem Description Conversion between the metric and English measurement systems is relatively si

ZOJ 3609 Modular Inverse (水题)

Modular Inverse Time Limit: 2 Seconds      Memory Limit: 65536 KB The modular modular multiplicative inverse of an integer a modulo m is an integer x such that a-1≡x (mod m). This is equivalent to ax≡1 (mod m). Input There are multiple test cases. Th

ZOJ 3708 Density of Power Network (水题)

Density of Power Network Time Limit: 2 Seconds      Memory Limit: 65536 KB The vast power system is the most complicated man-made system and the greatest engineering innovation in the 20th century. The following diagram shows a typical 14 bus power s

hdu4950 Monster (水题)

4950 Monster Monster Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 52 Accepted Submission(s): 29 Problem Description Teacher Mai has a kingdom. A monster has invaded this kingdom, and Teacher Mai

HDU4891_The Great Pan_字符串水题

2014多校第五题,当时题面上的10^5写成105,我们大家都wa了几发,改正后我和一血就差几秒…不能忍 题目:http://acm.hdu.edu.cn/showproblem.php?pid=4891 The Great Pan Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 966    Accepted Submission(s

CodeForces 444C. DZY Loves Physics(枚举+水题)

转载请注明出处:http://blog.csdn.net/u012860063/article/details/37509207 题目链接:http://codeforces.com/contest/445/problem/C DZY Loves Physics DZY loves Physics, and he enjoys calculating density. Almost everything has density, even a graph. We define the densi

hdu 2393:Higher Math(计算几何,水题)

Higher Math Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2219    Accepted Submission(s): 1219 Problem Description You are building a house. You'd prefer if all the walls have a precise right