| 记录编号 | 289750 | 评测结果 | AAAAAAAAAA | ||
|---|---|---|---|---|---|
| 题目名称 | 1440.[NOIP 2013]积木大赛 | 最终得分 | 100 | ||
| 用户昵称 | 是否通过 | 通过 | |||
| 代码语言 | C++ | 运行时间 | 0.004 s | ||
| 提交时间 | 2016-08-05 15:02:12 | 内存使用 | 0.31 MiB | ||
#include <fstream>
using namespace std;
ifstream cin("BlockNOIP2013.in");
ofstream cout("BlockNOIP2013.out");
int n,x,y,ans;
int cyf()
{
cin>>n>>x;
ans=x;
for (;n--;cin>>y,ans+=(x<y?y-x:0),x=y);
cout<<ans<<endl;
cin.close();
cout.close();
return 0;
}
int CYF=cyf();
int main(int argc, char const *argv[]){;}