提交记录 21936


用户 题目 状态 得分 用时 内存 语言 代码长度
houhui 1001. 测测你的排序 Memory Limit Exceeded 0 3.475 s 1200860 KB C++ 552 B
提交时间 评测时间
2024-07-15 19:41:16 2024-07-15 19:41:23
#include <algorithm>
#include <vector>
using namespace std;

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

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

CompilationN/AN/ACompile OKScore: N/A

Testcase #13.475 s1172 MB + 732 KBMemory Limit ExceededScore: 0


Judge Duck Online | 评测鸭在线
Server Time: 2024-09-08 08:39:10 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用