提交记录 10619
提交时间 |
评测时间 |
2019-09-21 17:00:26 |
2020-08-01 02:18:19 |
#include<cstdio>
#define N 100000
using namespace std;
#define max(a, b) ((a) < (b) ? (b) : (a))
void read(int &x)
{
char ch=getchar(); x=0;
while (ch<'0'||ch>'9') ch=getchar();
while (ch>='0'&&ch<='9') x=(x << 1) + (x << 3) + (ch ^ 48),ch=getchar();
}
int a[N+1],n,ans=0;
int main()
{
read(n);
for (int i=1;i<=n;i++) read(a[i]);
for (int i=1;i<=n;i++) ans+=max(0,a[i]-a[i-1]);
printf("%d",ans);
return 0;
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 6.9 us | 20 KB | Accepted | Score: 10 | 显示更多 |
Testcase #2 | 10.65 us | 20 KB | Accepted | Score: 10 | 显示更多 |
Testcase #3 | 9.86 us | 20 KB | Accepted | Score: 10 | 显示更多 |
Testcase #4 | 7.77 us | 20 KB | Accepted | Score: 10 | 显示更多 |
Testcase #5 | 7.59 us | 20 KB | Accepted | Score: 10 | 显示更多 |
Testcase #6 | 9.32 us | 20 KB | Accepted | Score: 10 | 显示更多 |
Testcase #7 | 17.66 us | 24 KB | Accepted | Score: 10 | 显示更多 |
Testcase #8 | 109.66 us | 56 KB | Accepted | Score: 10 | 显示更多 |
Testcase #9 | 636.97 us | 212 KB | Accepted | Score: 10 | 显示更多 |
Testcase #10 | 1.267 ms | 404 KB | Accepted | Score: 10 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2024-12-05 10:21:02 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠