提交记录 6958
| 提交时间 |
评测时间 |
| 2018-11-24 14:06:23 |
2020-08-01 00:55:12 |
#include<bits/stdc++.h>
using namespace std;
inline int getint(){
int ans=0,f=1;
char c=getchar();
while(c>'9'||c<'0'){
if(c=='-')f=-1;
c=getchar();
}
while(c>='0'&&c<='9'){
ans*=10;
ans+=c-'0';
c=getchar();
}
return ans;
}
int main(){
register int n=getint();
register int lst=0,ans=0,mn=1926081700,x;
for(register int i=0;i<n;i++){
x=getint();
if(x-lst>0)ans+=x-lst;
lst=x;
}
printf("%d",ans);
return 0;
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 32.82 us | 36 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #2 | 37.97 us | 36 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #3 | 39.09 us | 36 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #4 | 35.1 us | 36 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #5 | 34.49 us | 36 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #6 | 35.65 us | 36 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #7 | 43.75 us | 36 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #8 | 144.19 us | 36 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #9 | 856.67 us | 36 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #10 | 1.684 ms | 36 KB | Accepted | Score: 10 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-04-09 05:43:40 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠