提交记录 22353
提交时间 |
评测时间 |
2024-08-18 13:55:37 |
2024-08-18 13:55:46 |
#include<chrono>
#include<random>
using namespace std;
unsigned*aa;
#define uint unsigned
mt19937 gen(chrono::steady_clock::now().time_since_epoch().count());
void _sort(int l,int r){
if(l>r)return;
uint p=aa[l+gen()%(r-l+1)];
int i=l-1,j=r+1;
#define isL(x) (x<l?true:(x>r?false:aa[x]<=p))
while(1){
while(i<=j&&isL(i))i++;
while(i<=j&&!isL(j))j--;
if(i<j){
swap(aa[i],aa[j]);
}else{
break;
}
}
while(j>=l&&aa[j]==p)j--;
while(i<=r&&aa[i]==p)i++;
_sort(l,j);
_sort(i,r);
}
void sort(unsigned*a,int n){
aa=a;
_sort(0,n-1);
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 5 s | 381 MB + 496 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2025-07-13 10:00:50 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠