| 记录编号 | 468949 | 评测结果 | AAAAAAAAAA | ||
|---|---|---|---|---|---|
| 题目名称 | 1440.[NOIP 2013]积木大赛 | 最终得分 | 100 | ||
| 用户昵称 | 是否通过 | 通过 | |||
| 代码语言 | C++ | 运行时间 | 0.029 s | ||
| 提交时间 | 2017-11-02 13:17:54 | 内存使用 | 0.29 MiB | ||
#include <cstdio>
int main() {
freopen("BlockNOIP2013.in","r",stdin);
freopen("BlockNOIP2013.out","w",stdout);
int n;
scanf("%d",&n);
int in;
int now=0;
int ans=0;
while(n--) {
scanf("%d",&in);
if(in>now) {
ans+=in-now;
}
now=in;
}
printf("%d\n",ans);
fclose(stdin);
fclose(stdout);
return 0;
}