自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

柳予欣的三味书屋~

bu ling bu ling

  • 博客(27)
  • 收藏
  • 关注

原创 关于生成树计数问题和多种情况

         大的道理和理论我就不说了,有什么理论上的疑惑我推荐下这个地址:      https://blog.csdn.net/u013010295/article/details/47451451     一:无向图中的生成树计数;      这种情况下我们要看看是否存在重边的情况,如果没有的话就可以用Matrix-Tree定理和高斯消元直接来解;      ...

2018-07-31 11:08:21 831

转载 矩阵树定理 Matrix Tree(看见大佬总结忍不住转载)

矩阵树定理 Matrix Tree  ​  矩阵树定理主要用于图的生成树计数。    看到给出图求生成树的这类问题就大概要往这方面想了。    算法会根据图构造出一个特殊的基尔霍夫矩阵AA,接着根据矩阵树定理,用AA计算出生成树个数。      1.无向图的生成树计数    对于给定的可含重边的连通无向图GG,求其生成树的个数。求法如下:    定义度数矩阵DD:...

2018-07-30 16:50:43 2070 1

原创 HDU - 4009 Transfer water (最小树形图)

Transfer water Time Limit: 5000/3000 MS (Java/Others)    Memory Limit: 65768/65768 K (Java/Others) Total Submission(s): 5902    Accepted Submission(s): 2098   Problem Description X...

2018-07-30 16:25:45 156

原创 HDU - 2121 Ice_cream’s world II (不定根树形图)

Ice_cream’s world II Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 6367    Accepted Submission(s): 1658   Problem Description...

2018-07-30 10:03:46 223

原创 HDU - 6315 Naive Operations

Naive Operations Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 502768/502768 K (Java/Others) Total Submission(s): 2498    Accepted Submission(s): 1096   Problem Description...

2018-07-29 19:55:14 192

原创 我的最小树形图板子

#include<iostream>#include<cstdio>#include<cstring>using namespace std;#define inf 0x3f3f3f3fint n, m;struct fuck{ int from, to, len;}ed[1000005];int id[1005];int pre[100...

2018-07-27 19:05:20 219

原创 POJ - 1679 The Unique MST(次小生成树)

The Unique MSTTime Limit: 1000MS   Memory Limit: 10000K Total Submissions: 35193   Accepted: 12860 DescriptionGiven a connected undirected graph, tell if its minimum spanning tree ...

2018-07-26 14:06:21 103

原创 我用的小小的次小生成树模板

次小生成树的生成分为两种,一种是带重边的,一种是不带重边的~~;首先是不带重边的,就可以用prim来做#include<iostream>#include<cstdio>#include<algorithm>using namespace std;const int inf = 0x3f3f3f3f;const int maxn = 105;...

2018-07-26 10:44:28 235

原创 我自己的小小线段树模板

#include<iostream>#include<cstdio>using namespace std;#define maxn 100005#define mid m=(l+r)>>1#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1int c[maxn <<...

2018-07-25 20:11:17 172 3

原创 POJ - 1062 昂贵的聘礼 (某个步骤会对后面有影响的情况下,可以用分层图及此题的枚举区间)

昂贵的聘礼Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 54978   Accepted: 16527 Description年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金...

2018-07-25 16:22:53 94

原创 POJ - 2502 Subway(哎,这题建图好烦啊)

                                                                                SubwayTime Limit: 1000MS   Memory Limit: 65536K Total Submissions: 13146   Accepted: 4265 Description...

2018-07-25 14:41:23 250

原创 ZOJ - 1610 Count the Colors(以区间为”点“的线段树)

Count the Colors Time Limit: 2 Seconds      Memory Limit: 65536 KB Painting some colored segments on a line, some previously painted segments may be covered by some the subsequent ones....

2018-07-24 20:41:26 168

原创 HDU - 1698 Just a Hook(线段树区间更新区间查找)

Just a Hook Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 41024    Accepted Submission(s): 19780   Problem Description In ...

2018-07-24 16:25:00 180

原创 LightOJ - 1074 Extended Traffic(spfa+dfs负环判断)

Dhaka city is getting crowded and noisy day by day. Certain roads always remain blocked in congestion. In order to convince people avoid shortest routes, and hence the crowded roads, to reach destinat...

2018-07-24 10:02:47 172

原创 POJ - 3660 Cow Contest(emmmm-spfa)

Cow ContestTime Limit: 1000MS   Memory Limit: 65536K Total Submissions: 15022   Accepted: 8392 DescriptionN (1 ≤ N ≤ 100) cows, conveniently numbered 1..N, are participating in a p...

2018-07-23 10:31:17 250

原创 POJ - 1860 Currency Exchange (spfa+判断负环)

                                                                           Currency ExchangeTime Limit: 1000MS   Memory Limit: 30000K Total Submissions: 35610   Accepted: 13646 Descr...

2018-07-22 19:54:25 124

原创 HDU - 4725 The Shortest Path in Nya Graph (spfa,层和点都建点)

The Shortest Path in Nya Graph Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 10435    Accepted Submission(s): 2291   Problem ...

2018-07-22 08:55:01 195

原创 HDU - 2680 Choose the best route(spfa+超级源点)

Choose the best route Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 18567    Accepted Submission(s): 6011   Problem Descripti...

2018-07-21 10:30:29 230

原创 HYSBZ - 2763 飞行路线 (分层图+spfa)

首先我们先来看一下什么叫做分层图:        分层图主要是应用于 变化的最短路问题 问题常表现为一个最短路问题上加一些手脚,如减小一些边权,改变一些连接,但事先又不知道,或可以自由选择改变哪个边,最终求最短路等等。由于无法知道改变了那些边,所以用到分层图思想。可以理解为 平行宇宙 一样的东西 就是把原图复制出来k个,然后在原图连接的基础上,在相邻层中间加一些要求的变化边,通常是单向的(保...

2018-07-20 22:14:07 343

原创 ZOJ - 3261 Connections in Galaxy War

Connections in Galaxy War Time Limit: 3 Seconds      Memory Limit: 32768 KB In order to strengthen the defense ability, many stars in galaxy allied together and built many bidirectional tu...

2018-07-19 11:20:29 237

原创 HDU - 2612 Find a way(BFS)

Find a wayTime Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 22363    Accepted Submission(s): 7293Problem DescriptionPass a year learning in Hangzh...

2018-07-11 00:58:15 116

原创 UVA - 11624 Fire!(BFS)

https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2671因为是pdf形式我就不打了,各位上去看吧。       大体意思就是,有一个人,要赶在火焰烧到他前炮出这个迷宫,他自己只能基础四方向的一个方向移动,火焰是每次四方向扩散,其中'...

2018-07-10 23:44:13 154

原创 Problem 2150 Fire Game (DFS+BFS)

Problem 2150 Fire Game Accept: 3417    Submit: 11710Time Limit: 1000 mSec    Memory Limit : 32768 KBProblem DescriptionFat brother and Maze are playing a kind of special (hentai) game on an N*M board ...

2018-07-10 15:47:12 254

原创 POJ 3414-Pots

PotsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 21559 Accepted: 9205 Special JudgeDescriptionYou are given two pots, having the volume of A and B liters respectively. The following opera...

2018-07-09 00:51:24 131

原创 POJ-3126 Find The Multiple(emmmmmBFS?)

Find The MultipleTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 40365 Accepted: 16924 Special JudgeDescriptionGiven a positive integer n, write a program to find out a nonzero multiple m of...

2018-07-07 17:27:01 112

原创 POJ-2251 Dungeon Master (搜索)

Dungeon MasterTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 46122 Accepted: 17400DescriptionYou are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed o...

2018-07-07 01:15:18 142

原创 Poj 1321棋盘问题(八皇后问题)

原题目:棋盘问题Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 62732 Accepted: 30027Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。In...

2018-07-07 00:27:32 492

空空如也

空空如也

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

TA关注的人

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