提交记录 9292


用户 题目 状态 得分 用时 内存 语言 代码长度
beretty noip18a. 【NOIP2018】铺设道路 Accepted 100 1.528 ms 820 KB C++11 584 B
提交时间 评测时间
2019-04-22 16:52:33 2020-08-01 01:36:07
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
# define LL long long
const LL M = 1000005 ;
using namespace std ;
inline LL read() {
    char c = getchar() ; LL x = 0 , w = 1 ;
    while(c>'9'||c<'0') { if(c=='-') w = -1 ; c = getchar() ; }
    while(c>='0'&&c<='9') { x = x*10+c-'0' ; c = getchar() ; }
    return x*w ;
}

LL n ;
LL d[M] , Ans ;
int main() {
    n = read() ;
    for(int i = 1 ; i <= n ; i ++) {
        d[i] = read() ;
        if(d[i] - d[i - 1] > 0)
            Ans += (d[i] - d[i - 1]) ;
    }
    cout << Ans << endl ;
    return 0 ;
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #134.65 us40 KBAcceptedScore: 10

Testcase #241.06 us40 KBAcceptedScore: 10

Testcase #336.6 us40 KBAcceptedScore: 10

Testcase #440.79 us40 KBAcceptedScore: 10

Testcase #534.85 us40 KBAcceptedScore: 10

Testcase #639.13 us40 KBAcceptedScore: 10

Testcase #747.32 us48 KBAcceptedScore: 10

Testcase #8164.92 us116 KBAcceptedScore: 10

Testcase #9782.13 us428 KBAcceptedScore: 10

Testcase #101.528 ms820 KBAcceptedScore: 10


Judge Duck Online | 评测鸭在线
Server Time: 2024-05-04 23:55:23 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用