PAT甲题题解-1008. Elevator (20)-大么个大水题,这也太小瞧我们做题者的智商了
如题。。。
#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)-大么个大水题,这也太小瞧我们做题者的智商了的更多相关文章
- PAT (Advanced Level) Practice 1008 Elevator (20 分) 凌宸1642
PAT (Advanced Level) Practice 1008 Elevator (20 分) 凌宸1642 题目描述: The highest building in our city has ...
- 【PAT Advanced Level】1008. Elevator (20)
没什么难的,简单模拟题 #include <iostream> using namespace std; int main() { int num; cin>>num; int ...
- 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 ...
- 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 (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue The highest ...
- PAT 甲级 1008 Elevator (20)(代码)
1008 Elevator (20)(20 分) The highest building in our city has only one elevator. A request list is m ...
- 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分)
1008 Elevator 题目: The highest building in our city has only one elevator. A request list is made up ...
- PAT 甲级 1008 Elevator (20)(20 分)模拟水题
题目翻译: 1008.电梯 在我们的城市里,最高的建筑物里只有一部电梯.有一份由N个正数组成的请求列表.这些数表示电梯将会以规定的顺序在哪些楼层停下.电梯升高一层需要6秒,下降一层需要4秒.每次停下电 ...
随机推荐
- /etc/sudoers文件的分析以及sudo的高级用法
高级用法总结: sudo命令是普通用户的提权操作指令.在权限控制中,我们可以使用/etc/sudoers文件中来进行设置.基本的用法比较熟悉.比如设置一个普通用户可拥有root用户的运行权限,那么设置 ...
- November 02nd, 2017 Week 44th Thursday
Knowledge is weightless, a treasure you can always carry easily. 知识没有重量,她是我们可以很容易携带的珍宝. Knowledge is ...
- System.IO.Path文件路径类
Path类的静态属性和方法,此类操作不影响物料文件. 属性 char a = System.IO.Path.VolumeSeparatorChar;//: char b = System.IO.Pat ...
- BZOJ 1028 麻将 枚举
题目链接: https://www.lydsy.com/JudgeOnline/problem.php?id=1028 题目大意: 麻将是中国传统的娱乐工具之一.麻将牌的牌可以分为字牌(共有东.南.西 ...
- Could not find class com.google.gson.Gson
在Android开发中使用gson解析json字符串,出现异常:java.lang.classnotfoundexception:com.google.gson.Gson.解决方案如下: 这个异常的怪 ...
- php 数据集转换树、递归重组节点信息多维数组(转)
一.将数据集转换成树 /** * 将返回的数据集转换成树 * @param array $list 数据集 * @param string $pk 主键 * @param string $pid 父节 ...
- MetaMask/provider-engine-2-代码
package.json "main": "index.js", "scripts": { "test": " ...
- Excel操作
区间范围计算 方法一:用IF函数 方法二:构建一个辅助区域,用VLOOKUP函数 方法一:用IF函数 在F3中输入:=IF(E3>=90%,5%,IF(E3>=80%,4%,IF(E3&g ...
- OpenCV——滤波
常见滤波函数: 其中前3中为线性滤波,后2中为非线性滤波 参考资料:https://mp.weixin.qq.com/s/3maNqlTSkl6FQs_xqrs8Fg
- Python2.7-heapq
heapq 模块,实现了堆序列算法,也叫优先序列算法.heap(堆)是每个父节点都小于等于子节点的树,同时所有节点k都满足 heap[k] <= heap[2*k+1] 和 heap[k] &l ...