标签:+= clu stream tor 参考 else namespace lse pre
#include<iostream>
#include<vector>
using namespace std;
int main(){
int n, sum = 0;
cin >> n;
vector<int> v(n);
for(int i = 0; i < n; i++){
scanf("%d", &v[i]);
if(i == 0){
sum += v[i] * 6 + 5;
}else{
if(v[i] - v[i - 1] < 0){
sum += (v[i - 1] - v[i]) * 4 + 5;
}else{
sum += (v[i] - v[i - 1]) * 6 + 5;
}
}
}
printf("%d", sum);
return 0;
}
标签:+= clu stream tor 参考 else namespace lse pre
原文地址:https://www.cnblogs.com/tsruixi/p/13210776.html