
数据结构
文章平均质量分 89
akxxsb
写写博客装装逼,存代码
展开
-
Sort It (树状数组+dp)
主页讨论版问题名次状态统计请参赛队员将NickName修改为以下格式:队员1_队员2_队员3问题 F: Sort It时间限制: 6 Sec 内存限制: 128 MB提交: 30 解决: 8[提交][状态][讨论版]题目描述You are given a permutation of length n:p1,p2,原创 2016-02-19 13:56:18 · 825 阅读 · 0 评论 -
线段树复习
#1080 : 更为复杂的买卖房屋姿势时间限制:10000ms单点时限:1000ms内存限制:256MB描述小Hi和小Ho都是游戏迷,“模拟都市”是他们非常喜欢的一个游戏,在这个游戏里面他们可以化身上帝模式,买卖房产。在这个游戏里,会不断的发生如下两种事件:一种是房屋自发的涨价或者降价,而另一种是政府有关部门针对房价的硬性调控。房价的原创 2014-12-14 21:35:08 · 881 阅读 · 0 评论 -
HDU 3333 树状数组离线
GTime Limit:3000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit Status Practice HDU 3333DescriptionAfter inventing Turing Tree, 3xian always felt boring when原创 2014-12-07 02:07:05 · 751 阅读 · 0 评论 -
SPOJ 3267. D-query (主席树or树状数组离线)
A - D-queryTime Limit:1500MS Memory Limit:0KB 64bit IO Format:%lld & %lluSubmit Status Practice SPOJ DQUERYAppoint description: System Crawler (2014-12-06)Description原创 2014-12-07 01:47:50 · 1836 阅读 · 0 评论 -
数据结构实验:栈实现计算器(表达式计算)
原创作品转载请注明出处欢迎抄袭,造福各位伸手党/************************************************************************* > File Name: evaluator.cpp > Author: acvcla > version 1.01 > QQ:acvcla@gmail.com原创 2014-12-04 22:36:25 · 8045 阅读 · 0 评论 -
NEUOJ 1117: Ready to declare(单调队列)
1117: Ready to declare时间限制: 1 Sec 内存限制: 128 MB提交: 358 解决: 41[提交][状态][讨论版]题目描述Finally, you find the most good-looking girl...You are going to write a letter to her. But you are not原创 2014-12-21 01:36:53 · 1497 阅读 · 0 评论 -
UVA 11922 Splay区间翻转+分裂+合并
- Permutation TransformerTime Limit:2000MS Memory Limit:0KB 64bit IO Format:%lld & %lluSubmit Status Practice UVA 11922Appoint description: System Crawler (2014-11-30)De原创 2014-12-01 23:53:43 · 1759 阅读 · 0 评论 -
HDU 1890 Splay区间翻转
D - Robotic SortTime Limit:2000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit Status Practice HDU 1890Appoint description: System Crawler (2014-11-27)Descri原创 2014-12-01 23:38:55 · 1250 阅读 · 0 评论 -
POJ 2762判断单联通(强连通缩点+拓扑排序)
Going from u to v or from v to u?Time Limit: 2000MS Memory Limit: 65536KTotal Submissions: 14789 Accepted: 3915DescriptionIn order to make their sons brave, Jiaji原创 2014-12-17 01:40:21 · 1741 阅读 · 0 评论 -
POJ 3580 Splay
G - SuperMemoTime Limit:5000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit Status Practice POJ 3580Appoint description: System Crawler (2014-11-27)Descripti原创 2014-12-01 23:49:24 · 1299 阅读 · 0 评论 -
ZOJ 3765 splay
B - LightsTime Limit:8000MS Memory Limit:131072KB 64bit IO Format:%lld & %lluSubmit StatusDescriptionNow you have N lights in a line. Don't worry - the lights don't have co原创 2014-12-01 23:25:21 · 1170 阅读 · 0 评论 -
HDU3487(splay区间翻转+区间切割)
F - Play with ChainTime Limit:2000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionYaoYao is fond of playing his chains. He has a chain containi原创 2014-11-24 01:31:57 · 2434 阅读 · 0 评论 -
二叉树重构
给你一颗真二叉树(节点要么没有孩子,要么有两个孩子)的前序和后序遍历输出中序遍历序列。/************************************************************************* > File Name: Euler.cpp > Author: acvcla > QQ: > Mail: acvcl原创 2014-11-05 16:55:39 · 1507 阅读 · 0 评论 -
离线LCA学习
题目1 : 最近公共祖先·二时间限制:10000ms单点时限:1000ms内存限制:256MB描述上上回说到,小Hi和小Ho用非常拙劣——或者说粗糙的手段山寨出了一个神奇的网站,这个网站可以计算出某两个人的所有共同祖先中辈分最低的一个是谁。远在美国的他们利用了一些奇妙的技术获得了国内许多人的相关信息,并且搭建了一个小小的网站来应付来自四面原创 2014-10-17 22:50:50 · 1285 阅读 · 0 评论 -
hdu1151 poj1422 最小路径覆盖.最大二分匹配
Air RaidTime Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64uSubmitStatusPracticePOJ 1422Appoint description:DescriptionConsider a town where all the streets a原创 2014-10-14 21:33:55 · 984 阅读 · 0 评论 -
Codeforces Round #301 (Div. 2)E(树状数组+离散化)
E. Infinite Inversionstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere is an infinite sequence consis原创 2015-05-04 01:03:09 · 1321 阅读 · 0 评论 -
hdu5592 线段树
链接http://acm.hdu.edu.cn/showproblem.php?pid=5592ZYB's Premutation Accepts: 218 Submissions: 983 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Ot原创 2015-12-06 00:58:41 · 759 阅读 · 0 评论 -
poj 1733带权并查集
L - Parity gameTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit StatusDescriptionNow and then you play the following game with your friend. Your f原创 2014-09-02 18:49:53 · 837 阅读 · 0 评论 -
SPOJ Query on a tree (树链剖分)
Query on a treeTime Limit: 5000msMemory Limit: 262144KBThis problem will be judged on SPOJ. Original ID: QTREE64-bit integer IO format: %lld Java class name: MainPrev Submit S原创 2015-09-17 00:34:31 · 863 阅读 · 3 评论 -
Codeforces Beta Round #17 E. Palisection(回文树)
E. Palisectiontime limit per test2 secondsmemory limit per test128 megabytesinputstandard inputoutputstandard outputIn an English class Nick had nothing to do a原创 2015-09-13 14:26:00 · 929 阅读 · 0 评论 -
BZOJ2565 最长双回文串(回文树)
HYSBZ - 2565最长双回文串Time Limit: 10000MS Memory Limit: 131072KB 64bit IO Format: %lld & %lluSubmit StatusDescription顺序和逆序读起来完全一样的串叫做回文串。比如acbca是回文串,而abc不是(abc的原创 2015-09-12 15:19:27 · 980 阅读 · 0 评论 -
BZOJ2160 拉拉队排练(回文树)
HYSBZ - 2160拉拉队排练Time Limit: 10000MS Memory Limit: 265216KB 64bit IO Format: %lld & %lluSubmit StatusDescription艾利斯顿商学院篮球队要参加一年一度的市篮球比赛了。拉拉队是篮球比赛的一个看点原创 2015-09-12 19:17:05 · 772 阅读 · 0 评论 -
回文树
转自http://blog.youkuaiyun.com/u013368721/article/details/42100363今天我们来学习一个神奇的数据结构:Palindromic Tree。中译过来就是——回文树。那么这个回文树有何功能?假设我们有一个串S,S下标从0开始,则回文树能做到如下几点:1.求串S前缀0~i内本质不同回文串的个数(两个串长度不同或转载 2015-09-12 15:10:22 · 782 阅读 · 0 评论 -
UVA11990 ``Dynamic'' Inversion (树状数组套平衡树)
``Dynamic'' InversionTime Limit: 3000msMemory Limit: 131072KBThis problem will be judged on UVA. Original ID: 1199064-bit integer IO format: %lld Java class name: MainPrev Sub原创 2015-08-24 15:19:15 · 1441 阅读 · 0 评论 -
HDU 5274(树链剖分)
树链剖分第一题QAQ,纪念下#pragma comment(linker, "/STACK:102400000,102400000")#include #include #include using namespace std;typedef long long ll;const ll mod = 1e9 + 7;const int maxn = 1e5 + 10;#d原创 2015-06-23 22:53:27 · 810 阅读 · 0 评论 -
HDU 5274(LCA + 线段树)
Dylans loves treeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 747 Accepted Submission(s): 144Problem DescriptionDylans i原创 2015-06-23 17:37:40 · 1100 阅读 · 0 评论 -
HdU5266(LCA + 线段树)
pog loves szh III Accepts: 63 Submissions: 483 Time Limit: 12000/6000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)问题描述pog在与szh玩游戏,首先pog在纸上画了一棵有根树,这里我们定义1为这原创 2015-06-22 01:44:25 · 1561 阅读 · 0 评论 -
hdu 5249区间第k大(学习了下树状数组的搞法)
KPITime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 205 Accepted Submission(s): 70Problem Description你工作以后, KPI 就是你的全部了. 我开发了一原创 2015-05-30 23:48:04 · 1345 阅读 · 0 评论 -
Codeforces Round #305 (Div. 1) B. Mike and Feet(单调栈)
B. Mike and Feettime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMike is the president of country What-The-F原创 2015-05-31 01:40:25 · 1596 阅读 · 0 评论 -
小Z的袜子(莫队算法)
A - 小Z的袜子(hose)Time Limit:20000MS Memory Limit:265216KB 64bit IO Format:%lld & %lluSubmit Status Practice HYSBZ 2038Description作为一个生活散漫的人,小Z每天早上都要耗费很久从一堆五颜六色的袜子中找出一双来穿。原创 2015-05-07 21:36:55 · 3427 阅读 · 0 评论 -
POJ 2828 线段树单点更新 离线搞
DescriptionRailway tickets were difficult to buy around the Lunar New Year in China, so we must get up early and join a long queue…The Lunar New Year was approaching, but unluckily the Little原创 2014-10-04 23:07:00 · 1094 阅读 · 0 评论 -
POJ 3380 最大流
L -ParatroopersTime Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmitStatusPracticePOJ 3308Appoint description:DescriptionIt is year 2500 A.D. and t原创 2014-10-15 00:29:22 · 1305 阅读 · 0 评论 -
POJ 2528 QAQ线段树+离散化
Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmitStatusDescriptionThe citizens of Bytetown, AB, could not stand that the candidates in the mayoral election cam原创 2014-10-04 17:31:04 · 1017 阅读 · 0 评论 -
UVA 112(二叉树、DFS)
I - Tree SummingCrawling failedSubmit StatusAppoint description: System Crawler (2014-05-29)Description Tree Summing BackgroundLISP was one of the原创 2014-05-29 17:50:04 · 918 阅读 · 0 评论 -
UVA 548(二叉树重建与遍历)
J - TreeTime Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %lluSubmit StatusAppoint description: System Crawler (2014-05-16)Description Tree原创 2014-05-29 17:54:22 · 1727 阅读 · 3 评论 -
UVA 297 Quadtrees(四叉树建树、合并与遍历)
K - QuadtreesTime Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %lluSubmit StatusAppoint description: System Crawler (2014-01-02)Description Quadt原创 2014-05-29 18:05:21 · 1947 阅读 · 0 评论 -
UVA 540(队列)
Description Team Queue Queues and Priority Queues are data structures which are known to most computer scientists. The Team Queue, however, is not so well known, though原创 2014-05-29 17:45:18 · 1283 阅读 · 0 评论 -
二叉堆维护优先队列
#include #include#includeusing namespace std;#define INF 0xfffffffint inline parent(int i){return i>>1;}int inline left(int i){return 2*i;}int inline right(int i){return 2*i+1;}templatevoid i原创 2014-06-30 01:46:09 · 917 阅读 · 0 评论 -
三个水杯(BFS)
三个水杯时间限制:1000 ms | 内存限制:65535 KB难度:4描述给出三个水杯,大小不一,并且只有最大的水杯的水是装满的,其余两个为空杯子。三个水杯之间相互倒水,并且水杯没有标识,只能根据给出的水杯体积来计算。现在要求你写出一个程序,使其输出使初始状态到达目标状态的最少次数。输入第一行一个整数N(0接下来每组测试数据有两行,第一行给出三原创 2014-05-25 00:49:47 · 1252 阅读 · 0 评论 -
表达式计算(中缀表达式转后缀前缀表达式)
给出一个由加减乘除和括号构成的表达式计算表达式的值和表达式的前缀和后缀表达式#include#include#define Inf 1e9struct tree{ double date; char ch; tree *l,*r; tree() { ch='\0'; date=0; l=r=NULL原创 2014-06-02 21:34:17 · 2724 阅读 · 1 评论