好操蛋啊,电梯竟然能原地不动,你大爷的,这逻辑,太弱智了。。。。
Problem : 1008 ( Elevator ) Judge Status : Accepted
RunId : 10371112 Language : C++ Author : mnmlist
Code Render Status : Rendered By HDOJ C++ Code Render Version 0.01 Beta
RunId : 10371112 Language : C++ Author : mnmlist
Code Render Status : Rendered By HDOJ C++ Code Render Version 0.01 Beta
#include<iostream>
using namespace std;
void main()
{
int a=0,b,sum=0,n,num;
cin>>num;
while(num)
{
sum=0;
a=0;
for(int i=0;i<num;i++)
{
cin>>n;
b=n;
if(b>=a)
sum+=(b-a)*6+5;
else if(b<a)
sum+=(a-b)*4+5;
a=b; }
cout<<sum<<endl;
cin>>num;
}
}