POJ 3580 SuperMemo (FHQ_Treap)】的更多相关文章

题意:让你维护一个序列,支持以下6种操作: ADD x y d: 第x个数到第y个数加d . REVERSE x y : 将区间[x,y]中的数翻转 . REVOLVE x y t :将区间[x,y]循环移位t次,如1 2 3 4 5 旋转2次后就变成4 5 1 2 3 . INSERT x p :在第x个数后面插入p . DELETE x :删除第x个数 . MIN x y : 查询区间[x,y]中的最小值 .思路:此题有反转区间和循环移位的操作,所以我们很容易可以想到用 splay FHQ_…
题目连接 http://poj.org/problem?id=3580 SuperMemo Description Your friend, Jackson is invited to a TV show called SuperMemo in which the participant is told to play a memorizing game. At first, the host tells the participant a sequence of numbers, {A1, A…
题目链接:http://poj.org/problem?id=3580 Your friend, Jackson is invited to a TV show called SuperMemo in which the participant is told to play a memorizing game. At first, the host tells the participant a sequence of numbers, {A1, A2, ... An}. Then the h…
SuperMemo         Description Your friend, Jackson is invited to a TV show called SuperMemo in which the participant is told to play a memorizing game. At first, the host tells the participant a sequence of numbers, {A1, A2, ... An}. Then the host pe…
SuperMemo Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 6841   Accepted: 2268 Case Time Limit: 2000MS Description Your friend, Jackson is invited to a TV show called SuperMemo in which the participant is told to play a memorizing game.…
相应POJ题目:点击打开链接 SuperMemo Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 11309   Accepted: 3545 Case Time Limit: 2000MS Description Your friend, Jackson is invited to a TV show called SuperMemo in which the participant is told to play a…
题意: 维护一个序列,支持如下几种操作: ADD x y D:将区间\([x,y]\)的数加上\(D\) REVERSE x y:翻转区间\([x,y]\) REVOLVE x y T:将区间\([x,y]\)向右循环平移\(T\)个长度 INSERT x P:在第\(x\)个元素后插入\(P\) DELETE x:删除第\(x\)个元素 QUERY x y:查询区间\([x,y]\)中的最小值 分析: ADD和REVERSE操作维护两个懒惰标记即可 REVOLVE操作本质还是CUT一段区间下来…
http://poj.org/problem?id=3580 题意:有6种操作,其中有两种之前没做过,就是Revolve操作和Min操作.Revolve一开始想着一个一个删一个一个插,觉得太暴力了,后来发现可以把要放到前面的一段切开,丢到前面去,就和上一题的Cut是一样的了.还有Min操作,一开始特别ZZ地想着只要找keytree的最左边就好了,然后发现并不是那样的,要维护一个 mi 值,一开始两个节点设成 INF,然后 pushup 的时候先把 val 赋给 mi,然后再和左右儿子对比.WA了…
题意 给定$n$个数,$m$个询问,每次在$[L,R]$区间加上一个数,或者反转一个区间$[L,R]$,或者循环右移区间$[L,R]$共$T$次,或者在第$x$个数后插入一个数$p$,或者删除第$x$个数,或者查询区间$L,R$的最小值 Splay模板题 对于区间操作,利用splay提取区间后打懒标记更新,单点操作看作是对$[L,L+1]$区间的操作 时间复杂度$O(m \log n)$ 代码 #include <cstdio> #include <iostream> #inclu…
[题目链接] 点击打开链接 [算法] 本题也是Splay区间操作的模板题,不过要比BZOJ 3223要稍微复杂一些,做完此题后,我终于对Splay有了更深入的理解,有“拨开云雾见青天”的感觉 本题还是有许多细节的,笔者花了5h才通过了此题 [代码] #include <algorithm> #include <bitset> #include <cctype> #include <cerrno> #include <clocale> #inclu…