hdu1008

//实在太水了。。。
#include 
#include 
using namespace std;

int main()
{
    int N;
    int CurrFloor;
    int DesFloor;
    int time;
    while(cin>>N,N!=0)
    {
         CurrFloor = 0;
         time = 0;
         int cha;
         for(int i = 1;i <= N; i++)
         {
              cin>>DesFloor;
              cha = DesFloor - CurrFloor;
              if(cha < 0)
              {
                     time += abs(cha)*4;
              }
              else
              {
                     time += abs(cha)*6;
              }
              CurrFloor = DesFloor;
         }
         time += 5*N;
         cout<

你可能感兴趣的:(ACM-ICPC,水题)