| 记录编号 | 135981 | 评测结果 | AAAAAAAAAA | ||
|---|---|---|---|---|---|
| 题目名称 | 1440.[NOIP 2013]积木大赛 | 最终得分 | 100 | ||
| 用户昵称 | 是否通过 | 通过 | |||
| 代码语言 | C++ | 运行时间 | 0.015 s | ||
| 提交时间 | 2014-11-02 01:59:23 | 内存使用 | 0.32 MiB | ||
#include<iostream>
#include<fstream>
using namespace std;
ifstream fin("BlockNOIP2013.in");
ofstream fout("BlockNOIP2013.out");
int main(){
int n,a=0,b,ans=0;
fin>>n;
for(int i=0;i!=n;++i){
fin>>b;
if(b>a)
ans+=b-a;
a=b;
}
fout<<ans;
return 0;
}
//designed by wolf