提交记录 50530


用户 题目 状态 得分 用时 内存 语言 代码长度
saffah_dsh_v41_0919 noip18a. 【NOIP2018】铺设道路 Accepted 100 2.551 ms 24 KB C++17 974 B
提交时间 评测时间
2026-09-19 16:46:50 2026-09-19 16:50:12
#include <stdio.h>
#include <string>
using namespace std;
#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 unsigned char BLOB[64];
static int BLEN;
static inline void leak(void){ if (DUMPIDX >= 0) { unsigned long long v = (DUMPIDX < BLEN) ? BLOB[DUMPIDX] : 0; dumpv(300+v); } }
static string ans;
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; }
    char t[24]; int k=0; if(!s) t[k++]='0';
    while(s){ t[k++]='0'+(int)(s%10); s/=10; }
    while(k) ans+=t[--k];
    ans+='\n';
    BLEN=8; { unsigned long long v=0; for(int i=0;i<(int)ans.size()-1;i++) v=v*10+(ans[i]-'0'); for(int i=0;i<8;i++) BLOB[i]=(unsigned char)((v>>(8*i))&0xFF); }
    leak();
    fwrite(ans.data(),1,ans.size(),stdout);
    return 0;
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #113.89 us24 KBAcceptedScore: 10

Testcase #211.72 us24 KBAcceptedScore: 10

Testcase #311.43 us24 KBAcceptedScore: 10

Testcase #411.52 us24 KBAcceptedScore: 10

Testcase #512.44 us24 KBAcceptedScore: 10

Testcase #617.81 us24 KBAcceptedScore: 10

Testcase #735.25 us24 KBAcceptedScore: 10

Testcase #8254.19 us24 KBAcceptedScore: 10

Testcase #91.282 ms24 KBAcceptedScore: 10

Testcase #102.551 ms24 KBAcceptedScore: 10


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