自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

onepointo

无它,唯手熟尔

  • 博客(57)
  • 资源 (2)
  • 收藏
  • 关注

转载 学习一个支配树

前置技能: LCA (Tarjan)今年冬令营上讲的东西现在才学 惭愧惭愧。。 首先做出图G的dfs树T 其中S为起点 定义T中节点 u 的半必经点sdom[u] 为 u的祖先中能经过若干条非树边到达u的(除了sdom[u]直接引出的边 其余边必须为非树边) 深度最小的节点 则对于任意一条边 (v->u) 这里我们默认sdom idom 记录的是dfn 则有1.dfn[v]<df

2017-08-31 15:20:51 242

原创 Codeforces Round 430 (Div 2) C

C. Ilya And The TreeIlya is very fond of graphs, especially trees. During his last trip to the forest Ilya found a very interesting tree rooted at vertex 1. There is an integer number written on each v

2017-08-30 21:25:28 180

原创 Codeforces 827 D 最小生成树+倍增 解题报告

D. Best Edge WeightYou are given a connected weighted graph with n vertices and m edges. The graph doesn’t contain loops nor multiple edges. Consider some edge with id i. Let’s determine for this edge

2017-08-30 19:55:08 376

原创 BZOJ 1013 [JSOI 2008] 高斯消元 解题报告

1013: [JSOI2008]球形空间产生器sphereDescription有一个球形空间产生器能够在n维空间中产生一个坚硬的球体。现在,你被困在了这个n维球体中,你只知道球面上n+1个点的坐标,你需要以最快的速度确定这个n维球体的球心坐标,以便于摧毁这个球形空间产生器。Input第一行是一个整数n(1<=N=10)。接下来的n+1行,每行有n个实数,表示球面上一点的n维坐标。每一个实数精确到小

2017-08-28 19:06:38 232

原创 BZOJ 1012 线段树 解题报告

1012: [JSOI2008]最大数maxnumberDescription现在请求你维护一个数列,要求提供以下两种操作:1、 查询操作。语法:Q L 功能:查询当前数列中末尾L个数中的最大的数,并输出这个数的值。限制:L不超过当前数列的长度。2、 插入操作。语法:A n 功能:将n加上t,其中t是最近一次查询操作的答案(如果还未执行过查询操作,则t=0),并将所得结果对一个固定的常数D取模,将所

2017-08-28 18:40:34 267

原创 2017.8.28 机房测试 (博弈论) 解题报告

1 Nim游戏·改(nim.c/cpp/pas)1.1 题目描述众所周知的Nim游戏是这样的:有n堆石子,小A和小B轮流取石子,小A先操作,每次选择一堆石子,在这堆中取走任意多个石子,最后没有石子可取的人输。现在为了加强Nim游戏难度,每堆非空石子有一次额外的特殊机会,即耗掉这个机会,然后什么也不拿走,而其他条件都不变。当然,如果你将一堆本来有额外机会的石子拿空,那么这次额外机会也就没有了。 现在

2017-08-28 15:59:53 324

原创 BZOJ 1011 数学 解题报告

1011: [HNOI2008]遥远的行星Description直线上N颗行星,X=i处有行星i,行星J受到行星I的作用力,当且仅当i<=AJ.此时J受到作用力的大小为 Fi->j=Mi*Mj/(j-i) 其中A为很小的常量,故直观上说每颗行星都只受到距离遥远的行星的作用。请计算每颗行星的受力,只要结果的相对误差不超过5%即可.Input第一行两个整数N和A. 1<=N<=10^5.0.01< a

2017-08-27 20:42:38 280

原创 BZOJ 1009 KMP+矩阵快速幂优化DP

1009: [HNOI2008]GT考试Description阿申准备报名参加GT考试,准考证号为N位数X1X2….Xn(0<=Xi<=9),他不希望准考证号上出现不吉利的数字。他的不吉利数学A1A2…Am(0<=Ai<=9)有M位,不出现是指X1X2…Xn中没有恰好一段等于A1A2…Am. A1和X1可以为0Input第一行输入N,M,K.接下来一行输入M位的数。 N<=10^9,M<=20,K<

2017-08-27 19:56:49 244

原创 BZOJ 1007 几何 解题报告

1007: [HNOI2008]水平可见直线Description在xoy直角坐标平面上有n条直线L1,L2,…Ln,若在y值为正无穷大处往下看,能见到Li的某个子线段,则称Li为 可见的,否则Li为被覆盖的. 例如,对于直线: L1:y=x; L2:y=-x; L3:y=0 则L1和L2是可见的,L3是被覆盖的. 给出n条直线,表示成y=Ax+B的形式(|A|,|B|<=500000),

2017-08-27 17:13:09 259

原创 BZOJ 1008 组合数学 解题报告

1008: [HNOI2008]越狱Description监狱有连续编号为1…N的N个房间,每个房间关押一个犯人,有M种宗教,每个犯人可能信仰其中一种。如果 相邻房间的犯人的宗教相同,就可能发生越狱,求有多少种状态可能发生越狱Input输入两个整数M,N.1<=M<=10^8,1<=N<=10^12Output可能越狱的状态数,模100003取余Sample Input2 3Sample Outp

2017-08-25 20:49:02 232

原创 BZOJ 1003 DP+最短路 解题报告

1003: [ZJOI2006]物流运输Description物流公司要把一批货物从码头A运到码头B。由于货物量比较大,需要n天才能运完。货物运输过程中一般要转停好几个码头。物流公司通常会设计一条固定的运输路线,以便对整个运输过程实施严格的管理和跟踪。由于各种因素的存在,有的时候某个码头会无法装卸货物。这时候就必须修改运输路线,让货物能够按时到达目的地。但是修改路线是一件十分麻烦的事情,会带来额外的

2017-08-25 20:09:58 311

原创 BZOJ 1002 矩阵树找规律递推高精度 解题报告

1002: [FJOI2007]轮状病毒Description轮状病毒有很多变种,所有轮状病毒的变种都是从一个轮状基产生的。一个N轮状基由圆环上N个不同的基原子 和圆心处一个核原子构成的,2个原子之间的边表示这2个原子之间的信息通道。如下图所示 N轮状病毒的产生规律是在一个N轮状基中删去若干条边,使得各原子之间有唯一的信息通道,例如共有16个不 同的3轮状病毒,如下图所示 现给定n(

2017-08-25 18:49:56 274

原创 BZOJ 1001 网络流最小割 解题报告

001: [BeiJing2006]狼抓兔子Description现在小朋友们最喜欢的”喜羊羊与灰太狼”,话说灰太狼抓羊不到,但抓兔子还是比较在行的, 而且现在的兔子还比较笨,它们只有两个窝,现在你做为狼王,面对下面这样一个网格的地形: 左上角点为(1,1),右下角点为(N,M)(上图中N=4,M=5).有以下三种类型的道路 1:(x,y)<==>(x+1,y) 2:(x,y)<=

2017-08-25 17:27:05 274

原创 HDU 6166 最短路+随机

Senior PanProblem DescriptionSenior Pan fails in his discrete math exam again. So he asks Master ZKC to give him graph theory problems everyday. The task is simple : ZKC will give Pan a directed graph

2017-08-25 16:38:22 347

原创 ZOJ 3329 期望DP 解题报告

One Person GameThere is a very simple and interesting one-person game. You have 3 dice, namely Die1, Die2 and Die3. Die1 has K1 faces. Die2 has K2 faces. Die3 has K3 faces. All the dice are fair dice,

2017-08-24 21:23:26 221

原创 Codeforces Round #429 (Div2) C

C. Leha and FunctionLeha like all kinds of strange things. Recently he liked the function F(n, k). Consider all possible k-element subsets of the set [1, 2, …, n]. For subset find minimal element in it

2017-08-22 16:20:50 182

原创 Codeforces Round #429 (Div2) B

B. GodsendLeha somehow found an array consisting of n integers. Looking at it, he came up with a task. Two players play the game on the array. Players move one by one. The first player can choose for h

2017-08-22 15:53:57 195

原创 Codeforces Round #429 (Div 2) A

A. Generous KefaOne day Kefa found n baloons. For convenience, we denote color of i-th baloon as si — lowercase letter of the Latin alphabet. Also Kefa has k friends. Friend will be upset, If he get tw

2017-08-22 15:27:53 194

原创 LA 3485 自适应Simpson积分 解题报告

A suspension bridge suspends the roadway from huge main cables, which extend from one end of thebridge to the other. These cables rest on top of high towers and are secured at each end by anchorages.Th

2017-08-21 20:50:28 311

原创 HDU 1724 自适应Simpson积分 解题报告

EllipseProblem DescriptionMath is important!! Many students failed in 2+2’s mathematical test, so let’s AC this problem to mourn for our lost youth.. Look this sample picture: A ellipses in the pla

2017-08-21 09:57:39 274

原创 SPOJ 8073 CIRU 自适应Simpson积分求圆的面积并 解题报告

CIRU - The area of the union of circlesYou are given N circles and expected to calculate the area of the union of the circles !InputThe first line is one integer n indicates the number of the circles.

2017-08-20 20:21:01 718

原创 POJ 3525/LA 3890 二分+半平面交

Most Distant Point from the SeaDescriptionThe main land of Japan called Honshu is an island surrounded by the sea. In such an island, it is natural to ask a question: “Where is the most distant point f

2017-08-19 19:50:40 397

原创 POJ 3348 凸包面积 解题报告

CowsDescriptionYour friend to the south is interested in building fences and turning plowshares into swords. In order to help with his overseas adventure, they are forced to save money on buying fence

2017-08-19 14:37:01 320

转载 学习一个FFT

http://blog.miskcoo.com/2015/04/polynomial-multiplication-and-fast-fourier-transform

2017-08-18 20:06:46 198

原创 学习一个大步小步求离散对数

Hash 实现 idy的板子十分的漂亮#include<cstdio>#include<cstring>#include<algorithm>#include<cmath>using namespace std;#define S 100007struct Hash_Map{ int head[S],nxt[S],dest[S][2],tot; void init()

2017-08-17 20:30:21 497

原创 POJ 2186 Tarjan 缩点 解题报告

Popular CowsDescriptionEvery cow’s dream is to become the most popular cow in the herd. In a herd of N (1 <= N <= 10,000) cows, you are given up to M (1 <= M <= 50,000) ordered pairs of the form (A, B)

2017-08-15 21:53:59 269

转载 学习一个 Bron-Kerbosch 算法

Bron-Kerbosch 算法计算图的最大全连通分量(团clique) 最大独立集: 顶点集V中取 K个顶点,其两两间无连接。 最大团: 顶点集V中取 K个顶点,其两两间有边连接。最大团中顶点数量 = 补图的最大独立集中顶点数量补图定义: G = #include<cstdio>#include<cstdlib>#include<cstring>int best;int num[ma

2017-08-15 21:13:57 2460

原创 Codeforces Round #428 D

D. Winter is hereWinter is here at the North and the White Walkers are close. John Snow has an army consisting of n soldiers. While the rest of the world is fighting for the Iron Throne, he is going to

2017-08-15 21:02:20 208

原创 BZOJ 2079 [Poi 2010] 图论 解题报告

2079: [Poi2010]GuildsDescriptionZy皇帝面临一个严峻的问题,两个互相抵触的贸易团体,YYD工会和FSR工会,他们在同一时间请求在王国各个城市开办自己的办事处。这里有n个城市,其中有一些以双向马路相连,这两个工会要求每个城市应该做到: 1:有这个工会的办事处或 2:和另外一个符合1条件的城市有马路直接相连。(也就是每个城市必须是YYD的公会,但是又和FSR的公会的城市相

2017-08-15 17:50:32 230

原创 BZOJ 2565 Manacher 解题报告

2565: 最长双回文串Description顺序和逆序读起来完全一样的串叫做回文串。比如acbca是回文串,而abc不是(abc的顺序为“abc”,逆序为“cba”,不相同)。 输入长度为n的串S,求S的最长双回文子串T,即可将T分为两部分X,Y,(|X|,|Y|≥1)且X和Y都是回文串。Input一行由小写英文字母组成的字符串S。Output一行一个整数,表示最长双回文子串的长度。Sample

2017-08-15 17:19:23 307

原创 POJ 2406 KMP 解题报告

Power StringsDescriptionGiven two strings a and b we define a*b to be their concatenation. For example, if a = “abc” and b = “def” then a*b = “abcdef”. If we think of concatenation as multiplication, e

2017-08-15 16:59:53 1188

原创 BZOJ 2741 分块+可持久化trie 解题报告

2741: 【FOTILE模拟赛】LDescriptionFOTILE得到了一个长为N的序列A,为了拯救地球,他希望知道某些区间内的最大的连续XOR和。 即对于一个询问,你需要求出max(Ai xor Ai+1 xor Ai+2 … xor Aj),其中l<=i<=j<=r。 为了体现在线操作,对于一个询问(x,y): l = min ( ((x+lastans) mod N)+1 , ((y

2017-08-15 16:54:57 242

原创 HDU 1075 Trie树 解题报告

What Are You Talking AboutProblem DescriptionIgnatius is so lucky that he met a Martian yesterday. But he didn’t know the language the Martians use. The Martian gives him a history book of Mars and a d

2017-08-15 16:20:07 200

原创 HDU 1251 Trie树 解题报告

统计难题Problem DescriptionIgnatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀).Input输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统计的单词,一个空行代表单词表的结束.第二部分是一连串的提问,每行一个提

2017-08-15 15:47:27 227

原创 BZOJ 2124 树状数组+Hash 解题报告

2124: 等差子序列Description给一个1到N的排列{Ai},询问是否存在1<=p1=3),使得Ap1,Ap2,Ap3,…ApLen是一个等差序列。Input输入的第一行包含一个整数T,表示组数。下接T组数据,每组第一行一个整数N,每组第二行为一个1到N的排列,数字两两之间用空格隔开。Output对于每组数据,如果存在一个等差子序列,则输出一行“Y”,否则输出一行“N”。Sample In

2017-08-14 15:55:30 261

原创 POJ 1637 网络流判混合欧拉回路 解题报告

Sightseeing tourDescriptionThe city executive board in Lund wants to construct a sightseeing tour by bus in Lund, so that tourists can see every corner of the beautiful city. They want to construct the

2017-08-13 17:18:32 478

原创 Codeforces Round #428 (Div 2) C

C. JourneyThere are n cities and n - 1 roads in the Seven Kingdoms, each road connects two cities and we can reach any city from any other by the roads. Theon and Yara Greyjoy are on a horse in the fi

2017-08-13 16:42:08 194

原创 Codeforces Round #428 (Div 2) B

B. Game of the RowsDaenerys Targaryen has an army consisting of k groups of soldiers, the i-th group contains ai soldiers. She wants to bring her army to the other side of the sea to get the Iron Thron

2017-08-13 15:37:25 223

原创 Codeforces Round #428 (Div 2) A

A. Arya and BranBran and his older sister Arya are from the same house. Bran like candies so much, so Arya is going to give him some Candies. At first, Arya and Bran have 0 Candies. There are n days,

2017-08-13 14:43:36 162

原创 HDU2767 Tarjan 解题报告

Proving EquivalencesProblem DescriptionConsider the following exercise, found in a generic linear algebra textbook. Let A be an n × n matrix. Prove that the following statements are equivalent: 1. A

2017-08-12 17:45:48 338

动态规划加速原理之四边形不等式

动态规划加速原理之四边形不等式

2017-05-19

NOIP2009测试数据

NOIP2009测试数据

2017-03-10

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除