提交记录 14676


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

Testcase #247.59 us16 KBAcceptedScore: 10

Testcase #347.51 us16 KBAcceptedScore: 10

Testcase #448.39 us16 KBAcceptedScore: 10

Testcase #548.48 us16 KBAcceptedScore: 10

Testcase #650.17 us16 KBAcceptedScore: 10

Testcase #752.99 us20 KBAcceptedScore: 10

Testcase #8102.15 us52 KBAcceptedScore: 10

Testcase #9351.58 us76 KBAcceptedScore: 10

Testcase #10652.88 us76 KBAcceptedScore: 10


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