提交记录 5508
| 提交时间 |
评测时间 |
| 2018-08-28 16:55:11 |
2020-08-01 00:18:17 |
#include <stdio.h>
#include <algorithm>
#define MAXN 100001
unsigned a[MAXN];
int Min(int x,int y){
return x<y? x: y;
}
int main() {
fread(a, 1, MAXN * 4, stdin);
int n = a[0];
// Rearrange the ducks a[1] .. a[n] here
for (int i=17;i>=0;--i){
int m=(1<<i)-1;
if (m>=n) continue;
nth_element(a+1,a+m,a+Min(n+1,1<<i+1));
}
fwrite(a + 1, 1, n * 4, stdout);
return 0;
}
| Compilation | N/A | N/A | Compile Error | Score: N/A | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-04-13 18:03:18 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠