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

水题真快乐= =

 1 public class Main {
2 public static void main(String[] args) {
3 Scanner io = new Scanner(System.in);
4 long n = io.nextInt() - 1, a = io.nextInt(), b, len = 1, ans = 1;
5 for (int i = 1; i <= n; i++) {
6 b = io.nextInt();
7 if (i == n) {
8 if (a * 2 >= b) len++;
9 ans = Math.max(ans, len);
10 break;
11 } else if (a * 2 < b) {
12 ans = Math.max(ans, len);
13 len = 0;
14 }
15 len++;
16 a = b;
17 }
18 System.out.println(ans);
19 }
20 }

codeforce B. Creating the Contest的更多相关文章

  1. codeforce1029B B. Creating the Contest(简单dp,简单版单调栈)

    B. Creating the Contest time limit per test 1 second memory limit per test 256 megabytes input stand ...

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

    B. Creating the Contest time limit per test 1 second memory limit per test 256 megabytes input stand ...

  3. CodeForces B. Creating the Contest

    http://codeforces.com/contest/1029/problem/B You are given a problemset consisting of nn problems. T ...

  4. B. Creating the Contest(水题)

    直接水过 #include<iostream> #include<algorithm> using namespace std; ; int a[maxn]; int n, u ...

  5. 【贪心/DP/单调队列】【CF1029B】Creating the Contest

    Description 给你一个单调不下降的长度为n的序列,请你找出一个最长的子序列,满足找出的子序列中,\(A_i<=A_{i-1}~\times~2\),其中i为下标,A为找出的子序列.对于 ...

  6. 【CF1029B】Creating the Contest(贪心)

    题意: n<=2e5 思路:可以证明答案一定是极长的一段中取最大值 #include<cstdio> #include<cstring> #include<stri ...

  7. Codeforces 1029B. Creating the Contest 动态规划O(nlogn)解法 及 单调队列O(n)解法

    题目链接:http://codeforces.com/problemset/problem/1029/B 题目大意:从数组a中选出一些数组成数组b,要求 b[i+1]<=b[i]*2 . 一开始 ...

  8. Codeforces Round #442 A Alex and broken contest【字符串/常量数组/string类】

    A. Alex and broken contest time limit per test 2 seconds memory limit per test 256 megabytes input s ...

  9. Codeforces Round #442 (Div. 2)

    A. Alex and broken contest time limit per test 2 seconds memory limit per test 256 megabytes input s ...

  10. Gym 100712

    我的作用:增加罚时. noip380分大佬全程带飞出了10T,可惜被我搞的罚时太高了... 那啥,你会发现java代码有两种风格,嗯两个人,c++自然就是自招大佬了... A:大水题略 B:(不是我写 ...

随机推荐

  1. Vue3 企业级优雅实战 - 组件库框架 - 9 实现组件库 cli - 上

    上文搭建了组件库 cli 的基础架子,实现了创建组件时的用户交互,但遗留了 cli/src/command/create-component.ts 中的 createNewComponent 函数,该 ...

  2. Spark详解(01) - Scala编程语言

    Spark详解(01) - Scala编程语言概述 Scala官网:https://www.scala-lang.org/ 什么是Scala 从英文的角度来讲,Scala并不是一个单词,而是Scala ...

  3. HBase详解(01) - Hbase简介

    HBase简介 定义:HBase是一种分布式.可扩展.支持海量数据存储的NoSQL数据库. 数据模型:逻辑上,HBase的数据模型同关系型数据库很类似,数据存储在一张表中,有行有列.但从HBase的底 ...

  4. R语言|ggplot2| 绘制KEGG气泡图

    在 RStudio 中使用 BiocManager 安装包 install.packages("BiocManager") install.packages("ggplo ...

  5. Svelte框架实现表格协同文档

    首先,从框架搭建上,本篇示例采用当下流行的前后端分离的开发方式,前端使用npm作为脚手架搭建Svelte框架. 后端使用Java的SpringBoot作为后端框架. 首先,介绍下在前端Svelte框架 ...

  6. 阅读B2B使用手册随感

    EDI 协议中最重要的协议之一AS2协议,几乎成为对安全性要求比较高的企业.监管机构的首选.在零售.物流.医药等行业,EDI都有广泛应用.据我所知,在医药行业,几乎全球重要的监管机构都在使用EDI, ...

  7. Debug时使用热部署修改代码

    今晚Debug的时候,一些语句怎么也不能debug,F8步过以下跳好多行,看起来很烦人.原来是有些行无法进入debug断点. 是因为Debug之前Tomcat已经编译Class文件,当插入注释/修改代 ...

  8. imax6开发版_交叉编译

    下载 arm-linux-gnueabihf-gcc编译器 sudo apt install gcc-arm-linux-gnueabihf #安装完成后使用如下命令查看版本 arm-linux-gn ...

  9. jquery(四:jquery的事件、Ajax)

    Jquery事件 jQuery注册事件 1.利用原生的js来为对象注册事件,后面的会把前面的覆盖 2.用jQuery的$()来为对象注册事件,后面不会把前面的覆盖 简单事件绑定-----click() ...

  10. 郁金香 fs寄存器

    为什么我们在追eax要挂主线程呢,这是因为它的数据来源在fs中 004D1000 为什么是这个呢 $ ==> 0392FFDC 指向SEH链表指针 $+4 03930000 线程堆栈顶部(地址最 ...