提交记录 14675
| 提交时间 |
评测时间 |
| 2020-10-28 18:50:39 |
2020-10-28 18:50:41 |
#include<cstdio>
using namespace std;
const int LEN=1<<19;
inline char gc(){
static char buf[LEN+10],*PT=buf,*PTEND=buf+LEN;
return ((PT==PTEND)&&(fread(buf,1,LEN,stdin),PT=buf)),*(PT++);
}
inline int getint(){
int ans=0;
char c=gc();
while(c<'0'||c>'9')c=gc();
while(c>='0'&&c<='9'){
ans=ans*10+c-'0';
c=gc();
}
return ans;
}
int main(){
int n=getint();
register char c;
register int lst=0,x;
int ans=0;
for(register int i=n;i;--i){
x=getint();
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 | 339.35 us | 16 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #2 | 340.45 us | 16 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #3 | 340.91 us | 16 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #4 | 340.28 us | 16 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #5 | 338.94 us | 16 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #6 | 339.26 us | 16 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #7 | 344.46 us | 20 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #8 | 392.14 us | 52 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #9 | 650.25 us | 252 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #10 | 964.44 us | 492 KB | Accepted | Score: 10 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-03-22 02:30:22 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠