码迷,mamicode.com
首页 > 其他好文 > 详细

codeforce B. Creating the Contest

时间:2019-10-21 00:13:22      阅读:105      评论:0      收藏:0      [点我收藏+]

标签:creat   targe   oid   new   system   str   print   tar   string   

 

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

标签:creat   targe   oid   new   system   str   print   tar   string   

原文地址:https://www.cnblogs.com/towerbird/p/11711046.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!