提交记录 9586


用户 题目 状态 得分 用时 内存 语言 代码长度
emapans noip18a. 【NOIP2018】铺设道路 Accepted 100 2.901 ms 16 KB C++ 312 B
提交时间 评测时间
2019-06-13 17:13:43 2020-08-01 01:41:01
#include<cstdio>
using namespace std;
int ans,a,ls,n;
int main()
{
    scanf("%d",&n);
    scanf("%d",&ans);
    ls=ans;
    for(register int i=1;i<n;i++)
    {
        scanf("%d",&a);
        if(a>ls)
        {
            ans+=(a-ls);
        }
        ls=a;//更新now
    }
    printf("%d",ans);
    return 0;
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #18.5 us16 KBAcceptedScore: 10

Testcase #212.3 us16 KBAcceptedScore: 10

Testcase #311.35 us16 KBAcceptedScore: 10

Testcase #48.57 us16 KBAcceptedScore: 10

Testcase #59.83 us16 KBAcceptedScore: 10

Testcase #615.58 us16 KBAcceptedScore: 10

Testcase #736.01 us16 KBAcceptedScore: 10

Testcase #8286.55 us16 KBAcceptedScore: 10

Testcase #91.452 ms16 KBAcceptedScore: 10

Testcase #102.901 ms16 KBAcceptedScore: 10


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