提交记录 9292
提交时间 |
评测时间 |
2019-04-22 16:52:33 |
2020-08-01 01:36:07 |
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
# define LL long long
const LL M = 1000005 ;
using namespace std ;
inline LL read() {
char c = getchar() ; LL x = 0 , w = 1 ;
while(c>'9'||c<'0') { if(c=='-') w = -1 ; c = getchar() ; }
while(c>='0'&&c<='9') { x = x*10+c-'0' ; c = getchar() ; }
return x*w ;
}
LL n ;
LL d[M] , Ans ;
int main() {
n = read() ;
for(int i = 1 ; i <= n ; i ++) {
d[i] = read() ;
if(d[i] - d[i - 1] > 0)
Ans += (d[i] - d[i - 1]) ;
}
cout << Ans << endl ;
return 0 ;
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 34.65 us | 40 KB | Accepted | Score: 10 | 显示更多 |
Testcase #2 | 41.06 us | 40 KB | Accepted | Score: 10 | 显示更多 |
Testcase #3 | 36.6 us | 40 KB | Accepted | Score: 10 | 显示更多 |
Testcase #4 | 40.79 us | 40 KB | Accepted | Score: 10 | 显示更多 |
Testcase #5 | 34.85 us | 40 KB | Accepted | Score: 10 | 显示更多 |
Testcase #6 | 39.13 us | 40 KB | Accepted | Score: 10 | 显示更多 |
Testcase #7 | 47.32 us | 48 KB | Accepted | Score: 10 | 显示更多 |
Testcase #8 | 164.92 us | 116 KB | Accepted | Score: 10 | 显示更多 |
Testcase #9 | 782.13 us | 428 KB | Accepted | Score: 10 | 显示更多 |
Testcase #10 | 1.528 ms | 820 KB | Accepted | Score: 10 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2024-12-05 10:40:05 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠