摘要: 静态建树判一下1-n是不是为空就好了,如果有空的 就说明不是complete binary tree (和线段树建树差不多啊)Left=2*root;Right=2*root+1 #include using namespace std;typedef long long LL;struc... 阅读全文
posted @ 2017-03-24 15:30 see_you_later 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 思路: 最后发现对当前列车比我大的编号的栈有没有就好了,所以开个vector存一下,然后二分一下vector找一下第一个比我大的数就好了 #include using namespace std;typedef long long LL;const int N=1e5+10;int n,a[N]... 阅读全文
posted @ 2017-03-24 14:43 see_you_later 阅读(169) 评论(0) 推荐(0) 编辑