摘要:
$30$分水题~。 检查所有节点(除了根节点)和它的父节点的关系,判断是否破坏最大堆或者最小堆的性质。 const int N=1010; int heap[N]; bool maxheap,minheap; int n; void dfs(int u,vector<int> &post) { if 阅读全文
摘要:
如果查找了 TSize 次,每次查找的位置上均有数,但都不等于要查找的数,则认为查找时间是 TSize+1。 const int N=1e4+10; int Tsize,n,m; int h[N]; int cnt; bool isprime(int x) { if(x < 2) return fa 阅读全文