Skip to content

Instantly share code, notes, and snippets.

View YinLunDu's full-sized avatar

haruuu YinLunDu

  • Kaohsiung, Taiwan
View GitHub Profile
#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;