很裸的判断最小割是否唯一。判断方法是先做一遍最大流求最小割,然后从源点和汇点分别遍历所有能够到达的点,看是否覆盖了所有的点,如果覆盖了所有的点,那就是唯一的,否则就是不唯一的。#include #include #include #include #include #include #include...
分类:
其他好文 时间:
2014-07-28 23:55:24
阅读次数:
570
class Solution {private: vector res;public: vector generateTrees(int n) { res.clear(); res = dfs(1, n + 1); return res; ...
分类:
其他好文 时间:
2014-07-27 23:28:19
阅读次数:
195
Description
Given a connected undirected graph, tell if its minimum spanning tree is unique.
Definition 1 (Spanning Tree): Consider a connected, undirected graph G = (V, E). A spanning tree of...
分类:
其他好文 时间:
2014-07-26 17:19:22
阅读次数:
401
Problem Description:
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers
sums to T.
Each number in C may only b...
分类:
其他好文 时间:
2014-07-26 15:24:02
阅读次数:
252
unique()函数是一个去重函数,STL中unique的函数 unique的功能是去除相邻的重复元素(只保留一个),还有一个容易忽视的特性是它并不真正把重复的元素删除。他是c++中的函数,所以头文件要加#include,具体用法如下: int num[100]; unique(num,mun+n)...
分类:
其他好文 时间:
2014-07-26 14:58:50
阅读次数:
297
Given an arraySofnintegers, are there elementsa,b,c, anddinSsuch thata+b+c+d= target? Find all unique quadruplets in the array which gives the sum of ...
分类:
其他好文 时间:
2014-07-25 14:13:21
阅读次数:
317
#pragma warning(disable:4996)
#include <cstdio>
#include <Windows.h>
#include <tchar.h>
/*
submit time : 3
1. Time Limit Exceeded
23, 12
request :
A robot is located at the top-left corn...
分类:
其他好文 时间:
2014-07-25 11:40:41
阅读次数:
315
A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).The robot can only move either down or right at any po...
分类:
其他好文 时间:
2014-07-25 10:54:31
阅读次数:
229
The Unique MST
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 19941
Accepted: 6999
Description
Given a connected undirected graph, tell if its min...
分类:
其他好文 时间:
2014-07-24 23:36:24
阅读次数:
403
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums
to T.
The same repeated number may be chosen from C unlimited numb...
分类:
其他好文 时间:
2014-07-24 23:18:03
阅读次数:
293