提交记录 47782


用户 题目 状态 得分 用时 内存 语言 代码长度
jiegec noip17b. 【NOIP2017】时间复杂度 Wrong Answer 0 5.5 us 8 KB C++17 3.59 KB
提交时间 评测时间
2026-09-13 02:33:29 2026-09-13 02:33:33
// This code is AI-generated. (AI 生成的代码)
// NOIP2017 时间复杂度: parse nested F/E loops directly from DuckInfo.  A loop
// F i x y contributes n to the nesting depth iff x is a number and y is "n";
// if x is "n" and y a number, or both numbers with x>y, the loop never runs and
// everything inside is dead.  Track the live variable set for ERR detection.
typedef unsigned long long u64;
struct DuckInfo {
    u64 abi; const char *in; u64 in_size; char *out; u64 out_limit, out_size;
    char *err; u64 err_limit, err_size; const char *IB; u64 IB_limit;
    char *OB; u64 OB_limit; u64 tsc;
} __attribute__((packed));
static const char *ip;
static char *op;
static inline const char *skip(const char *p) {
    while (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t') ++p;
    return p;
}
int main(void) { return 0; }
void __libc_start_main(int (*mf)(int, char **, char **), int ac, char **av) {
    (void)mf;
    struct DuckInfo *d = (struct DuckInfo *)((u64 *)av)[29];
    ip = d->in;
    op = d->out;
    {
        const char *p = ip;
        int t = 0;
        while (*p >= '0' && *p <= '9') t = t * 10 + (*p++ - '0');
        while (t--) {
            p = skip(p);
            int L = 0;
            while (*p >= '0' && *p <= '9') L = L * 10 + (*p++ - '0');
            p = skip(p); p += 2;
            int expw = 0;
            if (*p == 'n') { p += 2; while (*p >= '0' && *p <= '9') expw = expw * 10 + (*p++ - '0'); }
            else ++p;
            ++p;
            struct Frame { unsigned char v, isn, dead, contrib; } stk[128];
            int top = 0, mask = 0, err = 0, dead = 0, cur = 0, maxc = 0;
            for (int i = 0; i < L; ++i) {
                p = skip(p);
                char c = *p++;
                if (c == 'F') {
                    ++p;
                    int vi = *p++ - 'a';
                    ++p;
                    int xnum = (*p != 'n'), xv = 0;
                    if (xnum) { xv = *p++ - '0'; if (*p >= '0' && *p <= '9') xv = xv * 10 + (*p++ - '0'); }
                    else ++p;
                    ++p;
                    int ynum = (*p != 'n'), yv = 0;
                    if (ynum) { yv = *p++ - '0'; if (*p >= '0' && *p <= '9') yv = yv * 10 + (*p++ - '0'); }
                    else ++p;
                    int dd = 0, isn = 0;
                    if (!xnum && ynum) dd = 1;
                    else if (xnum && !ynum) isn = 1;
                    else if (xnum && ynum && xv > yv) dd = 1;
                    int b = 1 << vi;
                    if (mask & b) err = 1;
                    mask |= b;
                    int contrib = isn && (dead == 0);
                    stk[top].v = (unsigned char)vi; stk[top].isn = (unsigned char)isn;
                    stk[top].dead = (unsigned char)dd; stk[top].contrib = (unsigned char)contrib;
                    ++top;
                    if (dd) ++dead;
                    if (contrib && ++cur > maxc) maxc = cur;
                } else {
                    if (top == 0) err = 1;
                    else {
                        --top;
                        mask &= ~(1 << stk[top].v);
                        if (stk[top].contrib) --cur;
                        if (stk[top].dead) --dead;
                    }
                }
            }
            if (top != 0) err = 1;
            if (err) { *op++ = 'E'; *op++ = 'R'; *op++ = 'R'; }
            else if (maxc == expw) { *op++ = 'Y'; *op++ = 'e'; *op++ = 's'; }
            else { *op++ = 'N'; *op++ = 'o'; }
            *op++ = '\n';
        }
    }
    d->out_size = (u64)(op - d->out);
    __asm__ volatile("mov $60,%%eax; xor %%edi,%%edi; syscall" ::: "rax", "rdi", "memory");
    __builtin_unreachable();
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #15.5 us8 KBWrong AnswerScore: 0

Testcase #23.72 us8 KBWrong AnswerScore: 0

Testcase #33.36 us8 KBWrong AnswerScore: 0

Testcase #43.34 us8 KBWrong AnswerScore: 0

Testcase #53.62 us8 KBWrong AnswerScore: 0

Testcase #63.84 us8 KBWrong AnswerScore: 0

Testcase #73.89 us8 KBWrong AnswerScore: 0

Testcase #84.13 us8 KBWrong AnswerScore: 0

Testcase #93.78 us8 KBWrong AnswerScore: 0

Testcase #103.57 us8 KBWrong AnswerScore: 0


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