提交记录 21939


用户 题目 状态 得分 用时 内存 语言 代码长度
houhui 1001. 测测你的排序 Time Limit Exceeded 0 5 s 838644 KB C++ 506 B
提交时间 评测时间
2024-07-15 19:48:35 2024-07-15 19:48:43
#include <algorithm>
#include <queue>
using namespace std;

const int B = 1 << 16;
queue<unsigned> cnt[B];

void sort(unsigned *a, int n) {
	--a;
	for(int i = 1; i <= n; ++i)
		cnt[a[i] & ((1 << 16) - 1)].push(a[i]);
	for(int i = 0, p = 0; i < (1 << 16); ++i) {
		while(cnt[i].size())
			a[++p] = cnt[i].front(), cnt[i].pop();
	}
	
	for(int i = 1; i <= n; ++i)
		cnt[a[i] >> 16].push(a[i]);
	for(int i = 0, p = 0; i < (1 << 16); ++i) {
		while(cnt[i].size())
			a[++p] = cnt[i].front(), cnt[i].pop();
	}
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #15 s818 MB + 1012 KBTime Limit ExceededScore: 0


Judge Duck Online | 评测鸭在线
Server Time: 2025-07-16 04:15:08 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠