<? xml version="1.0" ?> < ArrayOfDataSync xmlns:xsi ="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd ="http://www.w3.org/2001/XMLSchema" > < DataSync > < __isset > < IsSync > true </ IsSync > < FilePath > true </ FilePath > < CurrentSeek > true </ CurrentSeek > < ClientKey > true </ ClientKey > < OrderNumber > true </ OrderNumber > < OccurTime > true </ OccurTime > < Name > false </ Name > < Size > false </ Size > < LastDate > false </ LastDate > </ __isset > < IsSync > true </ IsSync > < FilePath > d:\path\资料\thrift文件\thrift文件\testJava.thrift </ FilePath > < CurrentSeek > 1297 </ CurrentSeek > < ClientKey > 8C:89:A5:E1:89:3D </ ClientKey > < OrderNumber > 1 </ OrderNumber > < OccurTime > 2014/1/26 15:32:46 </ OccurTime > < Size > 0 </ Size > </ DataSync > < DataSync > < __isset > < IsSync > true </ IsSync > < FilePath > true </ FilePath > < CurrentSeek > true </ CurrentSeek > < ClientKey > true </ ClientKey > < OrderNumber > true </ OrderNumber > < OccurTime > true </ OccurTime > < Name > false </ Name > < Size > false </ Size > < LastDate > false </ LastDate > </ __isset > < IsSync > true </ IsSync > < FilePath > d:\path\资料\thrift文件\thrift文件\thrift-0.8.0.exe </ FilePath > < CurrentSeek > 4013056 </ CurrentSeek > < ClientKey > 8C:89:A5:E1:89:3D </ ClientKey > < OrderNumber > 1 </ OrderNumber > < OccurTime > 2014/1/26 15:32:46 </ OccurTime > < Size > 0 </ Size > </ DataSync > < DataSync > < __isset > < IsSync > true </ IsSync > < FilePath > true </ FilePath > < CurrentSeek > true </ CurrentSeek > < ClientKey > true </ ClientKey > < OrderNumber > true </ OrderNumber > < OccurTime > true </ OccurTime > < Name > false </ Name > < Size > false </ Size > < LastDate > false </ LastDate > </ __isset > < IsSync > true </ IsSync > < FilePath > d:\path\资料\thrift文件\thrift文件\thrift_白皮书.pdf </ FilePath > < CurrentSeek > 441217 </ CurrentSeek > < ClientKey > 8C:89:A5:E1:89:3D </ ClientKey > < OrderNumber > 1 </ OrderNumber > < OccurTime > 2014/1/26 15:32:46 </ OccurTime > < Size > 0 </ Size > </ DataSync > < DataSync > < __isset > < IsSync > true </ IsSync > < FilePath > true </ FilePath > < CurrentSeek > true </ CurrentSeek > < ClientKey > true </ ClientKey > < OrderNumber > true </ OrderNumber > < OccurTime > true </ OccurTime > < Name > false </ Name > < Size > false </ Size > < LastDate > false </ LastDate > </ __isset > < IsSync > true </ IsSync > < FilePath > d:\path\资料\thrift文件\thrift文件\thrift命令.txt </ FilePath > < CurrentSeek > 131 </ CurrentSeek > < ClientKey > 8C:89:A5:E1:89:3D </ ClientKey > < OrderNumber > 1 </ OrderNumber > < OccurTime > 2014/1/26 15:32:46 </ OccurTime > < Size > 0 </ Size > </ DataSync > </ ArrayOfDataSync >
<?
xml version="1.0"
?>
<
ArrayOfDataSync
xmlns:xsi
="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd
="http://www.w3.org/2001/XMLSchema"
>
<
DataSync
>
<
__isset
>
<
IsSync
>
true
</
IsSync
>
<
FilePath
>
true
</
FilePath
>
<
CurrentSeek
>
true
</
CurrentSeek
>
<
ClientKey
>
true
</
ClientKey
>
<
OrderNumber
>
true
</
OrderNumber
>
<
OccurTime
>
true
</
OccurTime
>
<
Name
>
false
</
Name
>
<
Size
>
false
</
Size
>
<
LastDate
>
false
</
LastDate
>
</
__isset
>
<
IsSync
>
true
</
IsSync
>
<
FilePath
>
d:\path\资料\thrift文件\thrift文件\testJava.thrift
</
FilePath
>
<
CurrentSeek
>
1297
</
CurrentSeek
>
<
ClientKey
>
8C:89:A5:E1:89:3D
</
ClientKey
>
<
OrderNumber
>
1
</
OrderNumber
>
<
OccurTime
>
2014/1/26 15:32:46
</
OccurTime
>
<
Size
>
0
</
Size
>
</
DataSync
>
<
DataSync
>
<
__isset
>
<
IsSync
>
true
</
IsSync
>
<
FilePath
>
true
</
FilePath
>
<
CurrentSeek
>
true
</
CurrentSeek
>
<
ClientKey
>
true
</
ClientKey
>
<
OrderNumber
>
true
</
OrderNumber
>
<
OccurTime
>
true
</
OccurTime
>
<
Name
>
false
</
Name
>
<
Size
>
false
</
Size
>
<
LastDate
>
false
</
LastDate
>
</
__isset
>
<
IsSync
>
true
</
IsSync
>
<
FilePath
>
d:\path\资料\thrift文件\thrift文件\thrift-0.8.0.exe
</
FilePath
>
<
CurrentSeek
>
4013056
</
CurrentSeek
>
<
ClientKey
>
8C:89:A5:E1:89:3D
</
ClientKey
>
<
OrderNumber
>
1
</
OrderNumber
>
<
OccurTime
>
2014/1/26 15:32:46
</
OccurTime
>
<
Size
>
0
</
Size
>
</
DataSync
>
<
DataSync
>
<
__isset
>
<
IsSync
>
true
</
IsSync
>
<
FilePath
>
true
</
FilePath
>
<
CurrentSeek
>
true
</
CurrentSeek
>
<
ClientKey
>
true
</
ClientKey
>
<
OrderNumber
>
true
</
OrderNumber
>
<
OccurTime
>
true
</
OccurTime
>
<
Name
>
false
</
Name
>
<
Size
>
false
</
Size
>
<
LastDate
>
false
</
LastDate
>
</
__isset
>
<
IsSync
>
true
</
IsSync
>
<
FilePath
>
d:\path\资料\thrift文件\thrift文件\thrift_白皮书.pdf
</
FilePath
>
<
CurrentSeek
>
441217
</
CurrentSeek
>
<
ClientKey
>
8C:89:A5:E1:89:3D
</
ClientKey
>
<
OrderNumber
>
1
</
OrderNumber
>
<
OccurTime
>
2014/1/26 15:32:46
</
OccurTime
>
<
Size
>
0
</
Size
>
</
DataSync
>
<
DataSync
>
<
__isset
>
<
IsSync
>
true
</
IsSync
>
<
FilePath
>
true
</
FilePath
>
<
CurrentSeek
>
true
</
CurrentSeek
>
<
ClientKey
>
true
</
ClientKey
>
<
OrderNumber
>
true
</
OrderNumber
>
<
OccurTime
>
true
</
OccurTime
>
<
Name
>
false
</
Name
>
<
Size
>
false
</
Size
>
<
LastDate
>
false
</
LastDate
>
</
__isset
>
<
IsSync
>
true
</
IsSync
>
<
FilePath
>
d:\path\资料\thrift文件\thrift文件\thrift命令.txt
</
FilePath
>
<
CurrentSeek
>
131
</
CurrentSeek
>
<
ClientKey
>
8C:89:A5:E1:89:3D
</
ClientKey
>
<
OrderNumber
>
1
</
OrderNumber
>
<
OccurTime
>
2014/1/26 15:32:46
</
OccurTime
>
<
Size
>
0
</
Size
>
</
DataSync
>
</
ArrayOfDataSync
>
n个城市里有m条单向路径,每条路径上有一个权值,每个城市都属于且仅属于某一个环,Tom计划环游这n个城市,并且每个城市都只能经过一次。问最后环游了n个城市后最小的权值和是多少。
算法分析:费用流的常见模型,对于初学费用流的我来说,还是挺新鲜的,也参考了其他ACMer的博客。
首先提取出模型:给定一个有向图,要求用若干个环覆盖整个图,并且覆盖的这些环的权值和最小。
建模:源点from和汇点to,拆点 i 为 i 和 i+n。 from->i(w为1,cost为0)(w为1是因为每个城市只能游历一次),i+n->to(w为1,cost为0),对于u->v,连接u->v+n(w为1,cost为路径上的权值)