public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); int len = s.length()/2; int[] nums = new int[len]; for (int i = 0; i < len; i++) { nums[i] = s.charAt(i*2+1)-'0'; } System.out.println(fun(nums)); } private static int fun(int[] nums){ int res = 0; int left = 0; int right = nums.length-1; while (left < right){ res = Math.max(res,(right-left)*Math.min(nums[left],nums[right])); if (nums[left] < nums[right]){ ++left; }else { --right; } } return res; }
点赞 4

相关推荐

11-16 01:13
宜春学院 Java
点赞 评论 收藏
分享
11-11 16:40
已编辑
门头沟学院 人工智能
不知道怎么取名字_:这个有点不合理了,相当于已经毕业了,但还是没转正,这不就是白嫖
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务