提交记录 7173


用户 题目 状态 得分 用时 内存 语言 代码长度
skip1978 ch7344. 鸭子排队 Compile Error 0 0 ns 0 KB C++ 1.07 KB
提交时间 评测时间
2019-01-02 12:57:45 2020-08-01 01:00:45

#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <functional>
typedef unsigned u32;
namespace judgeduck {
	extern char *stdin_content;
	extern int stdin_size;
	extern char *stdout_content;
	extern int stdout_size;
	extern int stdout_max_size;
}
int cnt0[256],cnt8[256],cnt16[256],cnt24[256];
void sort(u32 * a,int n)
{
	for (u32 * i = a + n;-- i >= a;){
#define seed *i
		++ cnt0[seed & 255],++ cnt8[seed >> 8 & 255],++ cnt16[seed >> 16 & 255],++ cnt24[seed >> 24 & 255];
	}
	for (int i = 1;i < 256;++ i)
		cnt0[i] += cnt0[i - 1],cnt8[i] += cnt8[i - 1],cnt16[i] += cnt16[i - 1],cnt24[i] += cnt24[i - 1];
	for (u32 * i = a + n;-- i >= a;)
		b[-- cnt0[* i & 255]] = * i;
	for (u32 * i = b + n;-- i >= b;)
		a[-- cnt8[* i >> 8 & 255]] = * i;
	for (u32 * i = a + n;-- i >= a;)
		b[-- cnt16[* i >> 16 & 255]] = * i;
	for (u32 * i = b + n;-- i >= b;)
		a[-- cnt24[* i >> 24 & 255]] = * i;
}
int main() {
	using namespace judgeduck;
	int n = *(int*)stdin_content;
	memcpy(stdout_content, stdin_content+4, stdout_size = n<<2);
        sort((unsigned*)stdout_content,n);
	return 0;
}

CompilationN/AN/ACompile ErrorScore: N/A


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