二分图
jiangjiashi
这个作者很懒,什么都没留下…
展开
-
Air Raid (P1422)
题意: 有N个城市,有M个街道,是单向的,且无回路。 现在要空降一些民来检察完两一个城市。 问至少要多少人。 解法: 用匈牙利算法得到的是,可以节约到的城市。 直觉告诉我就套模板,然后相减就行,自己的理解相当肤浅,无奈。 #include #include using namespace std; //freopen("原创 2012-08-01 16:50:03 · 767 阅读 · 0 评论 -
Machine Schedule (P1325)
第一次接触这样的题, #include #include #include using namespace std; //freopen("C://i.txt","r",stdin); #define N 301 int n,m,k; bool map[N][N]; int vist[N]; int y[N]; bool SearchPath(int x) { int i转载 2012-07-30 23:24:53 · 443 阅读 · 0 评论 -
Coursrs (P1469)
题意: 有P门课,有N个学生,学生可以选 多个课,也可以不选 ,现在要在每一门先这课的人里面选一个学生 做为颗代表。问是否每一门都有代表。 解法:用匈牙利算法(虽然不会用,只会套一下模板),用计算得到的需要匹配的数与课程数相等就行 #include #include using namespace std; //freopen("C://i.txt","r原创 2012-07-31 16:52:27 · 605 阅读 · 0 评论 -
(floyd+最小路径覆盖) Treasure Exploration (P2594)
这个就是最小路径覆盖。不过不同的机器人可以走重复的点。。 在这里就用floyd来解决这一个问题。 #include #include using namespace std; //freopen("C://i.txt","r",stdin); #define N 554 int p,n; int m; bool vist[N]; int y[N]; bool map[N][N];原创 2012-08-01 17:27:50 · 495 阅读 · 0 评论