提交记录 7287
提交时间 |
评测时间 |
2019-01-22 12:04:32 |
2020-08-01 01:02:19 |
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int n,ans;
int a[100010];
int main()
{
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
scanf("%d",&a[i]);
}
for(int i=2;i<=n;i++)
{
if(a[i]>a[i-1])
{
ans+=a[i]-a[i-1];
}
}
printf("%d\n",ans+a[1]);
return 0;
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 36.3 us | 44 KB | Accepted | Score: 10 | 显示更多 |
Testcase #2 | 43.81 us | 44 KB | Accepted | Score: 10 | 显示更多 |
Testcase #3 | 43.51 us | 44 KB | Accepted | Score: 10 | 显示更多 |
Testcase #4 | 39.12 us | 44 KB | Accepted | Score: 10 | 显示更多 |
Testcase #5 | 38.13 us | 44 KB | Accepted | Score: 10 | 显示更多 |
Testcase #6 | 43.22 us | 44 KB | Accepted | Score: 10 | 显示更多 |
Testcase #7 | 64.56 us | 48 KB | Accepted | Score: 10 | 显示更多 |
Testcase #8 | 321.54 us | 84 KB | Accepted | Score: 10 | 显示更多 |
Testcase #9 | 1.514 ms | 240 KB | Accepted | Score: 10 | 显示更多 |
Testcase #10 | 2.999 ms | 428 KB | Accepted | Score: 10 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2024-12-05 10:21:28 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠