提交记录 16919


用户 题目 状态 得分 用时 内存 语言 代码长度
freetreer 1001. 测测你的排序 Runtime Error 0 539.797 ms 2028116 KB C++ 492 B
提交时间 评测时间
2021-11-03 14:58:28 2021-11-03 14:58:32
#include<bits/stdc++.h>

using namespace std;

void quicksort(unsigned *a, int left, int right) {
    if (left >= right) return;

    unsigned pivot = a[(left + right + 1) / 2];
    int l = left - 1, r = right + 1;
    while (true) {
        do l++; while (a[l] < pivot);
        do r--; while (a[r] > pivot);
        if (l >= r) break;
        swap(a[l], a[r]);
    }
    quicksort(a, left, l);
    quicksort(a, l + 1, right);
}

void sort(unsigned *a, int n) {
    quicksort(a, 0, n - 1);
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #1539.797 ms1980 MB + 596 KBRuntime ErrorScore: 0


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