文件名称:lift
介绍说明--下载内容来自于网络,使用问题请自行百度
呵呵,有一天我做了一个梦,梦见了一种很奇怪的电梯。大楼的每一层楼都可以停电梯,而且第i层楼(1<=i<=N)上有一个数字Ki(0<=Ki<=N)。电梯只有四个按钮:开,关,上,下。上下的层数等于当前楼层上的那个数字。当然,如果不能满足要求,相应的按钮就会失灵。例如:3 3 1 2 5代表了Ki(K1=3,K2=3,……),从一楼开始。在一楼,按“上”可以到4楼,按“下”是不起作用的,因为没有-2楼。那么,从A楼到B楼至少要按几次按钮呢?-Oh, one day I had a dream, a very strange elevator. Each floor of the building the elevator can be stopped, and the i-floor (1 < = i < = N) has a number Ki (0 < = Ki < = N). Lift only four buttons: on, off, up and down. Equal to the current upper and lower layers that the figure on the floor. Of course, if you can not meet the requirements, the corresponding button will not work. For example: 33125 represents the Ki (K1 = 3, K2 = 3, ... ...), starting from the first floor. The first floor, press the " on" can go to the 4th floor, press the " down" does not work, because there is no-2 floor. So, from A to B floor building at least according to several button?
(系统自动生成,下载前可以参看下载内容)
下载文件列表
lift.doc
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.