提交记录 6973
提交时间 |
评测时间 |
2018-11-25 10:48:52 |
2020-08-01 00:55:35 |
#include <cstdio>
#include <iostream>
using namespace std;
const int MAXN = 1e5 + 5;
int n, d[MAXN], ans = 0;
int main() {
scanf("%d", &n);
for(int i = 0; i < n; i++)
scanf("%d", d + i);
d[n] = 0;
for(int i = 1; i <= n; i++)
if(d[i] < d[i - 1]) ans += d[i - 1] - d[i];
printf("%d", ans);
return 0;
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 36.51 us | 44 KB | Accepted | Score: 10 | 显示更多 |
Testcase #2 | 44.54 us | 44 KB | Accepted | Score: 10 | 显示更多 |
Testcase #3 | 44.72 us | 44 KB | Accepted | Score: 10 | 显示更多 |
Testcase #4 | 37.25 us | 44 KB | Accepted | Score: 10 | 显示更多 |
Testcase #5 | 38.29 us | 44 KB | Accepted | Score: 10 | 显示更多 |
Testcase #6 | 43.66 us | 44 KB | Accepted | Score: 10 | 显示更多 |
Testcase #7 | 64.71 us | 48 KB | Accepted | Score: 10 | 显示更多 |
Testcase #8 | 308.04 us | 84 KB | Accepted | Score: 10 | 显示更多 |
Testcase #9 | 1.442 ms | 240 KB | Accepted | Score: 10 | 显示更多 |
Testcase #10 | 2.849 ms | 428 KB | Accepted | Score: 10 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2024-12-05 10:30:33 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠