• 「BZOJ4031」[HEOI2015] 小Z的房间

    「BZOJ4031」[HEOI2015] 小Z的房间

    Description你突然有了一个大房子,房子里面有一些房间。事实上,你的房子可以看做是一个包含n*m个格子的格状矩形,每个格子是一个房间或者是一个柱子。在一开始的时候,相邻的格子之间都有墙隔着。你想要打通一些相邻房间的墙,使得所有房间能够互相到达。在此过程中,你不能把房子给打穿,或者打通柱子(以及柱子旁边的墙)。同时,你不希望在房子中有小偷的时候会很难抓,所以你希望任意两个房间之间都只有一条通路。现在,你希...

    02015年4月30日4,916矩阵树定理
  • 「SPOJ104」Highways

    「SPOJ104」Highways

    DescriptionInsomecountriesbuildinghighwaystakesalotoftime...Maybethat'sbecausetherearemanypossiblitiestoconstructanetworkofhighwaysandengineerscan'tmakeuptheirmindswhichonetochoose.Supposewehavealistofcitiesthatcanbeconnecteddirectly.Yourtaskistocounthowmanywaystherearetobuildsuchanetworkthatbetweeneverytwocitiesthereexistsexactlyonepath.Twonetworksdifferiftherearetwocitiesthatareconnecteddi...

    02015年4月29日3,237矩阵树定理