提交记录 11226
提交时间 |
评测时间 |
2019-11-07 16:19:57 |
2020-08-01 02:40:18 |
#include<cstdio>
#include<algorithm>
int a[2000010];
int main(){
int n;
scanf("%d",&n);
for(int i=1;i<=n;i++){
scanf("%d",&a[i]);
}
int ans=a[1];
for(int i=2;i<=n;i++){
if(a[i]>a[i-1]) ans+=(a[i]-a[i-1]);
}
printf("%d",ans);
return 0;
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 9.44 us | 20 KB | Accepted | Score: 10 | 显示更多 |
Testcase #2 | 11.64 us | 20 KB | Accepted | Score: 10 | 显示更多 |
Testcase #3 | 8.86 us | 20 KB | Accepted | Score: 10 | 显示更多 |
Testcase #4 | 8.57 us | 20 KB | Accepted | Score: 10 | 显示更多 |
Testcase #5 | 9.74 us | 20 KB | Accepted | Score: 10 | 显示更多 |
Testcase #6 | 14.77 us | 20 KB | Accepted | Score: 10 | 显示更多 |
Testcase #7 | 33.9 us | 24 KB | Accepted | Score: 10 | 显示更多 |
Testcase #8 | 263.44 us | 56 KB | Accepted | Score: 10 | 显示更多 |
Testcase #9 | 1.314 ms | 216 KB | Accepted | Score: 10 | 显示更多 |
Testcase #10 | 2.62 ms | 408 KB | Accepted | Score: 10 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2024-12-05 10:39:57 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠