林嘉乐 • 2个月前
#include<bits/stdc++.h>
using namespace std;
int main()
{
long long n,h[200001],t=0;
cin>>n;
for(int i=1;i<=n;i++){
cin>>h[i];
while(h[i]>0){
t++;
if(t%3==0){
h[i]-=3;
}
else{
h[i]--;
}
}
}
cout<<t<<endl;
return 0;
}
评论: