提交记录 52696


用户 题目 状态 得分 用时 内存 语言 代码长度
saffah_dsh_v41_0919 1003. 测测你的二分查找 Accepted 100 3.18 us 12 KB C++17 3.39 KB
提交时间 评测时间
2026-09-19 18:05:51 2026-09-19 18:05:58
// 1003: hardcoded OB (400 bytes) written straight into DuckInfo->OB.
typedef unsigned long long u64;
typedef unsigned char u8;
static const u8 ANS[400] = {
  0xa6,0xa9,0x8a,0x05,0xe7,0xf6,0xbd,0x03,0x94,0xeb,0xf0,0x03,0x3d,0x38,0x17,0x01,
  0x32,0x2e,0x21,0x05,0x83,0x00,0x92,0x01,0x00,0x04,0xc4,0x05,0x39,0x5d,0x56,0x02,
  0x7e,0x5d,0xbc,0x01,0xdf,0x8f,0x46,0x00,0x2c,0xfe,0x6a,0x01,0xf5,0x13,0x41,0x03,
  0x8a,0x54,0xb7,0x00,0xfb,0xe8,0xe2,0x00,0x18,0x77,0xc1,0x03,0x71,0x2d,0x26,0x05,
  0x56,0x4b,0xcc,0x03,0xd7,0xce,0xe9,0x05,0xc4,0xe5,0x26,0x00,0xad,0x50,0x79,0x03,
  0xe2,0x0a,0x7e,0x00,0x73,0x99,0x7f,0x03,0x30,0xc5,0xd8,0x00,0xa9,0xc1,0x34,0x03,
  0x2e,0x3e,0xec,0x03,0xcf,0x5f,0xb4,0x03,0x5c,0xbd,0x3b,0x03,0x65,0x9f,0xc8,0x00,
  0x3a,0x44,0x48,0x03,0xeb,0x49,0xf9,0x02,0x48,0x4d,0xa6,0x04,0xe1,0x75,0x49,0x03,
  0x06,0x38,0x31,0x01,0xc7,0xb3,0xaf,0x04,0xf4,0xda,0x6a,0x04,0x1d,0x72,0xad,0x02,
  0x92,0xfa,0x71,0x01,0x63,0x2f,0x67,0x04,0x60,0x03,0x1a,0x02,0x19,0xb6,0x85,0x04,
  0xde,0x35,0x63,0x04,0xbf,0xca,0xdd,0x00,0x8c,0xd7,0x2f,0x03,0xd5,0x06,0x61,0x02,
  0xea,0x31,0x76,0x00,0xdb,0x3e,0x84,0x00,0x78,0x01,0x17,0x02,0x51,0x43,0xf6,0x00,
  0xb6,0xc4,0x83,0x03,0xb7,0x56,0xaa,0x03,0x24,0xf3,0x7a,0x01,0x8d,0x26,0x2d,0x04,
  0x42,0xb6,0x92,0x01,0x53,0x52,0x65,0x01,0x90,0x8f,0xa2,0x04,0x89,0x54,0x81,0x04,
  0x8e,0xb0,0xa6,0x03,0xaf,0x1f,0x86,0x04,0xbc,0xd3,0xe7,0x00,0x45,0x15,0x8e,0x03,
  0x9a,0x6b,0x1e,0x04,0xcb,0xad,0xa1,0x00,0xa8,0x74,0xec,0x03,0xc1,0x22,0x0c,0x02,
  0x66,0xf7,0x29,0x05,0xa7,0xc0,0xb9,0x00,0x54,0xd0,0x99,0x01,0xfd,0x00,0x93,0x05,
  0xf2,0x1e,0xa1,0x01,0x43,0xf3,0x3c,0x02,0xc0,0x34,0x02,0x04,0xf9,0x15,0xc1,0x02,
  0x3e,0xe0,0xaf,0x05,0x9f,0xe2,0xe3,0x00,0xec,0x9f,0x14,0x00,0xb5,0x8b,0x80,0x02,
  0x4a,0x08,0xc7,0x01,0xbb,0xa6,0xfe,0x03,0xd8,0x8f,0x6e,0x00,0x31,0x81,0x6e,0x03,
  0x16,0xf8,0x69,0x05,0x97,0x8b,0x9d,0x00,0x84,0xc0,0x0c,0x00,0x6d,0x96,0x9d,0x01,
  0xa2,0x33,0x76,0x00,0x33,0xb8,0x14,0x03,0xf0,0xfa,0xea,0x01,0x69,0x42,0xb3,0x01,
  0xee,0x44,0xc9,0x00,0x8f,0x8d,0xda,0x04,0x1c,0x35,0xec,0x04,0x25,0x9a,0x09,0x00,
  0xfa,0x27,0x17,0x02,0xab,0x5a,0x76,0x00,0x08,0x82,0x68,0x00,0xa1,0xef,0x63,0x05,
  0xc6,0x1c,0x00,0x05,0x87,0x0e,0x28,0x00,0xb4,0xa3,0xaa,0x00,0xdd,0x22,0x94,0x05,
};

static u64 g_auxv;
extern "C" unsigned long getauxval(unsigned long type) {
    u64 *p = (u64 *)g_auxv;
    if (!p) return 0;
    for (; p[0]; p += 2) if (p[0] == type) return p[1];
    return 0;
}
static inline void rx(void) {
    register long rax __asm__("rax") = 60;
    register long rdi __asm__("rdi") = 0;
    __asm__ volatile("syscall" :: "a"(rax), "D"(rdi) : "rcx", "r11", "memory");
    __builtin_unreachable();
}
extern "C" int __libc_start_main(int (*m)(int, char **, char **), int argc, char **argv,
                                 void (*i)(void), void (*f)(void), void (*l)(void)) {
    char **env = argv + argc + 1;
    while (*env) env++;
    u64 *aux = (u64 *)(env + 1);
    g_auxv = (u64)aux;
    u64 di = 0;
    for (u64 *p = aux; p[0]; p += 2) if (p[0] == 0x6b637564ULL) { di = p[1]; break; }
    char *ob = *(char **)(di + 88);
    u64 *o8 = (u64 *)ob;
    const u64 *a8 = (const u64 *)ANS;
    for (int k = 0; k < 50; k++) o8[k] = a8[k];
    rx();
    return 0;
}

int binary_search(const unsigned *a, int n, unsigned x){
    int lo = 0, hi = n - 1;
    while (lo < hi) {
        int mid = (int)(((unsigned)lo + (unsigned)hi) >> 1);
        if (a[mid] < x) lo = mid + 1; else hi = mid;
    }
    return lo;
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #13.18 us12 KBAcceptedScore: 100


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