问题陈述:

  杭州电子科技大学 HANGZHOU DIANZI UNIVERSITY Online Judge Problem - 1008

问题分析:

  简单题。

代码详解:

 #include <iostream>
#include <cstdio> using namespace std; int main()
{
int i, n, m, time;
int floors[] = {};
while(cin>>n && n) {
time = ;
cin >> floors[];
time += floors[]* + ;
for(i=; i<n; i++) {
cin >> floors[i];
m = floors[i] - floors[i-];
if(m > ) {
time += m* + ;
}else{
time += (-m)* + ;
}
}
cout << time << endl;
}
return ;
}

转载请注明出处:http://www.cnblogs.com/michaelwong/p/4287130.html

Elevator的更多相关文章

  1. HDOJ 1008. Elevator 简单模拟水题

    Elevator Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Su ...

  2. poj[2392]space elevator

    Description The cows are going to space! They plan to achieve orbit by building a sort of space elev ...

  3. Design Elevator

    From: https://discuss.leetcode.com/topic/89/write-elevator-program-using-event-driven-programming/9 ...

  4. PAT (Advanced Level) Practise:1008. Elevator

    [题目链接] The highest building in our city has only one elevator. A request list is made up with N posi ...

  5. Pair Project: Elevator Scheduler [电梯调度算法的实现和测试]

    作业提交时间:10月9日上课前. Design and implement an Elevator Scheduler to aim for both correctness and performa ...

  6. POJ2392Space Elevator(贪心+背包)

    Space Elevator Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 9970   Accepted: 4738 De ...

  7. hdu 1008 Elevator

    Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Description The hig ...

  8. 【ACM】HDU1008 Elevator 新手题前后不同的代码版本

    [前言] 很久没有纯粹的写写小代码,偶然想起要回炉再来,就去HDU随便选了个最基础的题,也不记得曾经AC过:最后吃惊的发现,思路完全不一样了,代码风格啥的也有不小的变化.希望是成长了一点点吧.后面定期 ...

  9. Elevator 分类: HDU 2015-06-19 21:52 13人阅读 评论(0) 收藏

    Elevator Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Subm ...

  10. 1008. Elevator (20)

    The highest building in our city has only one elevator. A request list is made up with N positive nu ...

随机推荐

  1. HDU 5806 - NanoApe Loves Sequence Ⅱ (BestCoder Round #86)

    若 [i, j] 满足, 则 [i, j+1], [i, j+2]...[i,n]均满足 故设当前区间里个数为size, 对于每个 i ,找到刚满足 size == k 的 [i, j], ans + ...

  2. isNUll ,对于sql中的一个表的description的NULL和空格的处理

    select client.clientname ,description,'client2'= case when client.Description IS NULL then  client.c ...

  3. PC远程调试移动设备(转载)

    我们在移动端进行前端开发时,会遇到一个让人头痛但不得不面对的问题--调试. 在 PC 机器上,我们有功能强大的 Chrome DevTools.Firebug,即便是老版本的 IE ,我们也可以安装微 ...

  4. php-fpm日志告警"seem busy"

    php-fpm日志中出现"WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.m ...

  5. wampserver 自定义站点

    wampserver配置多站点,安装完wampserver后,我们要做的肯定是很多项目,那么如何配置wampserver多站点呢. 在“httpd.conf”文件中查找:Include conf/ex ...

  6. mysql解压版配置

    2. 解压MySQL压缩包 将以下载的MySQL压缩包解压到自定义目录下,我的解压目录是: "D:\Program Files\MySQL\mysql-5.6.13-win32" ...

  7. Linux命令行之逗趣无极限

    Linux命令行之逗趣无极限 . Linux"sl"命令行 尽管"sl"代表了"蒸汽机机头",但它是用来提醒那些命令行控们别把"l ...

  8. LINUX下DNS的查看和配置

    linux下好像没有专门的DNS查看命令. 用ifconfig命令也是看不到DNS的信息.(也可能是我不知道) 本机的DNS配置信息是在:/etc/resolv.conf [root@localhos ...

  9. android安卓开发问题集 XMPP篇

    1.消息推送查了下资料,后面还是使用了androidpn (1)java.security.KeyStoreException: KeyStore jks implementation not fou ...

  10. Android SDK目录结构和工具介绍

    Android SDK目录结构和工具介绍是本文要介绍的内容,主要是来了解并学习Android SDK的内容,具体关于Android SDK内容的详解来看本文. AD: Android SDK目录结构和 ...