原题:
源代码:
#include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int timelist[n];
for(int i = 0; i < n; i ++)
cin>>timelist[i];
int sum = 0;
int now = 0;
for(int i = 0; i < n; i ++){
int tmp = timelist[i] - now;
if(timelist[i] > now){
sum += (tmp * 6);
now = timelist[i];
}else{
sum -= (tmp * 4);
now = timelist[i];
}
sum += 5;
}
cout<<sum;
}
已AC:
易失分点:
比较简单