提交记录 11799


用户 题目 状态 得分 用时 内存 语言 代码长度
AwD 1001. 测测你的排序 Wrong Answer 0 1.161 s 390636 KB C++ 2.30 KB
提交时间 评测时间
2020-02-14 19:17:09 2020-08-01 02:48:00
#include <algorithm>

#define U unsigned int
#define UL unsigned long long
#define LOG2(x) ((U)(8 * sizeof (UL) - __builtin_clzll((x)) - 1))
UL mapping_sqrt(UL x)
{
static const unsigned char T[] = {
      0,  16,  23,  28,  32,  36,  39,  43,  46,  48,  51,  53,  56,  58,  60,  62,
     64,  66,  68,  70,  72,  74,  75,  77,  79,  80,  82,  83,  85,  86,  88,  89,
     91,  92,  94,  95,  96,  98,  99, 100, 101, 103, 104, 105, 106, 108, 109, 110,
    111, 112, 113, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
    128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
    143, 144, 145, 146, 147, 148, 149, 150, 150, 151, 152, 153, 154, 155, 155, 156,
    157, 158, 159, 159, 160, 161, 162, 163, 163, 164, 165, 166, 167, 167, 168, 169,
    170, 170, 171, 172, 173, 173, 174, 175, 176, 176, 177, 178, 178, 179, 180, 181,
    181, 182, 183, 183, 184, 185, 186, 186, 187, 188, 188, 189, 190, 190, 191, 192,
    192, 193, 194, 194, 195, 196, 196, 197, 198, 198, 199, 199, 200, 201, 201, 202,
    203, 203, 204, 205, 205, 206, 206, 207, 208, 208, 209, 210, 210, 211, 211, 212,
    213, 213, 214, 214, 215, 216, 216, 217, 217, 218, 219, 219, 220, 220, 221, 221,
    222, 223, 223, 224, 224, 225, 225, 226, 227, 227, 228, 228, 229, 229, 230, 230,
    231, 232, 232, 233, 233, 234, 234, 235, 235, 236, 237, 237, 238, 238, 239, 239,
    240, 240, 241, 241, 242, 242, 243, 243, 244, 245, 245, 246, 246, 247, 247, 248,
    248, 249, 249, 250, 250, 251, 251, 252, 252, 253, 253, 254, 254, 255, 255, 255};
    unsigned int r;
    if      (x < 0x10000)
     if     (x <  0x400- 3) r = T[(x+ 3)>>2] >> 3;
     else if(x < 0x4000-28) r = T[(x+28)>>6] >> 1;
     else                   r = T[ x    >>8];
    else
     if  (x <  0x1000000)
      if (x <   0x100000) { r = T[x>>12]; r = ((x/r)>>3) + (r<<1); }
      else                { r = T[x>>16]; r = ((x/r)>>5) + (r<<3); }
     else
      if (x < 0x10000000)
       if(x <  0x4000000) { r = T[x>>18]; r = ((x/r)>>6) + (r<<4); }
       else               { r = T[x>>20]; r = ((x/r)>>7) + (r<<5); }
      else
       if(x < 0x40000000) { r = T[x>>22]; r = ((x/r)>>8) + (r<<6); }
       else               { r = T[x>>24]; r = ((x/r)>>9) + (r<<7); }
    return r - (r*r > x);
}
void sort(unsigned *a, int n) {
	for (int i = 0; i < n; ++ i) a[i] = mapping_sqrt(a[i]);

}

CompilationN/AN/ACompile OKScore: N/A

Testcase #11.161 s381 MB + 492 KBWrong AnswerScore: 0


Judge Duck Online | 评测鸭在线
Server Time: 2026-03-27 03:14:08 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠