提交记录 2949


用户 题目 状态 得分 用时 内存 语言 代码长度
user1 1001. 测测你的排序 Compile Error 0 0 ns 0 KB C 873 B
提交时间 评测时间
2018-07-03 17:29:48 2020-07-31 21:09:19
#define N 100000000
#define D 256
#define D1 255
unsigned *rs[D],t0[D],t1[D],t2[D],t3[D];
void sort(unsigned *a, int n) {
  asm (
    "L1: lodsl\n movzbl %%al, %%edx\n movzbl %%ah, %%edi\n incl %[t0](,%edx,4)\n incl %[t1](,%edi,4)\n"
    "shrl $16,%%eax\n  movzbl %%al, %%edx\n movzbl %%ah, %%edi\n incl %[t2](,%edx,4)\n incl %[t3](,%edi,4)\n"
    "addl $-1, %%ecx\n jne L1": :
    "S"(a),[t0]"m"(t0),[t1]"m"(t1),[t2]"m"(t2),[t3]"m"(t3),"c"(100000000):
    "memory","eax","edx","esi","edi"
  );

#define cal(w,w2,tw,op) \
p=w2-1;\
for(i=0;i<D;++i)rs[i]=p,p+=tw[i];\
for(i=0;i<N;i+=8){\
	p=w+i;\
	*++rs[p[0]op]=p[0],\
	*++rs[p[1]op]=p[1],\
	*++rs[p[2]op]=p[2],\
	*++rs[p[3]op]=p[3],\
	*++rs[p[4]op]=p[4],\
	*++rs[p[5]op]=p[5],\
	*++rs[p[6]op]=p[6],\
	*++rs[p[7]op]=p[7];\
}
unsigned b[N],*p,i,x;
cal(a,b,t0,&D1);
cal(b,a,t1,>>8&D1);
cal(a,b,t2,>>16&D1);
cal(b,a,t3,>>24);
}

CompilationN/AN/ACompile ErrorScore: N/A


Judge Duck Online | 评测鸭在线
Server Time: 2026-04-19 12:10:00 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠