
HDU
lemonoil
竞赛党一枚
展开
-
HDU 1512 Monkey King [可并堆]
题目传送门左偏树入门题,模板题。 照板打就行了,左偏树的删除、插入都可以通过merge操作完成。#include<cstdio> #include<algorithm> using namespace std; const int maxn = 100005; struct tree { int l,r,v,dis,f; }heap[maxn]; int merge(int a,int b原创 2017-07-14 18:57:45 · 356 阅读 · 0 评论 -
HDU 2222 Keywords Search [AC自动机]
AC自动机模板题。 学习建Trie树并在其上构建fail(Trie+KMP),这就是AC(自动机),那么有什么关键点吗? 那就是字符串题是我唯一会全程用指针构造的题,即使是数据结构,使用数组都会有指针比不上的优势。 什么指针写出来清晰? 等你天天艹树,会发现其实都差不多的。#include<iostream> #include<cstdio> #include<cstring> #inclu原创 2017-07-14 21:16:57 · 372 阅读 · 0 评论 -
HDU 3966 Aragorn's Story [树链剖分]
树链剖分裸题,比QTree系列要简单一点,重点是拿来练手#pragma comment(linker, "/STACK:1024000000,1024000000") #include <iostream> #include <string.h> #include <algorithm> #include <stdio.h> #include <vector> using namespace std原创 2017-07-15 21:00:38 · 261 阅读 · 0 评论 -
HUD2767 进阶版 [强连通分量]
越狱(break)【问题描述】 Michael为救哥哥身陷囹圄,被关进foxriver监狱。为准备越狱,他需要散布消息给监狱中其他人来共同协作,但是监狱中鱼龙混杂,分成各个小团体,内部消息传递单向传输。问题1:初始至少需要向多少个透漏消息,使得监狱内所有人都获知消息。 问题2,至少需要添加几条传输线路(边),使任意向一个人散步消息后,经过若干次传送,监狱内所有的人最终都能得到消息。 【输入格式原创 2017-07-10 09:41:22 · 451 阅读 · 0 评论 -
HDU 4694 [支配树]
题目传送门典型的支配树裸题,就是询问给定点到某点i的全部路径都经过的某点j。 具体讲解就不写了,网上很详细。 安利1 安利2#include<cstdio> #include<iostream> #include<cstring> #include<cstdlib> #include<vector> #include<algorithm> using namespace std; const原创 2017-07-27 21:49:50 · 600 阅读 · 0 评论