Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
442863 黄浙峰老师 【C3-9】电梯升降 C++ 通过 100 7 MS 244 KB 294 2026-05-30 17:05:50

Tests(10/10):


#include<bits/stdc++.h> using namespace std; int n,f,t,a; int main(){ 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; }


测评信息: