摘要:
嗯,我练习了下二叉堆,代码写得挺长的,其实题目比较简单,就是贪心就行…… 嗯,上代码吧:#include <math.h>#include <stdio.h>#include <stdlib.h>#define left(i) (((i) << 1) + 1)#define right(i) (((i) << 1) + 2)#define parent(i) (((i) - 1) >> 1)struct node{ int x, y, v;}heap[400];int end;int n, m;void insert(in 阅读全文