提交记录 14679


用户 题目 状态 得分 用时 内存 语言 代码长度
Wallbreaker5th noip18a. 【NOIP2018】铺设道路 Accepted 100 631.46 us 44 KB C++ 588 B
提交时间 评测时间
2020-10-28 18:53:14 2020-10-28 18:53:16
#include<cstdio>
using namespace std;
const int LEN=1<<15;
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(){
	register int ans=0;
	register 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;
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #127.18 us16 KBAcceptedScore: 10

Testcase #228.63 us16 KBAcceptedScore: 10

Testcase #328 us16 KBAcceptedScore: 10

Testcase #427.7 us16 KBAcceptedScore: 10

Testcase #527.44 us16 KBAcceptedScore: 10

Testcase #629.41 us16 KBAcceptedScore: 10

Testcase #732.44 us20 KBAcceptedScore: 10

Testcase #881.37 us44 KBAcceptedScore: 10

Testcase #9329.9 us44 KBAcceptedScore: 10

Testcase #10631.46 us44 KBAcceptedScore: 10


Judge Duck Online | 评测鸭在线
Server Time: 2026-03-22 02:30:00 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠