This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdbool.h> | |
#include <string.h> | |
int pos[1000], a[1000], sz = 0; | |
int lc(int id) { return 2 * id + 1; } | |
int rc(int id) { return 2 * id + 2; } | |
int par(int id) { return (id - 1) / 2; } | |
void swap(int *x, int *y) { | |
int tmp = *x; |