提交记录 16925


用户 题目 状态 得分 用时 内存 语言 代码长度
freetreer 1001a. 测测你的排序2 Accepted 100 626.62 us 72 KB C++ 493 B
提交时间 评测时间
2021-11-03 15:10:10 2021-11-03 15:10:13
#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) >> 1];
    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 - 1);
    quicksort(a, l, right);
}

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

CompilationN/AN/ACompile OKScore: N/A

Testcase #1626.62 us72 KBAcceptedScore: 100


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