提交记录 14677


用户 题目 状态 得分 用时 内存 语言 代码长度
Wallbreaker5th noip18a. 【NOIP2018】铺设道路 Accepted 100 654.18 us 76 KB C++ 590 B
提交时间 评测时间
2020-10-28 18:51:48 2020-10-28 18:51:50
#include<cstdio>
using namespace std;
const int LEN=1<<16|1;
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 #147.47 us16 KBAcceptedScore: 10

Testcase #248.47 us16 KBAcceptedScore: 10

Testcase #347.46 us16 KBAcceptedScore: 10

Testcase #448.11 us16 KBAcceptedScore: 10

Testcase #548.84 us16 KBAcceptedScore: 10

Testcase #650.05 us16 KBAcceptedScore: 10

Testcase #753.83 us20 KBAcceptedScore: 10

Testcase #8101.67 us52 KBAcceptedScore: 10

Testcase #9351.38 us76 KBAcceptedScore: 10

Testcase #10654.18 us76 KBAcceptedScore: 10


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