提交记录 15180


用户 题目 状态 得分 用时 内存 语言 代码长度
fstqwq 1001a. 测测你的排序2 Accepted 100 739.58 us 48 KB C++11 313 B
提交时间 评测时间
2020-12-09 18:56:36 2020-12-09 18:56:38
#include <algorithm>

void sort(unsigned *a, int n) {
	if (n <= 1) return;
  	const int pivot = a[rand() % n];
	int i = 0, j = 0, k = n;
	while (i < k) {
		if (a[i] < pivot)
			std::swap(a[i++], a[j++]);
    	else if (pivot < a[i])
			std::swap(a[i], a[--k]);
		else
			i++;
	}
	sort(a, j);
	sort(a + k, n - k);
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #1739.58 us48 KBAcceptedScore: 100


Judge Duck Online | 评测鸭在线
Server Time: 2026-03-21 06:09:43 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠