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 }
原文地址:https://www.cnblogs.com/towerbird/p/11711046.html
时间: 2024-11-09 16:20:26