最大流EK算法
摘要:给定一个有向图G=(V,E),把图中的边看作 管道,每条边上有一个权值,表示该管道 的流量上限。给定源点s和汇点t,现在假设 在s处有一个水源,t处有一个蓄水池,问从 s到t的最大水流量是多少? 网络流图里,源点流出的量,等于汇点流 入的量,除源汇外的任何点,其流入量之 和等于流出两之和。 下面我们
阅读全文
posted @
2017-12-14 19:56
Beserious
阅读(5272)
推荐(1) 编辑
leetcode 417. Pacific Atlantic Water Flow
摘要:Given an m x n matrix of non-negative integers representing the height of each unit cell in a continent, the "Pacific ocean" touches the left and top
阅读全文
posted @
2017-08-22 20:55
Beserious
阅读(300)
推荐(0) 编辑
#1542 : 无根数变有根树
摘要:时间限制:10000ms 单点时限:1000ms 内存限制:256MB 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 给定一棵包含 N 个节点的无根树,小Hi想知道如果指定其中某个节点 K 为根,那么每个节点的父节点是谁? 输入 第一行包含一个整数 N 和 K。1 ≤
阅读全文
posted @
2017-07-30 17:25
Beserious
阅读(222)
推荐(0) 编辑
110. Balanced Binary Tree
摘要:Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as a binary tree in which the dept
阅读全文
posted @
2017-07-24 10:48
Beserious
阅读(123)
推荐(0) 编辑
107.Binary Tree Level Order Traversal II
摘要:Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root). For
阅读全文
posted @
2017-07-22 17:29
Beserious
阅读(125)
推荐(0) 编辑
104. Maximum Depth of Binary Tree
摘要:Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest l
阅读全文
posted @
2017-07-21 18:13
Beserious
阅读(108)
推荐(0) 编辑
101. Symmetric Tree
摘要:Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] is symmet
阅读全文
posted @
2017-07-21 17:54
Beserious
阅读(114)
推荐(0) 编辑
100. Same Tree
摘要:Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally identical a
阅读全文
posted @
2017-07-21 15:53
Beserious
阅读(121)
推荐(0) 编辑
C - Gr-idian MST
摘要:Time limit : 2sec / Memory limit : 256MB Score : 500 points Problem Statement On an xy plane, in an area satisfying 0≤x≤W,0≤y≤H, there is one house at
阅读全文
posted @
2016-10-14 15:24
Beserious
阅读(275)
推荐(0) 编辑
ROADS - Roads
摘要:N cities named with numbers 1 ... N are connected with one-way roads. Each road has two parameters associated with it: the road length and the toll th
阅读全文
posted @
2016-09-05 02:19
Beserious
阅读(450)
推荐(0) 编辑
给定序列,求这个序列的出栈次序
摘要:比如1,2,3 的出栈次序可以是{1,2,3}{2,1,3}{2,3,1}{1,3,2}{3,2,1}5种。 其实这个 和leetcode生成括号那个题目很像。题目链接https://leetcode.com/problems/generate-parentheses/ 题解 http://www.
阅读全文
posted @
2016-08-20 15:00
Beserious
阅读(634)
推荐(0) 编辑
Codeforces Round #311 (Div. 2) D - Vitaly and Cycle
摘要:D. Vitaly and Cycle time limit per test 1 second time limit per test memory limit per test 256 megabytes memory limit per test input standard input in
阅读全文
posted @
2016-08-17 23:29
Beserious
阅读(159)
推荐(0) 编辑
HDU 5855Less Time, More profit
摘要:Less Time, More profit Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 468 Accepted Submission(s)
阅读全文
posted @
2016-08-17 17:09
Beserious
阅读(233)
推荐(0) 编辑
2015-2016 ACM-ICPC Pacific Northwest Regional Contest (Div. 2)V - Gears
摘要:Problem V | limit 4 secondsGearsA set of gears is installed on the plane. You are given the center coordinate and radius of eachgear. For a given inpu
阅读全文
posted @
2016-08-15 21:12
Beserious
阅读(590)
推荐(0) 编辑
UESTC149 解救小Q
摘要:小Q被邪恶的大魔王困在了迷宫里,love8909决定去解救她。迷宫里面有一些陷阱,一旦走到陷阱里,就会被困身亡:(,迷宫里还有一些古老的传送阵,一旦走到传送阵上,会强制被传送到传送阵的另一头。现在请你帮助love8909算一算,他至少需要走多少步才能解救到小Q? 小Q被邪恶的大魔王困在了迷宫里,lo
阅读全文
posted @
2016-07-15 17:17
Beserious
阅读(316)
推荐(0) 编辑
HDU 4857 逃生
摘要:逃生 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3780 Accepted Submission(s): 1082 Problem Desc
阅读全文
posted @
2016-07-15 12:32
Beserious
阅读(229)
推荐(0) 编辑
Lightoj 1029 - Civil and Evil Engineer
摘要:1029 - Civil and Evil Engineer PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB A Civil Engineer is given a task to connect
阅读全文
posted @
2016-07-08 20:16
Beserious
阅读(272)
推荐(0) 编辑
Lightoj 1009 - Back to Underworld
摘要:1009 - Back to Underworld PDF (English) Statistics Forum Time Limit: 4 second(s) Memory Limit: 32 MB The Vampires and Lykans are fighting each other t
阅读全文
posted @
2016-06-12 16:30
Beserious
阅读(343)
推荐(0) 编辑