【PAT甲级】1008 Elevator (20 分)
#include<bits/stdc++.h>
using namespace std;
int a[];
int main(){
int n;
cin>>n;
int ans=;
for(int i=;i<=n;++i){
cin>>a[i];
if(a[i]>a[i-])
ans+=(a[i]-a[i-])*+;
else
ans+=(a[i-]-a[i])*+;
}
cout<<ans;
return ;
}
【PAT甲级】1008 Elevator (20 分)的更多相关文章
- PAT 甲级 1008 Elevator (20)(代码)
1008 Elevator (20)(20 分) The highest building in our city has only one elevator. A request list is m ...
- PAT 甲级 1008 Elevator (20)(20 分)模拟水题
题目翻译: 1008.电梯 在我们的城市里,最高的建筑物里只有一部电梯.有一份由N个正数组成的请求列表.这些数表示电梯将会以规定的顺序在哪些楼层停下.电梯升高一层需要6秒,下降一层需要4秒.每次停下电 ...
- PAT Advanced 1008 Elevator (20 分)
The highest building in our city has only one elevator. A request list is made up with N positive nu ...
- PAT (Advanced Level) Practice 1008 Elevator (20 分) 凌宸1642
PAT (Advanced Level) Practice 1008 Elevator (20 分) 凌宸1642 题目描述: The highest building in our city has ...
- 1008 Elevator (20分)
1008 Elevator (20分) 题目: The highest building in our city has only one elevator. A request list is ma ...
- 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 ...
- 【PAT甲级】1008 Elevator (20分)
1008 Elevator 题目: The highest building in our city has only one elevator. A request list is made up ...
- PAT 甲级 1035 Password (20 分)(简单题)
1035 Password (20 分) To prepare for PAT, the judge sometimes has to generate random passwords for ...
- PAT 甲级 1077 Kuchiguse (20 分)(简单,找最大相同后缀)
1077 Kuchiguse (20 分) The Japanese language is notorious for its sentence ending particles. Person ...
- PAT 甲级 1061 Dating (20 分)(位置也要相同,题目看不懂)
1061 Dating (20 分) Sherlock Holmes received a note with some strange strings: Let's date! 3485djDk ...
随机推荐
- Dart语言学习(二) Dart的常量和变量
1.使用var声明变量,可赋予不同类型的值 Dart是一个强大的脚本类语言,可以不预先定义变量类型 ,自动会类型推导 Dart中定义变量可以通过var关键字可以通过类型来申明变量 var str='t ...
- Java开发中使用模拟接口moco响应中文时乱码
场景 在开发中需要依赖一些接口,比如需要请求一个返回Json数据的接口,但是返回Json数据的接口要么是没搭建,要么是交互比较复杂. 此时,就可以使用moco来模拟接口返回接口数据,以便开发和测试工作 ...
- maven打包一直报class not found错误
原因是因为gbase的jar包没导入到本地的maven库中 cmd,然后执行如下命令: mvn install:install-file -Dfile=D:/gbase-connector-java- ...
- hbase60010端口无法访问web页面
原因:HBASE1.0之后的版本web端访问的接口变更为16010
- 6、Maven仓库
在Maven的术语中,仓库是一个位置(place),例如目录,可以存储所有的工程.jar文件,library jar文件,插件或者任何其他的工程指定的文件 Maven仓库有三种类型 本地(local) ...
- TensorFlow 模型的保存与载入
参考学习博客: # https://www.cnblogs.com/felixwang2/p/9190692.html 一.模型保存 # https://www.cnblogs.com/felixwa ...
- 克隆虚拟机后ip配置
(1)出错原因: 错误:No suitable device found: no device found for connection "System eth0" 原因:克隆虚拟 ...
- 基于MHA的MYSQL高可用方案
一.MHA 简介 MHA (Master High Availability )目前在 MySQL 高可用方面是一个相对成熟的解决方案,它由日本 DeNA 公司的 youshimaton 员工(现就职 ...
- Flex:实例
目的: 代码: <!--pages/index/index.wxml--> <view class="container"> <view class= ...
- JS--easyui通用验证
// JavaScript Document $.extend($.fn.validatebox.defaults.rules, { Composite_validation: { validator ...