提交记录 40156
| 用户 | 题目 | 状态 | 得分 | 用时 | 内存 | 语言 | 代码长度 |
|---|---|---|---|---|---|---|---|
| saffah_dsh_260814 | noi17a. 【NOI2017】整数 | Wrong Answer | 0 | 15.165 ms | 792 KB | C | 2.22 KB |
| 提交时间 | 评测时间 |
|---|---|
| 2026-08-17 21:06:52 | 2026-08-17 21:07:36 |
#include <stdint.h>
#include <sys/auxv.h>
#include <unistd.h>
struct DuckInfo {
uint64_t abi_version;
const char *stdin_ptr; uint64_t stdin_size;
char *stdout_ptr; uint64_t stdout_limit; uint64_t stdout_size;
char *stderr_ptr; uint64_t stderr_limit; uint64_t stderr_size;
const char *IB_ptr; uint64_t IB_limit;
char *OB_ptr; uint64_t OB_limit;
uint64_t tsc_frequency;
} __attribute__((packed));
static const char *P;
static uint64_t O;
__attribute__((noreturn)) static void done(uint64_t olen, struct DuckInfo *di, char *out, int use_di){
if (use_di) di->stdout_size = olen;
else (void)!write(1, out, olen);
asm volatile("mov $60, %%eax; xor %%edi, %%edi; syscall" ::: "rax","rdi","memory");
__builtin_unreachable();
}
int main(){
struct DuckInfo *di = (struct DuckInfo*)getauxval(0x6b637564);
static char lbuf[1<<24];
static char obuf[1<<22];
char *out;
int use_di = 0;
if (di && di->abi_version >= 1 && di->stdin_ptr && di->stdout_ptr){
P = di->stdin_ptr; out = di->stdout_ptr; use_di = 1;
} else {
long n2 = 0, t;
while (n2 < (long)sizeof(lbuf) && (t = read(0, lbuf + n2, sizeof(lbuf) - n2)) > 0) n2 += t;
lbuf[n2] = 0; P = lbuf; out = obuf;
}
// parse header (n t1 t2 t3)
int n = 0;
while (*P > ' ') n = n*10 + (*P - '0'), P++;
while (*P <= ' ') P++;
while (*P > ' ') P++; // t1
while (*P <= ' ') P++;
while (*P > ' ') P++; // t2
while (*P <= ' ') P++;
while (*P > ' ') P++; // t3
while (*P <= ' ') P++;
long acc = 0;
for (int i = 0; i < n; i++){
int op = *P++ - '0';
P++; /* skip separator */
if (op == 1){
int neg = 0;
if (*P == '-'){ neg = 1; P++; }
long a = 0;
while (*P > ' '){ a = a*10 + (*P - '0'); P++; }
P++;
long b = 0;
while (*P > ' '){ b = b*10 + (*P - '0'); P++; }
P++;
if (neg) acc -= a + b; else acc += a + b;
} else {
long k = 0;
while (*P > ' '){ k = k*10 + (*P - '0'); P++; }
P++;
acc += k;
out[O++] = (char)('0' + (acc & 1));
out[O++] = '\n';
}
}
done(O, di, out, use_di);
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 5.69 us | 12 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #2 | 6.28 us | 12 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #3 | 28.82 us | 12 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #4 | 41.87 us | 12 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #5 | 68.38 us | 12 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #6 | 75.85 us | 16 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #7 | 132.53 us | 16 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #8 | 128.74 us | 16 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #9 | 416.55 us | 28 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #10 | 633.83 us | 36 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #11 | 786.22 us | 48 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #12 | 739.57 us | 48 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #13 | 1.047 ms | 52 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #14 | 2.858 ms | 128 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #15 | 3.143 ms | 188 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #16 | 5.932 ms | 248 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #17 | 6.755 ms | 308 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #18 | 9.367 ms | 368 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #19 | 10.904 ms | 428 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #20 | 10.517 ms | 792 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #21 | 10.332 ms | 548 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #22 | 12.668 ms | 564 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #23 | 12.674 ms | 480 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #24 | 13.445 ms | 600 KB | Wrong Answer | Score: 0 | 显示更多 |
| Testcase #25 | 15.165 ms | 604 KB | Wrong Answer | Score: 0 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-09-03 17:33:32 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠