Splay
文章平均质量分 81
Hillan_
An OIer From ZJ
展开
-
BZOJ1208: [HNOI2004]宠物收养所 Splay
一开始没懂题目。。。。后来才发现这么水 #include #include #include using namespace std; char c; inline int read(int &a) { a=0;do c=getchar();while(c'9'); while(c='0')a=(a<<3)+(a<<1)+c-'0',c=getchar(); } inline i原创 2015-11-22 14:54:10 · 1136 阅读 · 0 评论 -
BZOJ2049: [Sdoi2008]Cave 洞穴勘测
动态树 LCT 过得 由于是无根树我们需要换根,换根时打个标记表示需要旋转然后就好了原创 2015-11-24 18:53:37 · 511 阅读 · 0 评论 -
BZOJ 1500: [NOI2005]维修数列
我的AC率啊 QAQ 一开始看到陈老师300行左右的代码我就淡淡的说了句怎么打的这么多 然后我就打了450行。。。。。 调试了三天 重写了两边 果然是毒瘤Splay。。。。 提取区间打标记 下传标记就好了么。。还是蛮裸的 果然还是自己太弱了#include #include #include #include using namespace std; #define ll int #d原创 2015-12-08 17:52:55 · 511 阅读 · 0 评论 -
bzoj4336: BJOI2015 骑士的旅行
各种状况。。。。考试的时候老师给了我们这一道题然后画了一个上午来码 调了一天后来发现是平衡树的rank打错了。。。。 还是那句话人傻没办法 这一题和CTSC那一题很像 我是直接暴力树链剖分+线段树套spaly。。。 然后发现时间垫底。。。。。#include #include #include #include #include using namespace std;原创 2016-01-10 18:45:32 · 1007 阅读 · 1 评论 -
BZOJ3323: [Scoi2013]多项式的运算
很水的一道Splay维护题 好吧我其实被卡的很惨。。。 常数大的要死 注意一下放标的顺序与时机这样可以大大减小常数 #include #include #include #include using namespace std; char c; #define ll long long inline void read(ll &a) { a=0;do c=getchar();while(原创 2016-02-05 14:40:57 · 769 阅读 · 0 评论 -
BZOJ1901: Zju2112 Dynamic Rankings
第一次外层套权值线段树每次用splay提取区间然后在线段树上二分即可一开始想打替罪羊 后来。。差点砸电脑 还是splay好写#include<cstdio> #include<algorithm> #include<iostream> #include<cstring> #include<map> using namespace std;struct Node { Node *lc,*r原创 2016-03-18 21:23:25 · 386 阅读 · 0 评论 -
BZOJ3729: Gty的游戏
用splay维护DFS序混着脑袋打了一发 调试了一天没搞出来 重打就好了。。。 然后本地跑得起来OJ上RE炸了。。 然后发现是maker打错了#include<cstdio> #include<iostream> #include<cstring> #include<map> using namespace std; char c; inline void read(int&a) {原创 2016-03-14 13:08:04 · 678 阅读 · 0 评论