提交记录 13162


用户 题目 状态 得分 用时 内存 语言 代码长度
panyf 1001a. 测测你的排序2 Runtime Error 0 5.59 ms 49184 KB C++ 426 B
提交时间 评测时间
2020-07-27 11:19:32 2020-08-01 03:05:27
#include <bits/stdc++.h>
using namespace std;
vector<int>v[1048579],w[1048579];
void sort(unsigned *a, int n) {
	int i,j=-1,k;
	vector<int>::iterator it;
	for(i=0;i<n;++i){
		k=a[i]>>12,it=lower_bound(v[k].begin(),v[k].end(),a[i]);
		if((*it)==a[i])++w[k][it-v[k].begin()];
		else v[k].insert(it,a[i]);
	}
	for(i=0;i<1048576;++i){
		it=w[i].begin();
		for(auto o:v[i]){
			for(k=a[++j]=*it;k>=0;--k)a[++j]=o;
			++it;
		}
	}
}

CompilationN/AN/ACompile OKScore: N/A

Testcase #15.59 ms48 MB + 32 KBRuntime ErrorScore: 0


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