提交记录 14675


用户 题目 状态 得分 用时 内存 语言 代码长度
Wallbreaker5th noip18a. 【NOIP2018】铺设道路 Accepted 100 964.44 us 492 KB C++ 570 B
提交时间 评测时间
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;
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #1339.35 us16 KBAcceptedScore: 10

Testcase #2340.45 us16 KBAcceptedScore: 10

Testcase #3340.91 us16 KBAcceptedScore: 10

Testcase #4340.28 us16 KBAcceptedScore: 10

Testcase #5338.94 us16 KBAcceptedScore: 10

Testcase #6339.26 us16 KBAcceptedScore: 10

Testcase #7344.46 us20 KBAcceptedScore: 10

Testcase #8392.14 us52 KBAcceptedScore: 10

Testcase #9650.25 us252 KBAcceptedScore: 10

Testcase #10964.44 us492 KBAcceptedScore: 10


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