如题。。。

#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. 【转】Tomcat连接器:Coyote框架

    不论Tomcat的容器设计得如何精妙,本质上Tomcat就是个http服务器,需要从socket中获得HTTP数据流:另一方面,容器只能处理封装好的org.apache.coyote.Request ...

  2. 魔法少女【动态规划问题】——NYOJ1204

    个人博客页:https://www.scriptboy.cn/202.html 题目描述: 前些时间虚渊玄的巨献小圆着实火了一把. 在黑长直(小炎)往上爬楼去对抗魔女之夜时,她遇到了一个问题想请你帮忙 ...

  3. oracle 更新用户密码,授连接权限,

    1.授连接权限 grant connect to 用户名; ALTER USER 用户名 ACCOUNT UNLOCK; 2.更新密码 ALTER USER 用户名 IDENTIFIED BY 更新密 ...

  4. Python3与Python2的差异

    基于python3浅谈python3与python2的差异.由于现今主流Python3,但是之前用Python2做的项目,还得维护,所以作为python工作者,不免要了解其中差异,其中,Python2 ...

  5. linux 文件夹和文件操作

    1.统计目录有多少个文件数 find ./company -type f | wc -l 2.删除文件夹中的文件 rm -f * #最经典的方法,删除当前目录下的所有类型的文件 rsync --del ...

  6. python3 面向对象编程--类的封装和继承

    #python3import refrom urllib import requestimport os class PosterSpider(object):     def __init__(se ...

  7. php判断一个数组是否为另一个数组子集的方法

    原文地址http://www.jbxue.com/article/14703.html // 快速的判断$a数组是否是$b数组的子集  $a = array(135,138);  $b = array ...

  8. 第9章 初识STM32固件库

    第9章     初识STM32固件库 全套200集视频教程和1000页PDF教程请到秉火论坛下载:www.firebbs.cn 野火视频教程优酷观看网址:http://i.youku.com/fire ...

  9. 笔记:载入viewcontroller的几种方式

    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil]; ...

  10. 大数据入门第十四天——Hbase详解(二)基本概念与命令、javaAPI

    一.hbase数据模型 完整的官方文档的翻译,参考:https://www.cnblogs.com/simple-focus/p/6198329.html 1.rowkey 与nosql数据库们一样, ...