提交记录 27916


用户 题目 状态 得分 用时 内存 语言 代码长度
LEFt 1001b. 测测你的排序3 Accepted 100 4.699 s 1048864 KB C++ 767 B
提交时间 评测时间
2025-02-12 11:55:46 2025-02-12 11:55:56
#pragma GCC optimize(3, "Ofast", "unroll-loops", "-funroll-loops")
#include<bits/stdc++.h>
using namespace std;

using i32 = int;
using i64 = long long;
using i128 = __int128;
using u32 = unsigned int;
using u64 = unsigned long long;
using u128 = unsigned __int128;

void sort(unsigned *a, int n) {
  array<int, 65540> cnt {};
  vector<unsigned> aa(n);
  for (int i = 0; i < n; i++) {
    cnt[a[i] & 65535]++;
  }
  for (int i = 1; i < 65536; i++) {
    cnt[i] += cnt[i - 1];
  }
  for (int i = n - 1; ~i; i--) {
    aa[--cnt[a[i] & 65535]] = a[i];
  }
	cnt.fill(0);
  for (int i = 0; i < n; i++) {
    cnt[aa[i] >> 16]++;
  }
  for (int i = 1; i < 65536; i++) {
    cnt[i] += cnt[i - 1];
  }
  for (int i = n - 1; ~i; i--) {
    a[--cnt[aa[i] >> 16]] = aa[i];
  }
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #14.699 s1024 MB + 288 KBAcceptedScore: 100


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