提交记录 19360


用户 题目 状态 得分 用时 内存 语言 代码长度
j58bzaiR 1001c. 测测你的排序4 Accepted 100 16.243 s 1048608 KB C++14 784 B
提交时间 评测时间
2023-04-23 16:13:03 2023-04-23 16:13:25
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#define FOR(i,j,k) for(int i=j; i<=k; ++i)
#define ROF(i,j,k) for(int i=j; i>=k; --i)
#define ud unsigned
ud b[134217728], c[256];
const int g = 255;
void sort (ud *a, int n) {
  std::iota (b, b+n, 0);
  std::fill (c, c+g+1, 0);
  FOR(i,0,n-1) ++ c[a[i]&g];
  FOR(i,1,g) c[i] += c[i-1];
  ROF(i,n-1,0) b[-- c[a[i]&g]] = a[i];
  std::fill (c, c+g+1, 0);
  FOR(i,0,n-1) ++ c[b[i]>>8&g];
  FOR(i,1,g) c[i] += c[i-1];
  ROF(i,n-1,0) a[-- c[b[i]>>8&g]] = b[i];
  std::fill (c, c+g+1, 0);
  FOR(i,0,n-1) ++ c[a[i]>>16&g];
  FOR(i,1,g) c[i] += c[i-1];
  ROF(i,n-1,0) b[-- c[a[i]>>16&g]] = a[i];
  std::fill (c, c+g+1, 0);
  FOR(i,0,n-1) ++ c[b[i]>>24&g];
  FOR(i,1,g) c[i] += c[i-1];
  ROF(i,n-1,0) a[-- c[b[i]>>24&g]] = b[i];
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #116.243 s1024 MB + 32 KBAcceptedScore: 100


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