- 浏览: 36645 次
- 性别:
- 来自: 杭州
最新评论
电梯上升一层6秒,下降一层4秒,每层停留5秒
Sample Input:
3 2 3 1
Sample Output:
41
#include <iostream> using namespace std; int main() { int N; cin>>N; int current = 0; int total = 0; while (N--) { int a; cin>>a; if (a >= current) { total += (a - current) * 6 + 5; current = a; } else { total += (current - a) * 4 + 5; current = a; } } cout<<total; return 0; }
发表评论
-
PAT1013 Battle Over Cities
2012-11-29 23:59 773Sample Input 3 2 3 1 2 1 3 ... -
PAT1003 Emergency
2012-11-29 23:46 662Sample Input 5 6 0 2 1 2 1 ... -
PAT1041 Be Unique
2012-11-23 23:43 760找出只出现过一次的数,用各种排序必然超时,需要用数组做hash ... -
PAT1042 Shuffling Machine
2012-11-23 23:42 733扑克洗牌 #include < ... -
PAT1040 Longest Symmetric String
2012-11-23 23:41 959求最长回文子串 #include < ... -
PAT1036 Boys vs Girls
2012-11-23 23:41 716Sample Input 1: 3 Joe M Mat ... -
PAT1035 Password
2012-11-23 23:40 616Sample Input 1: 3 Team0000 ... -
PAT1031 Hello World for U
2012-11-22 23:54 655Sample Input: helloworld! S ... -
PAT1029 Median
2012-11-22 23:54 651用标准库的排序全部超时,需要自己实现,另外还不能用cin co ... -
PAT1028 List Sorting
2012-11-22 23:53 808用vector最后一个用例超时了。。。 Sample ... -
PAT1027 Colors in Mars
2012-11-22 23:52 623Sample Input 15 43 71 Samp ... -
PAT1025 PAT Ranking
2012-11-22 23:51 771Sample Input: 2 5 123456789 ... -
PAT1023 Have Fun with Numbers
2012-11-21 23:55 687大数的相加 比较两个字符串中字符完全相同 Sa ... -
PAT1020 Tree Traversals
2012-11-21 23:54 652已知中序遍历 后序遍历,求层次遍历 Sample In ... -
PAT1019 General Palindromic Number
2012-11-21 23:53 537十进制转任意进制,并比较是否是回文数 Sample I ... -
PAT1037 Magic Coupon
2012-11-21 15:46 663Sample Input: 4 1 2 4 -1 ... -
PAT1038 Recover the Smallest Number
2012-11-20 23:52 1668由一道面试题改的 把数组排成最小的数 不同之处是这 ... -
PAT1024 Palindromic Number
2012-11-20 23:51 648Sample Input 1: 67 3 Sampl ... -
PAT1015 Reversible Primes
2012-11-19 23:51 771十进制转任意进制 假设十进制数为number,转 ... -
PAT1012 The Best Rank
2012-11-19 23:50 926四门功课,输出排名最高的是哪个 Sample Inpu ...
相关推荐
var elevator = new Elevator({ mainAudio: '/src/to/audio.mp3', endAudio: '/src/to/end-audio.mp3' }); } // You can run the elevator, by calling. elevator.elevate(); [removed] ...
电梯群控系统服务质量和运行效能评估软件设计与实现 建立了电梯客流到达模型,然后建立了6种电梯群调度模型
elevator.exe
使用java语言实现的elevator模拟程序
this is the java code for elevator which can be applied on elevator operation.
this is a elevator simulator,winform,csharp,and ds
algorithm that has been designed by ThyssenKrupp Elevator Company for the express purpose of evacuating mid to high rise buildings and demonstrates the reduced time of egress as opposed to traditional...
赵昊伟_C语言学习电梯程序Elevator
SYSTEM ELEVATOR DISPLAY
资源:一份源代码,一份英文报告。英文报告包括了模拟运行结果(20步随机),还有CTL以及CTL验证结果,最后一些简单说明。
用cocos2d-x引擎开发的C++电梯模拟调度程序,有可视化的界面。
Elevator buttons
基于java的控制台模拟电梯捎带系统。电梯捎带系统
python库,解压后可用。 资源全名:stix2_elevator-1.0.0-py2.py3-none-any.whl
本程序是模拟现实中的电梯程序。显示上会有区别 本程序采用的是自定义的Delay函数,并没有使用timer。 若有想修改的,自行修改即可。 本程序可以精简,但因为编者本人的某些原因才改成这样。
Elevator elevator = new Elevator (); elevator . on( ElevatorEvents . ARRIVE , data - > { int floor = ( Integer )data; System . out . println( " The elevator is now on floor " + floor); }); // In ...
STM32 mini开发板,实现触摸电梯升降小程序
Java电梯系统,电梯运行状态:从电梯启动时刻,到电梯运动停止时的运行状态,包括上行(UP)和下行(DOWN)状态。此状态电梯速度大于0。(启动时刻,运行停止时刻)。 b)电梯开关门状态:电梯静止时,从门打开时刻(门...
Elevator.dsp