摘要: 解法:splay显而易见 除了REVOLVE操作,其它的都是splay的常规操作。 REVOLVE操作可以用三次翻转操作来实现。。。如果要实现区间[a,b][b+1,c]的交换,可以依次翻转[a,b],[b+1,c],[a,b]。。。。p.s.换了下splay的代码风格。。瞬间感觉清新明快不少。。。。 1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 using namespace std; 5 const int N = (int)1e6+10; 6 const int inf=~ 阅读全文
posted @ 2013-04-18 20:59 silver__bullet 阅读(669) 评论(0) 推荐(0) 编辑