摘要:
其实就是找一个最小的level k使得level 1到k的ant数量和不小于rank。树状数组: 1 #include 2 #include 3 #include 4 using namespace std; 5 6 const int N = 100001; 7 int a[N]; 8 i... 阅读全文
posted @ 2015-08-18 20:07
hxy_has_been_used
阅读(113)
评论(0)
推荐(0)
摘要:
优雅的树状数组!人们发明了复杂度为logn的求解第k小的方法,常数小且代码量小,实在是用来求解本类题目的最佳方法,可惜的是我的Treap超时了......树状数组: 1 #include 2 #include 3 #include 4 using namespace std; 5 6 con... 阅读全文
posted @ 2015-08-18 19:36
hxy_has_been_used
阅读(141)
评论(0)
推荐(0)