Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
442864 沈郭栋 【C3-9】电梯升降 C++ 通过 100 15 MS 252 KB 281 2026-05-30 17:12:06

Tests(10/10):


#include<bits/stdc++.h> using namespace std; int main(){ int n,f,t,a; while(cin>>n){ if(n==0)break; f=0; t=0; for(int i=1;i<=n;i++){ cin>>a; if(a>f){ t+=(a-f)*6+5; }else{ t+=(f-a)*4+5; } f=a; } cout<<t<<endl; } return 0; }


测评信息: