POJ 1637 Sightseeing tour
题目链接
题意:给一些有向边一些无向边,问是否能把无向边定向之后确定一个欧拉回路
思路:这题的模型非常的巧妙,转一个http://blog.csdn.net/pi9nc/article/details/12223693
先把有向边任意定向了,然后根据每个点的入度出度之差,可以确定每个点需要调整的次数,然后中间就是需要调整的...
分类:
其他好文 时间:
2014-11-08 12:05:41
阅读次数:
274
POJ 2135 Farm Tour
题目链接
题意:给定一个无向图,边有权值,求从1到n再从n到1的最短路
思路:费用流,连边容量为1(注意是无向图),然后源点和1连容量2,n和汇点连容量是2
代码:
#include
#include
#include
#include
#include
using namespace std;
const int M...
分类:
其他好文 时间:
2014-11-06 00:51:30
阅读次数:
296
Language:
Default
Farm Tour
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 11916
Accepted: 4454
Description
When FJ's friends visit him on the farm, h...
分类:
其他好文 时间:
2014-11-05 19:46:12
阅读次数:
122
F -Tour BeltTime Limit:3000MSMemory Limit:0KB64bit IO Format:%lld & %lluSubmitStatusPracticeUVALive 4848DescriptionKorea has many tourist attractions....
分类:
其他好文 时间:
2014-11-05 00:00:11
阅读次数:
469
HDU 1853 Cyclic Tour
题目链接
题意:一个有向图,边有权值,求把这个图分成几个环,每个点只能属于一个环,使得所有环的权值总和最小,求这个总和
思路:KM完美匹配,由于是环,所以每个点出度入度都是1,一个点拆成两个点,出点和入点,每个点只能用一次,这样就满足了二分图匹配,然后用KM完美匹配去就最小权值的匹配即可
代码:
#include
#incl...
分类:
其他好文 时间:
2014-10-31 13:56:27
阅读次数:
264
Webkit浏览器:ChromeSafari搜狗高速浏览器傲游浏览器3QQ浏览器360极速浏览器世界之窗阿里云Firefox 浏览器:火狐IE内核浏览器:猎豹安全浏览器(liebao)(IE兼容模式)蚂蚁浏览器(MyIE9)腾讯TT(Tencent Traveler)QQ浏览器7(QQ Tour)爱...
分类:
其他好文 时间:
2014-10-29 16:32:44
阅读次数:
189
Channels are a typed conduit through which you can send and receive values with the channel operator,<-.ch <- v // Send v to channel ch.v := <-ch ...
分类:
其他好文 时间:
2014-10-29 01:49:32
阅读次数:
155
/* Exercise: Loops and Functions #43 */package main import ( "fmt" "math") func Sqrt(x float64) float64 { z := float64(2.) s := float64(0)...
分类:
其他好文 时间:
2014-10-29 01:48:06
阅读次数:
282
The next section covers Go's concurrency primitives.A Tour of GoGoroutinesAgoroutineis a lightweight thread managed by the Go runtime.go f(x, y, z)sta...
分类:
其他好文 时间:
2014-10-29 01:44:37
阅读次数:
108
Channels can bebuffered. Provide the buffer length as the second argument tomaketo initialize a buffered channel:ch := make(chan int, 100)Sends to a b...
分类:
其他好文 时间:
2014-10-29 01:43:40
阅读次数:
142