提交记录 6916


用户 题目 状态 得分 用时 内存 语言 代码长度
Wallbreaker5th noip18a. 【NOIP2018】铺设道路 Accepted 100 1.27 ms 36 KB C++ 482 B
提交时间 评测时间
2018-11-16 20:34:03 2020-08-01 00:54:11
#include<bits/stdc++.h>
using namespace std;
int getint(){
    int ans=0,f=1;
    char c=getchar();
    while(c>'9'||c<'0'){
        if(c=='-')f=-1;
        c=getchar();
    }
    while(c>='0'&&c<='9'){
        ans=ans*10+c-'0';
        c=getchar();
    }
    return ans*f;
}

int main(){
    int n=getint();
    int lst=0,ans=0,mn=1926081700;
    for(int i=0;i<n;i++){
        int x=getint();
        if(lst<x)ans+=x-lst;
        lst=x;
    }
    printf("%d",ans);
    return 0;
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #133.76 us36 KBAcceptedScore: 10

Testcase #239.71 us36 KBAcceptedScore: 10

Testcase #341.41 us36 KBAcceptedScore: 10

Testcase #433.39 us36 KBAcceptedScore: 10

Testcase #535.48 us36 KBAcceptedScore: 10

Testcase #636.12 us36 KBAcceptedScore: 10

Testcase #745.88 us36 KBAcceptedScore: 10

Testcase #8144.5 us36 KBAcceptedScore: 10

Testcase #9653.92 us36 KBAcceptedScore: 10

Testcase #101.27 ms36 KBAcceptedScore: 10


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