给你一张有向无向混合图,要求你为无向边定向,使得图上没有环。 开始看到被卡了,考虑tarjan但是又有无向边又有有向边的确不是很好做 考虑全部是有向图但是没有环的DAG图,一般我们的判定方式都是用拓扑排序 但是如果你把边全部搞进来,发现没法排,怎么办呢? 思路在于你看到其实无向边是转化成有向边的,所 ...
分类:
其他好文 时间:
2018-08-24 10:59:48
阅读次数:
162
Hotel Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 20468 Accepted: 8924 Description The cows are journeying north to Thunder Bay in Cana ...
分类:
其他好文 时间:
2018-08-24 02:12:33
阅读次数:
178
Description It is a little known fact that cows love apples. Farmer John has two apple trees (which are conveniently numbered 1 and 2) in his field, e ...
分类:
移动开发 时间:
2018-08-23 20:12:10
阅读次数:
197
嘟嘟嘟 一看n那么小,那一定是状压dp了(表示从没写过,慌)。 首先dp[i][j](i 是一个二进制数,第x位为1代表选了第x头牛),表示 i 这个状态最后一头牛是第 j 头牛时的方案数。 然后当 j 被选上时,即 if(i & (1 << (j - 1)))时,我们在枚举倒数第二头牛p,也是当他 ...
分类:
其他好文 时间:
2018-08-23 16:51:53
阅读次数:
189
完全体网络流。。 拿vector实现了一次,这样的话网络流的所有实现方法我都写过一遍了 ...
分类:
其他好文 时间:
2018-08-23 02:06:55
阅读次数:
152
Description Farmer John is assigning some of his N (1 <= N <= 25,000) cows to do some cleaning chores around the barn. He always wants to have one cow ...
分类:
其他好文 时间:
2018-08-22 11:10:48
阅读次数:
185
Description Farmer John commanded his cows to search for different sets of numbers that sum to a given number. The cows use only numbers that are an i ...
分类:
其他好文 时间:
2018-08-20 21:54:39
阅读次数:
147
Apple Catching Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 15231 Accepted: 7465 Description It is a little known fact that cows love ap ...
分类:
移动开发 时间:
2018-08-20 21:42:24
阅读次数:
185
Language: Default Cow Bowling Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 22568 Accepted: 14886 Description The cows don't use actual b ...
分类:
其他好文 时间:
2018-08-20 20:38:09
阅读次数:
284
Cleaning Shifts Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 4245 Accepted: 1429 Description Farmer John's cows, pampered since birth, h ...
分类:
其他好文 时间:
2018-08-19 18:25:48
阅读次数:
228