自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

勿忘初衷

Talk is cheap, show me the code

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

原创 uva 10905 - Children's Game

4thIIUCInter-University Programming Contest, 2005 A Children’s Game Input: standard input Output: standard output Problemsetter: Md. Kamruzzaman There are

2013-04-24 17:30:29 897

原创 uva 11324 - The Largest Clique(缩点 + dp)

Problem B: The Largest Clique Given a directed graph G, consider the following transformation. First, create a new graph T(G) to have the same vertex set as G. Create a directed edge between two v

2013-04-07 10:14:01 1489

原创 强连通分量SCC模版(LRJ)

#include #include #include #include #include using namespace std; const int maxn = 1000 + 10; //图中节点编号从0开始,scc从1开始 vector G[maxn]; int pre[maxn], lowlink[maxn], sccno[maxn], dfs_clock, scc_

2013-04-07 09:26:42 1099

原创 uva 1086 - The Ministers' Major Mess(TwoSat)

csdn真是神坑,刚写的解题竟然被吞了,尼玛,害我重写。 本题的突破口在每个投票人都要有超过一半的建议被采纳。所以对于k=3的,只有一个建议不能采纳。 都得采纳的,我用了一个must数组记录,然后dfs找出所有开始就定下来的建议的值;只有一个不能采纳,即每两个建议间都至少有一个被采纳。 最后输出要判断“?”,我的方法是对每个建议检查是否无论它采不采纳都有解。开始忘了dfs找所有应该must的

2013-04-06 21:24:05 1444

原创 TwoSAT模版(LRJ)

#include #include #include #include #include using namespace std; const int maxn = 100; struct TwoSAT { int n; vector G[maxn*2]; bool mark[maxn*2]; int S[maxn*2], c; bool d

2013-04-06 18:22:47 1042

原创 uva 11294 - Wedding(TwoSAT)

Problem E: Wedding Up to thirty couples will attend a wedding feast, at which they will be seated on either side of a long table. The bride and groom sit at one end, opposite each other, and the brid

2013-04-06 18:21:11 1691

原创 边双连通分量模版

边双连通分量的求法,分两个步骤:先做一次dfs标记出所有的桥,然后再做一次dfs找出边双连通分量。因为边双连通分量是没有公共结点的,所以只要在第二次dfs的时候保证不经过桥即可。 下面的模版是模仿LRJ点双连通模版自己敲的,用了并查集来做双连通分量的标记。使用时注意模版中点的编号是从0~n-1。 #include #include #include #include #include

2013-04-03 18:30:09 946

原创 uva 10972 - RevolC FaeLoN(边双连通分量)

Problem I RevolC FaeLoN Hopefully, you can remember Koorosh from one of the previous problems. Fortunately, Koorosh has solved Basm’s problem without your help! Now, he is a high-ranked advisor of B

2013-04-03 18:16:10 1395

原创 图论读书笔记

刘汝佳书上图论这章也看的差不多了,做题时发现自己在图论的知识与思维上还差很多,所以去图书馆借了两本图论的书翻了看看,一些笔记整理于此。 一.重要思想: 1.补图: -                                                                           - G是以V(G)为点集的一个图,但是两个点在G中连接当且仅当他们在G中不连

2013-04-02 17:36:44 3737 4

空空如也

空空如也

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

TA关注的人

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