提交记录 5951


用户 题目 状态 得分 用时 内存 语言 代码长度
zengminghao ch7344. 鸭子排队 Compile Error 0 0 ns 0 KB C 374 B
提交时间 评测时间
2018-09-13 18:49:59 2020-08-01 00:36:39
#include <stdio.h>
const int MAXN = 100001;
unsigned a[MAXN];
int n;
int main() {
	fread(a, 1, MAXN << 1, stdin);
	for (int o = (n = a[0]) / 2; o ; --o) {
		register int i = o, j;
		while ((j = i << 1) <= n){
			if (j + 1 <= n && a[j | 1] < a[j]) ++j;
			if (a[i] < a[j]) break;
			a[i] ^= a[j] ^= a[i] ^= a[j], i = j;
		}
	}
	fwrite(a + 1, 1, n << 1, stdout);
	return 0;
}

CompilationN/AN/ACompile ErrorScore: N/A


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