提交记录 9586
提交时间 |
评测时间 |
2019-06-13 17:13:43 |
2020-08-01 01:41:01 |
#include<cstdio>
using namespace std;
int ans,a,ls,n;
int main()
{
scanf("%d",&n);
scanf("%d",&ans);
ls=ans;
for(register int i=1;i<n;i++)
{
scanf("%d",&a);
if(a>ls)
{
ans+=(a-ls);
}
ls=a;//更新now
}
printf("%d",ans);
return 0;
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 8.5 us | 16 KB | Accepted | Score: 10 | 显示更多 |
Testcase #2 | 12.3 us | 16 KB | Accepted | Score: 10 | 显示更多 |
Testcase #3 | 11.35 us | 16 KB | Accepted | Score: 10 | 显示更多 |
Testcase #4 | 8.57 us | 16 KB | Accepted | Score: 10 | 显示更多 |
Testcase #5 | 9.83 us | 16 KB | Accepted | Score: 10 | 显示更多 |
Testcase #6 | 15.58 us | 16 KB | Accepted | Score: 10 | 显示更多 |
Testcase #7 | 36.01 us | 16 KB | Accepted | Score: 10 | 显示更多 |
Testcase #8 | 286.55 us | 16 KB | Accepted | Score: 10 | 显示更多 |
Testcase #9 | 1.452 ms | 16 KB | Accepted | Score: 10 | 显示更多 |
Testcase #10 | 2.901 ms | 16 KB | Accepted | Score: 10 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2024-12-05 10:31:41 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠