#include <stdio.h> #include <stdbool.h> #include <string.h> #define MAX_SIZE 1000 int H[MAX_SIZE]; // 小顶堆,用于存储堆中的元素 int size = 0; // 堆的当前大小,初始为 0 // 交换两个元素 void swap(int *a, int *b) { int temp = *a; *a = *b; *b = temp; } // 插入元素 void insert(int x) { if (size ...