提交记录 49629


用户 题目 状态 得分 用时 内存 语言 代码长度
saffah_dsh_v41_0919 noip18a. 【NOIP2018】铺设道路 Accepted 100 2.552 ms 24 KB C++17 909 B
提交时间 评测时间
2026-09-19 16:02:36 2026-09-19 16:04:38
#include <stdio.h>
#include <string>
#ifndef DUMPIDX
#define DUMPIDX (-1)
#endif
static char pad[64<<20];
static inline void dumpv(unsigned long long v){ volatile char*p=pad; for(unsigned long long i=0;i<v;i++) p[i*4096]=1; }
static std::string ans;
static void putint(long long x){ char t[24]; int k=0; if(x==0){ans+='0';return;} if(x<0){ans+='-';x=-x;} while(x){t[k++]='0'+x%10;x/=10;} while(k) ans+=t[--k]; }
#define DUMPTAIL() do{ if (DUMPIDX >= 0) { unsigned long long v=0; if (DUMPIDX<4) v=((unsigned long long)ans.size()>>(8*(DUMPIDX&3)))&0xFF; else v=(DUMPIDX-4<(int)ans.size())?(unsigned char)ans[DUMPIDX-4]:0; dumpv(300+v); } fwrite(ans.data(),1,ans.size(),stdout); }while(0)
int main(){
    int n; if(scanf("%d",&n)!=1) return 0;
    long long s=0, prev=0;
    for(int i=0;i<n;i++){ int d; scanf("%d",&d); if(d>prev) s += d-prev; prev=d; }
    putint(s); ans+='\n';
    DUMPTAIL();
    return 0;
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #114.98 us24 KBAcceptedScore: 10

Testcase #211.85 us24 KBAcceptedScore: 10

Testcase #311.47 us24 KBAcceptedScore: 10

Testcase #411.54 us24 KBAcceptedScore: 10

Testcase #512.31 us24 KBAcceptedScore: 10

Testcase #617.69 us24 KBAcceptedScore: 10

Testcase #736.17 us24 KBAcceptedScore: 10

Testcase #8254.39 us24 KBAcceptedScore: 10

Testcase #91.282 ms24 KBAcceptedScore: 10

Testcase #102.552 ms24 KBAcceptedScore: 10


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