PAT 甲级 1008 Elevator】的更多相关文章

1008 Elevator (20)(20 分) The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 seconds to move the elevator…
题目翻译: 1008.电梯 在我们的城市里,最高的建筑物里只有一部电梯.有一份由N个正数组成的请求列表.这些数表示电梯将会以规定的顺序在哪些楼层停下.电梯升高一层需要6秒,下降一层需要4秒.每次停下电梯将花费5秒. 给你一个请求列表,你需要计算出完成列表里的请求总共花费的时间.一开始电梯在0层.当请求全部完成时,电梯不需要回到底层. 输入说明: 每个输入文件包含一个测试实例.每个实例包含一个正整数N,后面跟着N个数字.所有输入的数字小于100. 输出说明: 对于每个测试实例,在一行中输出总时间.…
https://pintia.cn/problem-sets/994805342720868352/problems/994805511923286016 The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in spe…
PATA1008 Elevator The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 seconds to move the elevator up one…
1008. Elevator (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will st…
The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 seconds to move the elevator up one floor, and 4 seco…
The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 seconds to move the elevator up one floor, and 4 seco…
题目 The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 seconds to move the elevator up one floor, and 4 s…
题目分析:上去下来到达的时间和数量 #include<iostream> using namespace std; ]; int main(){ int n; while(scanf("%d", &n) != EOF){ ; ; ans += n*; ; i <= n; i++){ scanf("%d", &k[i]); if(k[i] > floor){ ans += (k[i] - floor) * ; floor = k…
1008 Elevator 题目: The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 seconds to move the elevator up one…