Lightoj 1003 - Drunk(拓扑排序)
摘要:One of my friends is always drunk. So, sometimes I get a bit confused whether he is drunk or not. So, one day I was talking to him, about his drinks!
阅读全文
posted @
2016-06-07 20:41
Beserious
阅读(290)
推荐(0) 编辑
Lightoj 1002 - Country Roads(prim算法)
摘要:I am going to my home. There are many cities and many bi-directional roads between them. The cities are numbered from 0 to n-1 and each road has a cos
阅读全文
posted @
2016-06-06 19:27
Beserious
阅读(310)
推荐(0) 编辑
SRM691 Sunnygraphs2
摘要:Problem Statement Hero has just constructed a very specific graph. He started with n isolated vertices, labeled 0 through n-1. For each vertex i Hero
阅读全文
posted @
2016-06-01 21:12
Beserious
阅读(225)
推荐(0) 编辑
L2-006. 树的遍历
摘要:2016年团体程序设计天梯赛-模拟赛 给定中序遍历和后序遍历求前序遍历。给前序遍历和中序遍历求后序遍历这样类型的题目,可以先构造成一颗二叉树,然后。。。就好办了 给定中序遍历和后序遍历求前序遍历。给前序遍历和中序遍历求后序遍历这样类型的题目,可以先构造成一颗二叉树,然后。。。就好办了 给定中序遍历和
阅读全文
posted @
2016-05-15 20:30
Beserious
阅读(1411)
推荐(0) 编辑
Uva 3902 Network
摘要:题目大意: 在非叶子节点上安装最少的服务器使得,每个叶子节点到服务器的距离不超过k。 贪心+图上的dfs。 先从深度最大的叶子节点开始找。找到父节点后再用这个父节点进行扩充。
阅读全文
posted @
2016-05-10 23:39
Beserious
阅读(227)
推荐(0) 编辑
B.大钉骑马走江湖
摘要:江湖是什么,对于在象棋界厮杀的大钉来说,江湖就是一个矩阵,他的目标,就是在江湖之中骑着马,从他的位置出发,走到终点。 当然,大钉的马也遵从中国象棋中的“马走日”的规则,而且在矩阵中,也会有一些障碍物,马不能跳到障碍物上;如果大钉的马面前有障碍物,即被“别马腿”,那么他将不能跳向有障碍物的左前和右前这
阅读全文
posted @
2016-04-24 15:56
Beserious
阅读(379)
推荐(0) 编辑
22. Generate Parentheses
摘要:Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: "
阅读全文
posted @
2016-04-05 16:49
Beserious
阅读(193)
推荐(0) 编辑
Codeforces Round #346 (Div. 2) E. New Reform
摘要:E. New Reform time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Berland has n cities connec
阅读全文
posted @
2016-04-02 18:55
Beserious
阅读(231)
推荐(0) 编辑
NEU 1685: All Pair Shortest Path
摘要:题目描述 Bobo has a directed graph G with n vertex labeled by 1,2,3,..n. Let D(i,j) be the number of edges from vertex i to vertex j on the shortest path.
阅读全文
posted @
2016-03-22 11:29
Beserious
阅读(234)
推荐(0) 编辑
1682: 全球变暖
摘要:由于全球变暖,岛国S的沿岸的海水不断上涨,形式岌岌可危。 S国的地图是由n*m个网格组成的,网格由.和#组成,#代表的区域是陆地,.和地图外面全是海水。 每天,海水将侵蚀相邻的陆地,即如果陆地与海水相邻的话,第二天就会变成海水。这里面的两块相邻表示两块之间公用一条边。 比如S国的地图是这样的: ..
阅读全文
posted @
2016-03-22 11:13
Beserious
阅读(275)
推荐(0) 编辑
网络流dinic模板
摘要:#include #include #include #include #include #include #include #define ll long long#define INF 0x3f3f3f3f#define cle(a) memset(a,0,sizeof(a))using nam...
阅读全文
posted @
2015-10-20 19:45
Beserious
阅读(366)
推荐(0) 编辑
HDU 2444 The Accomodation of Students(判断二分图+最大匹配)
摘要:The Accomodation of StudentsTime Limit: 5000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3775Accepted Submissio...
阅读全文
posted @
2015-10-06 21:10
Beserious
阅读(167)
推荐(0) 编辑
IRRIGATION LINES
摘要:IRRIGATIONLINESTime Limit:2000ms,Special Time Limit:5000ms,Memory Limit:65536KBTotal submit users:6,Accepted users:6Problem 13449 :No special judgemen...
阅读全文
posted @
2015-10-06 19:36
Beserious
阅读(193)
推荐(0) 编辑
HDU 5438 Ponds
摘要:PondsTime Limit: 1500/1000 MS (Java/Others)Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 282Accepted Submission(s): 86Problem Descri...
阅读全文
posted @
2015-09-13 19:32
Beserious
阅读(141)
推荐(0) 编辑
Codeforces Beta Round #25 (Div. 2 Only)D. Roads not only in Berland
摘要:D. Roads not only in Berlandtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputBerland Government d...
阅读全文
posted @
2015-08-24 19:58
Beserious
阅读(196)
推荐(0) 编辑
Codeforces Beta Round #25 (Div. 2 Only) C. Roads in Berland
摘要:C. Roads in Berlandtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere arencities numbered fro...
阅读全文
posted @
2015-08-24 19:53
Beserious
阅读(277)
推荐(0) 编辑
UVA 11624 Fire!
摘要:数据:34 4#####JF##..##..#3 3FFFFJFFFF3 3....J....嗯,被第三个数据卡啦半天....两次BFS 预处理一下每个点最早着火的时间./* ***********************************************Author :...
阅读全文
posted @
2015-08-20 00:34
Beserious
阅读(187)
推荐(0) 编辑
POJ 3279 Dungeon Master
摘要:Dungeon MasterTime Limit:1000MSMemory Limit:65536KTotal Submissions:21242Accepted:8265DescriptionYou are trapped in a 3D dungeon and need to find the ...
阅读全文
posted @
2015-08-19 19:19
Beserious
阅读(134)
推荐(0) 编辑
POJ 1321 棋盘问题
摘要:棋盘问题Time Limit:1000MSMemory Limit:10000KTotal Submissions:28733Accepted:14220Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一...
阅读全文
posted @
2015-08-19 18:37
Beserious
阅读(143)
推荐(0) 编辑
Fzu 2150 Fire Game
摘要:Problem 2150 Fire Game Accept: 864 Submit: 3207Time Limit: 1000 mSec Memory Limit : 32768 KB Problem Description Fat brother and Maze are playing a ki
阅读全文
posted @
2015-08-19 00:14
Beserious
阅读(232)
推荐(0) 编辑