提交记录 7972


用户 题目 状态 得分 用时 内存 语言 代码长度
Wallbreaker5th noip18a. 【NOIP2018】铺设道路 Accepted 100 1.197 ms 36 KB C++ 648 B
提交时间 评测时间
2019-01-26 15:20:22 2020-08-01 01:11:14
#include<bits/stdc++.h>
using namespace std;
inline int getint(){
    int ans=0;
    char c=getchar();
    while(c<'0'||c>'9')c=getchar();//' '<'0'
    while(c>='0'&&c<='9'){
    	ans*=10;
        ans+=c-'0';
        c=getchar();
    }
    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=getchar();
	    while(c<'0'||c>'9')c=getchar();//' '<'0'
	    while(c>='0'&&c<='9'){
	    	x*=10;
	        x+=c-'0';
	        c=getchar();
	    }
        if(x-lst>0)ans+=(x-lst);
        lst=x;
    }
    printf("%d",ans);
    return 0;
}
//sang xin bing kuang

CompilationN/AN/ACompile OKScore: N/A

Testcase #134.02 us36 KBAcceptedScore: 10

Testcase #240.49 us36 KBAcceptedScore: 10

Testcase #340.23 us36 KBAcceptedScore: 10

Testcase #434.99 us36 KBAcceptedScore: 10

Testcase #535.18 us36 KBAcceptedScore: 10

Testcase #636.14 us36 KBAcceptedScore: 10

Testcase #744.13 us36 KBAcceptedScore: 10

Testcase #8136.78 us36 KBAcceptedScore: 10

Testcase #9615.68 us36 KBAcceptedScore: 10

Testcase #101.197 ms36 KBAcceptedScore: 10


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