提交记录 1540


用户 题目 状态 得分 用时 内存 语言 代码长度
saffah 1001. 测测你的排序 Accepted 100 2.579 s 781772 KB C 445 B
提交时间 评测时间
2018-06-20 21:22:18 2020-07-31 20:51:51
// #1322

void sort(unsigned *a, int n)
{
	static unsigned b[100000005], c[0x20000];
	unsigned *c1 = c, *c2 = c1 + 0x10000;
	
	for (int i = 0; i != n; ++i)
		++c1[a[i] & 0xFFFF], ++c2[a[i] >> 16];
	for (int i = 1; i != 0x10000; ++i)
		c1[i] += c1[i - 1];
	for (int i = 1; i != 0x10000; ++i)
		c2[i] += c2[i - 1];
	for (int i = n - 1; i >= 0; --i)
		b[--c1[a[i] & 0xFFFF]] = a[i];
	for (int i = n - 1; i >= 0; --i)
		a[--c2[b[i] >> 16]] = b[i];
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #12.579 s763 MB + 460 KBAcceptedScore: 100


Judge Duck Online | 评测鸭在线
Server Time: 2024-11-23 23:49:46 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠