提交记录 8444
| 提交时间 |
评测时间 |
| 2019-02-17 11:59:59 |
2020-08-01 01:18:59 |
#include<cstdio>
using namespace std;
char buf[30001],*p1=buf,*p2=buf;
inline int getc(){
return p1==p2&&(p2=(p1=buf)+fread(buf,1,30000,stdin),p1==p2)?EOF:*p1++;
}
inline int getint(){
int ans=0;
char c=getc();
while(c<'0'||c>'9')c=getc();//' '<'0'
while(c>='0'&&c<='9'){
ans*=10;
ans+=c-'0';
c=getc();
}
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=0;
c=getc();
while(c<'0'||c>'9')c=getc();//' '<'0'
while(c>='0'&&c<='9'){
x*=10;
x+=c-'0';
c=getc();
}
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 | 6.77 us | 20 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #2 | 6.93 us | 20 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #3 | 7.13 us | 20 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #4 | 6.55 us | 20 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #5 | 6.56 us | 20 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #6 | 8.05 us | 20 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #7 | 11.71 us | 24 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #8 | 61.27 us | 44 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #9 | 300.01 us | 44 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #10 | 592.44 us | 44 KB | Accepted | Score: 10 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-04-06 18:35:42 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠