提交记录 6973


用户 题目 状态 得分 用时 内存 语言 代码长度
zhylj noip18a. 【NOIP2018】铺设道路 Accepted 100 2.849 ms 428 KB C++ 343 B
提交时间 评测时间
2018-11-25 10:48:52 2020-08-01 00:55:35
#include <cstdio>
#include <iostream>

using namespace std;

const int MAXN = 1e5 + 5;

int n, d[MAXN], ans = 0;

int main() {
    scanf("%d", &n);
    for(int i = 0; i < n; i++)
        scanf("%d", d + i);
    d[n] = 0;
    for(int i = 1; i <= n; i++)
        if(d[i] < d[i - 1]) ans += d[i - 1] - d[i];
    printf("%d", ans);
    return 0;
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #136.51 us44 KBAcceptedScore: 10

Testcase #244.54 us44 KBAcceptedScore: 10

Testcase #344.72 us44 KBAcceptedScore: 10

Testcase #437.25 us44 KBAcceptedScore: 10

Testcase #538.29 us44 KBAcceptedScore: 10

Testcase #643.66 us44 KBAcceptedScore: 10

Testcase #764.71 us48 KBAcceptedScore: 10

Testcase #8308.04 us84 KBAcceptedScore: 10

Testcase #91.442 ms240 KBAcceptedScore: 10

Testcase #102.849 ms428 KBAcceptedScore: 10


Judge Duck Online | 评测鸭在线
Server Time: 2024-12-05 10:30:33 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠