提交记录 47639
| 提交时间 |
评测时间 |
| 2026-09-13 00:54:16 |
2026-09-13 00:54:19 |
// This code is AI-generated. (AI 生成的代码)
// NOIP2018 铺设道路: answer = sum_i max(0, d_i - d_{i-1}) (d_0 = 0).
typedef unsigned long long u64;
struct DuckInfo {
u64 abi;
const char *in; u64 in_size;
char *out; u64 out_limit; u64 out_size;
char *err; u64 err_limit; u64 err_size;
const char *ib; u64 ib_limit;
char *ob; u64 ob_limit; u64 tsc;
} __attribute__((packed));
static const char *g_in;
static u64 rd(void) {
while (*g_in && (unsigned char)*g_in <= ' ') g_in++;
u64 v = 0;
while ((unsigned char)*g_in > ' ') v = v * 10 + (u64)(*g_in++ - '0');
return v;
}
int main(void) { return 0; }
void __libc_start_main(int (*mf)(int, char **, char **), int ac, char **av) {
(void)mf;
char **e = av + ac + 1;
while (*e) e++;
u64 *aux = (u64 *)(e + 1);
struct DuckInfo *d = 0;
for (; aux[0]; aux += 2)
if (aux[0] == 0x6b637564) { d = (struct DuckInfo *)aux[1]; break; }
g_in = d->in;
u64 n = rd(), prev = 0, sum = 0;
for (u64 i = 0; i < n; i++) {
u64 x = rd();
if (x > prev) sum += x - prev;
prev = x;
}
char tmp[24];
int k = 0;
if (!sum) tmp[k++] = '0';
while (sum) { tmp[k++] = (char)('0' + sum % 10); sum /= 10; }
char *o = d->out;
while (k) *o++ = tmp[--k];
*o++ = '\n';
d->out_size = (u64)(o - d->out);
__asm__ volatile("mov $60,%%eax; xor %%edi,%%edi; syscall" ::: "rax","rdi","rcx","r11","memory");
__builtin_unreachable();
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 3.22 us | 12 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #2 | 2.74 us | 12 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #3 | 3.15 us | 12 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #4 | 3.15 us | 12 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #5 | 2.97 us | 12 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #6 | 4.38 us | 12 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #7 | 7.1 us | 12 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #8 | 46.63 us | 12 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #9 | 253.2 us | 12 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #10 | 503.64 us | 12 KB | Accepted | Score: 10 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-09-24 19:03:04 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠