| 比赛 | 专项训练十题 | 评测结果 | AAAAAAAAAA |
|---|---|---|---|
| 题目名称 | 积木大赛 | 最终得分 | 100 |
| 用户昵称 | Regnig Etalsnart | 运行时间 | 0.004 s |
| 代码语言 | C++ | 内存使用 | 0.13 MiB |
| 提交时间 | 2017-05-30 21:31:15 | ||
#include<cstdio>
#define syy myson
using namespace std;
int n,h[100010],i;
long long ans;
int Main()
{
freopen("BlockNOIP2013.in","r",stdin);freopen("BlockNOIP2013.out","w",stdout);
scanf("%d",&n);
for(i=1;i<=n;i++)scanf("%d",&h[i]);
for(i=0;i<n;i++)
if(h[i]<h[i+1])ans+=(h[i+1]-h[i]);
printf("%lld",ans);
return 0;
}
int main(){;}
int syy=Main();