1011 - 最小路径可重复点覆盖 - Treasure Exploration(POJ 2594)

传送门

 

分析

做了几道这样的题,有没有惊奇的发现,题目中一般都会非常明显的告诉你这是一个有向无环图(“And some points are connected by one-way road, which means that, through the road, a robot can only move from one end to the other end, but cannot move back. For some unknown reasons, there is no circle in this graph”)

也会非常友善的告诉你限制:这是一个可重复点覆盖(“You should notice that the roads of two different robots may contain some same point. ”)

那就用Floyd传递闭包,让本会经过重复的点的两条链,变成不会重复的路径,然后拆点,二分图匹配即可

 

代码

 

RE代码

#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<queue>
#define in read()
#define M 2
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值