| 记录编号 | 188660 | 评测结果 | AAAAAAAAAA | ||
|---|---|---|---|---|---|
| 题目名称 | 1440.[NOIP 2013]积木大赛 | 最终得分 | 100 | ||
| 用户昵称 | 是否通过 | 通过 | |||
| 代码语言 | C++ | 运行时间 | 0.019 s | ||
| 提交时间 | 2015-09-24 19:39:08 | 内存使用 | 0.29 MiB | ||
// KZ's
#include<cstdio>
int main() {
freopen("BlockNOIP2013.in","r",stdin);
freopen("BlockNOIP2013.out","w",stdout);
int n,h,l;
scanf("%d%d",&n,&h);
int sum=h;
for (int i=1;i<n;i++) {
l=h;
scanf("%d",&h);
sum+=h>l?h-l:0;
}
printf("%d",sum);
return 0;
}
// UBWH