On Octorber 21st, HDU 50-year-celebration, 50-color balloons floating around the campus, it's so nice, isn't it? To celebrate this meaningful day, the ACM team of HDU hold some fuuny games. Especially, there will be a game named "crashing color ballo…
题目237 题目信息 pid=237" style="text-decoration:none; color:rgb(55,119,188)">执行结果 本题排行 讨论区 游戏高手的烦恼 时间限制:1000 ms  |  内存限制:65535 KB 难度:5 描写叙述 有一位传说级游戏高手.在闲暇时间里玩起了一个小游戏,游戏中,一个n*n的方块形区域里有很多敌人.玩家能够使用炸弹炸掉某一行或者某一列的全部敌人. 他是种玩什么游戏都想玩得非常优秀的人.所以.他决定.使用尽…
原题 本题为最小点覆盖,而最小点覆盖=最大二分图匹配 //最小点覆盖:用最少的点(左右两边集合的点)让每条边都至少和其中一个点关联. #include<cstdio> #include<cstring> #define N 510 using namespace std; int edge[N][N],n,m,lover[N],ans; bool vis[N]; bool find(int x) { for (int i=1;i<=n;i++) if (edge[x][i]…
[pixiv] https://www.pixiv.net/member_illust.php?mode=medium&illust_id=54859604 向大(hei)佬(e)势力学(di)习(tou) 二分图其实早就学了,可是无赖自己当初没好好听讲,变种就不说了,连匈牙利算法都不会.这次给了我一个好好复习改过自新的机会,既把匈牙利搞熟了,也算是理解了一些变种. 最小路径覆盖: 题意 用最少的出租车送完所有的乘客 将时间上可以接上的乘客连边 在一个图中,希望用最少的路径将所有点走遍,为什么…
题意即求一个最小顶点覆盖. 对于没有孤立点的图G=(V,E),最大独立集+最小顶点覆盖= V.(往最大独立集加点) 问题可以变成求树上的最大独立集合. 每个结点的选择和其父节点选不选有关, dp(u,1)表示父节点选,这时u不可选, dp(u,0)表示父节点不选,这时u可选可不选. #include<bits/stdc++.h> using namespace std; ; ]; ], clk; ],to[maxn<<],ec; void add(int u,int v) { to…
搬运工 ★ 输入文件:worker.in 输出文件:worker.out 简单对比 时间限制:1 s 内存限制:256 MB [题目描述] 小涵向小宇推荐了一款小游戏. 游戏是这样的,在一个n*n的地图中,有若干个格子上有障碍物.你需要雇佣搬运工,将这些障碍物全部清除.不过每次操作你只能让搬运工将某一行或者某一列的障碍物全部清除.如果你让搬运工清除第i行障碍物,需要付出ai元:如果你让搬运工清除第j列障碍物,需要付出bj元. 小涵告诉小宇,必须用尽可能少的次数消除这些障碍物.若有多种方案,则必须…
Bob enjoys playing computer games, especially strategic games, but sometimes he cannot find the solution fast enough and then he is very sad. Now he has the following problem. He must defend a medieval city, the roads of which form a tree. He has to…
大意: 给定棋盘, 每次消除一行或一列, 求最小次数使得消除完所有'*'. 裸的二分图最小点覆盖. 二分图的最小点覆盖等于最大匹配, 输出方案时从所有左部未盖点开始标记交替路上的点, 最后左部所有未标记的点加上右部所有标记的点即为最小点覆盖. #include <iostream> #include <sstream> #include <algorithm> #include <cstdio> #include <math.h> #includ…
50 years, 50 colors Problem Description On Octorber 21st, HDU 50-year-celebration, 50-color balloons floating around the campus, it's so nice, isn't it? To celebrate this meaningful day, the ACM team of HDU hold some fuuny games. Especially, there wi…
50 years, 50 colors Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Problem Description On Octorber 21st, HDU 50-year-celebration, 50-color balloons floating around the campus, it's so nice, isn't it? To celebrate…