如题。。。

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string.h>
using namespace std;
//太水了好吧。。。
int n;
int timeup=;
int timedown=;
int main()
{
scanf("%d",&n);
int last=;
int now;
int sum=;
for(int i=;i<n;i++){
scanf("%d",&now);
sum+=((now-last)>=)?(now-last)*timeup:(last-now)*timedown;
last=now;
}
printf("%d",sum+n*);
return ;
}

PAT甲题题解-1008. Elevator (20)-大么个大水题,这也太小瞧我们做题者的智商了的更多相关文章

  1. PAT (Advanced Level) Practice 1008 Elevator (20 分) 凌宸1642

    PAT (Advanced Level) Practice 1008 Elevator (20 分) 凌宸1642 题目描述: The highest building in our city has ...

  2. 【PAT Advanced Level】1008. Elevator (20)

    没什么难的,简单模拟题 #include <iostream> using namespace std; int main() { int num; cin>>num; int ...

  3. PAT (Advanced Level) Practice 1008 Elevator (20 分) (模拟)

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

  4. PAT甲 1008. Elevator (20) 2016-09-09 23:00 22人阅读 评论(0) 收藏

    1008. Elevator (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue The highest ...

  5. PAT 1008. Elevator (20)

    1008. Elevator (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue The highest ...

  6. PAT 甲级 1008 Elevator (20)(代码)

    1008 Elevator (20)(20 分) The highest building in our city has only one elevator. A request list is m ...

  7. 1008 Elevator (20分)

    1008 Elevator (20分) 题目: The highest building in our city has only one elevator. A request list is ma ...

  8. 【PAT甲级】1008 Elevator (20分)

    1008 Elevator 题目: The highest building in our city has only one elevator. A request list is made up ...

  9. PAT 甲级 1008 Elevator (20)(20 分)模拟水题

    题目翻译: 1008.电梯 在我们的城市里,最高的建筑物里只有一部电梯.有一份由N个正数组成的请求列表.这些数表示电梯将会以规定的顺序在哪些楼层停下.电梯升高一层需要6秒,下降一层需要4秒.每次停下电 ...

随机推荐

  1. November 11th, 2017 Week 45th Saturday

    Happiness is a direction, not a place. 快乐是一个方向,不是一个目的. Do you remember those moments in your life wh ...

  2. def chi(*food,**kw):

    def chi(*food,**kw): print(food,kw)chi("cong","蒜",'姜','可乐',"J=Juice",a ...

  3. 折射向量计算(Refraction Vector Calculation)

    上个月学习Peter Shirley-Ray Tracing in One Weekend的系列三本书,收获真的很多.这个系列的书真的是手把手教你如何从零开始构建一个光线跟踪渲染器,对新手(像我)非常 ...

  4. python基础之单例设计模式

    class Player(): instance = None init_flag = False def __init__(self): if self.init_flag is False: pr ...

  5. Sqlite的安装和简单使用

    Sqlite 1 安装 首先,下载相应的版本: https://sqlite.org/download.html 其次,解压到本地,并添加到环境变量. 然后,打开 CMD 创建,输入 sqlite3 ...

  6. 树莓派3B+ wifi 5G连接

    新烧的Raspbian 系统,一开始需要设置wifi的一些配置,其中会选择一个国家(set country),一开始选择的是CN(中国),发现只能连接2.4G的网络,5G的网络连接不上,这很奇怪, 因 ...

  7. python第三十二课——栈

    栈:满足特点 --> 先进后出,类似于我们生活中的子弹夹 [注意] 对于栈结构而言:python中没有为其封装特定的函数,我们可以使用list(列表)来模拟栈的特点 使用list对象来模拟栈结构 ...

  8. jQuery做字符串分隔

    var str=new String(); var arr=new Array(); str="ddd,dsd,3,dd,g,k"; //可以用字符或字符串分割 arr=str.s ...

  9. 1、pyspider安装

    系统环境: centos6.6.python2.7 经测试,python2.6安装的pyspider会导致webui无法正常访问 参考博文: http://cuiqingcai.com/2443.ht ...

  10. windows/Linux动态加载链接库问题

    windows: LoadLibraryA 指定的可执行模块映射到调用进程的地址空间并返回该 DLL 的句柄 HMODULE LoadLibraryA( LPCTSTR lpLibFileName// ...