hihocoder 1425What a Beautiful Lake(实验专用)
Problem D. What a Beautiful Lake
Description
Weiming Lake, also named "Un-named Lake", is the most famous scenic spot in Peking University. It is located in the north of the campus and is surrounded by walking paths, small gardens, and old red buildings with typical Chinese curly roofs. The lake was
once the royal garden in Qing Dynasty. Boya tower stands on a little hill beside the lake. The lake and the tower form a distinctive landscape and a symbol of Peking University.
Weiming Lake is a very good place for studying, reading, skating in the winter, and of course, jogging. More and more students and teachers run or walk around Weiming Lake every day and show how many paces they have covered in the mobile app WeChat Sports
to get "Zans" (applauses).
ACMer X also enjoys jogging around Weiming Lake. His watch can measure and record an altitude value every meter. After a round of running, X collected the altitude data around the lake. Now he wants to find out the longest slope around the lake.
Input
There are no more than 20 test cases.
Each case has two lines.
The first line is an integer N (2 <= N <= 100) meaning that the length of the road around the lake is N meters.
The second line contains N integers a1,a2...aN, (0<= a1,a2...aN <= 100) indicating N altitude sample values around the lake. The samples are given in clockwise order, and the distance between
two adjacent samples is one meter. Of course the distance between a1 and aN is also one meter.
The input ends by a line of 0.
Output
For each test case, print the length of the longest slope in meters. A slope is a part of the road around the lake, and it must keep going up or going down. If there are no slope, print 0.
Sample Input
4
1 1 1 1
8
5 1 2 3 4 5 6 2
6
5 4 3 2 1 2
10
1 0 2 3 2 2 3 4 3 2
0
Sample Output
0
5
4
4
hihocoder 1425What a Beautiful Lake(实验专用)的更多相关文章
- hihoCoder 1425 : What a Beautiful Lake(美丽滴湖)
hihoCoder #1425 : What a Beautiful Lake(美丽滴湖) 时间限制:1000ms 单点时限:1000ms 内存限制:256MB Description - 题目描述 ...
- Problem D. What a Beautiful Lake dp
Problem D. What a Beautiful Lake Description Weiming Lake, also named "Un-named Lake", is ...
- English trip V1 - B 14. There Are Flowers in My Office 我办公室里有花 Teacher:Lamb Key: There be(is/are)
In this lesson you will learn to describe a room or place. 这节课讲学习描述一个房间或地方 课上内容(Lesson) 1. Where do ...
- The 2016 ACMICPC Asia Beijing Regional Contest
A. Harmonic Matrix Counter (3/19) B. Binary Tree (1/14) C. Asa's Chess Problem (21/65) [ Problem ] 给 ...
- hihocoder 1061.Beautiful String
题目链接:http://hihocoder.com/problemset/problem/1061 题目意思:给出一个不超过10MB长度的字符串,判断是否里面含有一个beautiful strings ...
- hihoCoder 1596 : Beautiful Sequence
Description Consider a positive integer sequence a[1], ..., a[n] (n ≥ 3). If for every 2 ≤ i ≤ n-1, ...
- 实验吧 ---- 隐写术之so beautiful so white
因为好久没有写博客,所以今天本宝宝要弥补这个过错,一下子更新许多文章,希望各位小伙伴能够原谅,以后我会加倍努力的! 这一次主要都是实验吧里面的 关于隐写术方面的知识,后续我会上传一些解密工具,希望能够 ...
- 实验吧-隐写-FIVE1、so beautiful so white(文件头修改)
FIVE1 下载图片,kali下foremost恢复文件,将得到的图片用Winhex打开进行观察,发现最后面有一段貌似是代码的东西. LS0uLi4gIC4tICAuLi4uLiAgLS0uLi4gI ...
- MS SQL专用管理员连接DAC
在SQL SERVER 2005中,微软引入了一个叫做数据库专用管理员连接方式(DAC Dedicated Administrator Connection)的特性,使用这个新特性,数据库管理员可以在 ...
随机推荐
- 搜狐前端css常用命名
- 学习ASP.NET MVC5的一个轻量级的NinJect框架学习的第二天
新建一个Abstract文件夹 放置一些抽象的类,如接口 我们通过该接口就可以得到对应类的相关信息, 不需要去管该数据如何存储,以及存储的位置,这就是存储库模式的本质 public i ...
- Chrome插件制作
由于网上很难找到关于Chrome插件制作的中文教程,为了总结和方便更多的开发者,本文以最常见的显示效果为browser_action的二维码插件为例,进行相关阐述.前端童鞋开发的话应该很简单的,鄙人是 ...
- SpringMvc之参数绑定注解详解
引言: 前段时间项目中用到了REST风格来开发程序,但是当用POST.PUT模式提交数据时,发现服务器端接受不到提交的数据(服务器端参数绑定没有加任何注解),查看了提交方式为application/j ...
- java语言基础-类型运算细节
代码一: public class varDemo{ public static void main(String[] args) { byte a2; a2=3+4; System.out.prin ...
- autoOpenBrowser: true, 运行npm后自动打开浏览器
autoOpenBrowser: true, 运行npm后自动打开浏览器
- easyui实现增删改查
陈旧的开发模式 美工(ui工程师:出一个项目模型) java工程师:将原有的html转成jsp,动态展示数据 缺点: 客户需要调节前端的展示效果 解决:由美工去重新排版,重新选色. 前后端分离: 前端 ...
- C-基础:关于预编译以及宏
这是没有引入任何头文件时,如果使用"NULL",编译器会报错:没有定义NULL.此时可用下面代码定义. #undef NULL //#undef 是在后面取消以前定义的宏定义#if ...
- Archive for required library: 'D:/Program Files/Apache/maven-repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar'
今天导入一个项目工程,发现报错:Archive for required library: 'D:/Program Files/Apache/maven-repository/dom4j/dom4j/ ...
- spring注解开发-扩展原理(源码)
1.BeanFactoryPostProcessor BeanPostProcessor:bean后置处理器,bean创建对象初始化前后进行拦截工作的; BeanFactoryPostProcesso ...