提交记录 7903
提交时间 |
评测时间 |
2019-01-25 19:38:21 |
2020-08-01 01:10:08 |
#include <stdio.h>
#include<algorithm>
int n;
int ans;
int a[100000+3];
int main() {
scanf("%d",&n);
for(int i=1;i<=n;i++){
scanf("%d",&a[i]);
ans+=a[i];
}
for(int i=1;i<n;i++)
ans-=std::min(a[i],a[i+1]);
printf("%d\n",ans);
return 0;
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 9.02 us | 20 KB | Accepted | Score: 10 | 显示更多 |
Testcase #2 | 12.14 us | 20 KB | Accepted | Score: 10 | 显示更多 |
Testcase #3 | 13.23 us | 20 KB | Accepted | Score: 10 | 显示更多 |
Testcase #4 | 9.72 us | 20 KB | Accepted | Score: 10 | 显示更多 |
Testcase #5 | 10 us | 20 KB | Accepted | Score: 10 | 显示更多 |
Testcase #6 | 15.34 us | 20 KB | Accepted | Score: 10 | 显示更多 |
Testcase #7 | 33.8 us | 24 KB | Accepted | Score: 10 | 显示更多 |
Testcase #8 | 266.51 us | 56 KB | Accepted | Score: 10 | 显示更多 |
Testcase #9 | 1.311 ms | 216 KB | Accepted | Score: 10 | 显示更多 |
Testcase #10 | 2.619 ms | 404 KB | Accepted | Score: 10 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2024-12-05 10:44:25 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠