提交记录 8438


用户 题目 状态 得分 用时 内存 语言 代码长度
Wallbreaker5th noip18a. 【NOIP2018】铺设道路 Accepted 100 614.09 us 24 KB C++ 745 B
提交时间 评测时间
2019-02-17 11:18:52 2020-08-01 01:18:51
#include<cstdio>
using namespace std;
char buf[10000],*p1=buf,*p2=buf;
inline int getc(){
	return p1==p2&&(p2=(p1=buf)+fread(buf,1,10000,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,ans=0,x;
    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=(x<<3)+(x<<1);
	        x+=c-'0';
	        c=getc();
	    }
        if(x-lst>0)ans+=(x-lst);
        lst=x;
    }
    printf("%d",ans);
    return 0;
}
//丧心病狂

CompilationN/AN/ACompile OKScore: N/A

Testcase #16.73 us20 KBAcceptedScore: 10

Testcase #210 us20 KBAcceptedScore: 10

Testcase #310.04 us20 KBAcceptedScore: 10

Testcase #47.56 us20 KBAcceptedScore: 10

Testcase #58.49 us20 KBAcceptedScore: 10

Testcase #69.11 us20 KBAcceptedScore: 10

Testcase #713.02 us24 KBAcceptedScore: 10

Testcase #858.4 us24 KBAcceptedScore: 10

Testcase #9306.65 us24 KBAcceptedScore: 10

Testcase #10614.09 us24 KBAcceptedScore: 10


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