#include<iostream>
#include<algorithm>
using namespace std;
int n;
int a[105];
void run()
{
int i;
for(i=0;i<n;i++) scanf("%d",&a[i]);
int ans=0;
int cur=0;
for(i=0;i<n;i++)
{
if(a[i]>cur)
{
ans=ans+(a[i]-cur)*6;
ans+=5;
cur=a[i];
}
else if(a[i]<cur)
{
ans=ans+(cur-a[i])*4;
ans+=5;
cur=a[i];
}
else ans+=5;
}
printf("%d\n",ans);
}
int main()
{
while(scanf("%d",&n)!=EOF) run();
return 0;
}注意同一层下加上时间5S
相关推荐
超聚变安装银河麒麟服务器系统ky10-server-x86
超聚变-通过BMC口进服务器管理界面如下图为BMC管理口:默认BMC口IP:https://192.168.2.100l浏览器打开网页,输入用户名和密码登陆后,如下图红框处,选择“启动虚拟控制台”——选择“HTML集成远程控制台”系统银河麒麟服务器系统ky10 server x86选择镜像文件X86架构我们一般选择下图2212版本选择启动方式:光驱重启出现安装图形化界面选装安装系统的磁盘系统安装盘选完后如下图,会置灰创建root密码开始安装系统首次进入,有协议界面。
ZJU PAT 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 s...
Docker容器n8n中 read/write files from disk 无法读取容器内文件解决方案
《n8n文件读写Docker部署常见问题解决方案》摘要:针对n8n 1.90.2版本在Docker环境下文件读写失败问题,本文分析常见错误包括路径错误(ENOENT)、权限不足(EACCES)及节点误用问题。核心解决方案为:1)通过-v参数挂载宿主机目录到容器(如/files);2)使用新版Read/WriteFilesfromDisk节点操作文件;3)确保权限设置正确。提供可直接导入的示例工作流JSON,演示从CSV读取到结构化数据处理的全流程。特别强调已部署用户需重新挂载卷的正确操作方式,并附解决方案对
PAT(Advanced level) 1008. Elevator
原题链接:http://pat.zju.edu.cn/contests/pat-a-practise/1008 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
图解B树的原理及操作
本文主要参考:https://blog.csdn.net/shenchaohao12321/article/details/83243314 1. B树 1.1 B树的定义 B树也称B-树,它是一颗多路平衡查找树。我们描述一颗B树时需要指定它的阶数,阶数表示了一个结点最多有多少个孩子结点,一般用字母m表示阶数。当m取2时,就是我们常见的二叉搜索树。 一颗m阶的B树定义如下: 1)每个结点最多有m-1个关键字。 2)根结点最少可以只有1个关键字。 3)非根结点至少有Math.ceil(m/2)-
C8T6和ZET6选型更换过程中出现.\Obj\Project.sct(7): error: L6235E: More than one section matches selector - cann
提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 文章目录前言一、问题原因二、解决方法三、现象总结 前言 又一件离谱的事情发生了,我之前转换过程中没有发生的错误,今天拿出来程序重新编译了一下,结果他奶奶滴一个新的错误出现了,而且我还完全不知道是什么原因导致的,先上图: 一、问题原因 之前我已经尝试过更换芯片选型,但是没有出现此类问题,今天更改的时候发现了,我还以为是个偶然错误,结果换来换去,还是有这个问题,那我之前说c8t6的程序更改成zet6上跑只需改芯片选型和宏定义岂不是啪啪打.
【PAT】1008. Elevator (20)
题目:http://pat.zju.edu.cn/contests/pat-a-practise/1008 简单题。电梯上升要6s,下降要4s,每个stop停靠5s,相加就好。 时间限制 400 ms 内存限制 32000 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN,
锂电池SOH预测 | 基于BP神经网络的锂电池SOH预测(附matlab完整源码)
锂电池SOH预测 | 基于BP神经网络的锂电池SOH预测(附matlab完整源码)
PAT1008. Elevator (20)
题目地址:http://pat.zju.edu.cn/contests/pat-a-practise/1008 水题,不多说,代码如下: #include #include #include #include #include #include using namespace std; int main() { //freopen("D://test.txt","r",stdin); i
Dify知识库文档批量下载神器:一键导出所有文件到本地
在使用Dify进行知识库管理的过程中,我们经常遇到一个实际问题:如何将已上传到知识库中的文档批量下载到本地?目前Dify的管理界面虽然功能强大,但暂时没有提供直接的UI界面来批量导出或下载知识库内的文档。这意味着如果我们需要将知识库中的文件备份到本地或进行离线处理,只能通过API接口来实现。本文将详细介绍如何利用Dify的REST API构建一个完整的知识库文档下载解决方案,这也是目前实现知识库文件批量下载到本地的唯一可行路径。🎉进入大模型应用与实战专栏 | 🚀查看更多专栏内容首先,我们需要在Dify的
在 SAP ABAP 生态中偏爱面向对象,而不是过程式堆叠
本文探讨了ABAP开发中过程式与面向对象编程的共存现状及优化方向。文章指出,虽然过程式编程在ABAP中仍广泛存在,但随着业务复杂度提升,面向对象编程在可维护性、可测试性和重构便利性方面展现出明显优势。作者建议将过程式代码作为"适配层",仅负责输入输出转换,而将核心业务逻辑封装在类中。文章通过实际案例展示了这种架构如何提高交付效率,并提供了将Function Module转化为"薄包装"的具体实现方案,强调面向对象设计在SAP Gateway和RAP等现代架构中的重要性
pat 1008. Elevator (20)
链接:http://pat.zju.edu.cn/contests/pat-a-practise/1008 题意:给出楼层序列计算电梯运行时间。 分析:简单模拟题。 #include<stdio.h> int main() { int n; int count = 0; int cur = 0; int tmp; scanf("%d...
Attention优化|2w字原理&图解: 从Online-Softmax到FlashAttention V1/V2/V3
本文通过原理分析和图解的方式,通俗易懂地FlashAttention系列算法。FlashAttention V1/V2在LLM领域的应用已经非常广泛,相关的论文也反复读了几遍。FA1和FA2论文非常经典,都推荐读一下(不过FA2论文中公式错误不少本文大约1.8w字,包括以下内容:0x07 分布式训推使用FlashAttention0x09 FlashAttention中MQA/GQA以及Causal Mask处理。
ZJU-PAT 1010. Radix (25)
Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is "yes", if 6 is a decimal number and 110 is a binary number. Now for any pair of positive
TMS_WebGMaps_1.9.8.0_Full_Source
TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder
廖雪峰Python教程[完整版]
廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白
ZJU-PAT 1065. A+B and C (64bit) (20)
Given three integers A, B and C in [-263, 263], you are supposed to tell whether A+B > C. Input Specification: The first line of the input gives the positive number of test cases, T ( Output
温度PID控制PLC程序
温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值
ZJU-PAT 1080. Graduate Admission (30) 浙大2014年上机复试第四题
#include #include #include #include using namespace std; const int maxn=40005; const int maxm=101; int n,m,k; int num[maxm]; int lastRank[maxm]; vector mm[maxm]; struct stu { int id; int G
RU DOS版、EFI版32bit/64bit BIOS常用工具
DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。
ZJU-PAT 1079. Total Sales of Supply Chain (25) 浙大2014年上机复试第三题
#include #include using namespace std; struct Node { int parent; //父节点 bool flag; //是否是retailers int level; //第几层 int num; //销售多少个 }; Node tt[100005]; int n; double p,r,sum;
ZJU-PAT 1057. Stack (30) 浙大2013年上机复试第三题
#pragma warning (disable:4786) #include #include #include #include #include using namespace std; int n,d;; int A[10005],B[10005]; int select(int num) { for(int i=1;i<=d;i++) B[i]=A[i];
ZJU-PAT 1070. Mooncake (25)
Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of fillings and crusts can be found in traditional mooncakes according to the region's culture. Now
ZJU-PAT 1081. Rational Sum (20)
模拟题 #pragma warning (disable:4786) #include #include #include #include #include #include #include using namespace std; long long int sum,ans,sum1; int n; struct Node { long long int numerato
ZJU-PAT 1054. The Dominant Color (20) 浙大2013年上机复试第一题
#pragma warning (disable:4786) #include #include #include #include using namespace std; int main() { int m,n; while(scanf("%d%d",&m,&n)!=EOF) { int i,j; string s; map ans;
ZJU-PAT 1077. Kuchiguse (20) 浙大2014年上机复试第一题
#include #include #include #include using namespace std; string longest_common_suffix(string a,string b) { string tmp=""; int len1=a.size()-1; int len2=b.size()-1; while(len1>=0 && len2>=0) {
ZJU-PAT 1055. The World's Richest (25) 浙大2013年上机复试第二题
#pragma warning (disable:4786) #include #include #include #include #include using namespace std; int m,n; int num,Min,Max; struct people { string name; int age,money; }; people TT[
ZJU-PAT 1056. Mice and Rice (25) 浙大2013年上机复试第四题
#pragma warning (disable:4786) #include #include #include #include #include #include using namespace std; int n,m; int B[100005]; int flag; int cnt;//第几轮次被淘汰 int group[1005],num_i
ZJU PAT 1012 The Best Rank
#include #include #include #include using namespace std; #define Min(a,b)(a<b?a:b) int n,m; struct student { int id,ctest,math,english; double avg; int crank,mrank,erank,arank; int bestrank; st
ZJU-PAT 1050
#include #include using namespace std; /* Sample Input: They are students. aeiou Sample Output: Thy r stdnts. */ bool myhash[150]; string s1,s2; void run() { getline(cin,s2); int i; string
5961



被折叠的 条评论
为什么被折叠?



