POJ 2226 Muddy Fields 匈牙利算法/最小点覆盖

从OVITO可视化到LAMMPS计算:ATOMSK堆垛层错模型的全流程避坑指南 本文提供了一份从ATOMSK建模、OVITO可视化诊断到LAMMPS计算的堆垛层错模型全流程实战指南。重点解析了构建“计算友好”模型的核心矛盾,并详细演示了如何通过添加真空层、原子包裹和能量最小化等关键步骤,规避周期性边界条件带来的非物理相互作用,确保广义层错能计算的可靠性与可复现性。 阅读详情
题意:农夫John的养牛场,是一个R 行C 列的矩形,一场大雨后,养牛场低洼的地方都有了积水。John 的牛都很娇贵的,他们吃草的时候,不想把他们的蹄子给弄脏了。为了不让牛儿们把它们的蹄子弄脏,John 决定把有水的地方铺上木板。他的木板是宽度为1,长度没有限制的。

他想用最少数目的木板把所有有水的低洼处给覆盖上,前提是木板不能覆盖草地,但是可以重叠。

这道题,构图确实比比较巧妙,如果有连续的低洼处,假设是横排的,那么这几个连续的低洼处可以拿一个板子来覆盖,同样,如果竖排也有连续的低洼处,那么也可以拿一个板子来覆盖。这样,当一个低洼处既可以拿横着的板子,也可以拿竖着的板子覆盖时,就是相交了。那么这个交线就代表了一个低洼处,它既可以被横着盖,也可以被竖着盖。现在我们把所有横排的低洼处作为left(连续的低洼处作为1个板),竖着的也同理,以例题如下表式:
Sample:
4 4
*.*.
.***
***.
..*.

把行里面连在一起的坑连起来视为一个点,即一块横木板,编上序号,Sample则转化为:

1 0 2 0
0 3 3 3
4 4 4 0
0 0 5 0

把这些序号加入X集合,再按列做一次则为:

1 0 4 0
0 3 4 5
2 3 4 0
0 0 4 0

同样加入Y集合,一个坑只能被横着的或者被竖着的木板盖住,将原图的坑的也标上不同的序号,一共九个坑

1 . 2 .
. 3 4 5
6 7 8 .
. . 9 .

图中的2号低洼处既可以拿横着的2号板,也可以拿竖着的4号板来覆盖,那么2号版和四号板之间就有一条边,边实际表示了低洼处,例如2号低洼处的边为{2,4},可以理解为2号低洼处可以由2号板或4号板覆盖。用最少的点把所有的边连起来,这样就是最小点覆盖。

以上来自 http://hi.baidu.com/onlys_c/blog/item/9781e0dd858f2fd28d102919.html

#include <cstring>
#include <iostream>
using namespace std;

char temp[100][100];
bool map[1000][1000],vis[1000];
int U[100][100], V[100][100],match[1000];
int R,C,u,v;

bool find_path ( int r )
{
	for ( int i = 1; i <= v; i++ )
	{
		if ( map[r][i] && !vis[i] )
		{
			vis[i] = true;
			if ( 0 == match[i] || find_path(match[i]) )
			{
				match[i] = r;
				return true;
			}
		}
	}
	return false;
}

int Hungary()
{
	int ans = 0;
	for ( int i = 1; i <= u; i++ )
	{
		memset(vis,0,sizeof(vis));
		if ( find_path ( i ) )
			ans++;
	}
	return ans;
}

void construct ()
{
	int i,j;
	memset(map,0,sizeof(map));
	memset(match,0,sizeof(match));
    u = v = 0;
	
	for ( i = 1; i <= R; i++ )
		for ( j = 1; j <= C; j++ )
			cin >> temp[i][j];
		
		for ( i = 1; i <= R; i++ )
		{
			for ( j = 1; j <= C; j++ )
			{
				if ( temp[i][j] == '*' )
				{
					u++;
					while ( j <= C && temp[i][j] == '*' )
					{
						U[i][j] = u;
						j++;
					}
				}
			}
		}
		for ( j = 1; j <= C; j++ )
		{
			for ( i = 1; i <= R; i++ )
			{
				if ( temp[i][j] == '*' )
				{
					v++;
					while ( i <= R && temp[i][j] == '*' )
					{
						V[i][j] = v;
						i++;
					}
				}
			}
		}
		
		for ( i = 1; i <= R; i++ )
		{
			for ( j = 1; j <= C; j++ )
			{
				if ( temp[i][j] == '*' )
					map[U[i][j]][V[i][j]] = true;
			}
		}
}

int main()
{
	cin >> R >> C;
	construct();
	cout << Hungary() << endl;
	return 0;
}


【护网必备】Windows平台shellcode免杀加载器 bypass:McAfee、金山(数字签名)、火绒、ESET、卡巴企业版(时间5s 抖动50 Sleep_mask)、360全家桶(物理机)、Norton(加白程序资源)、WDF(PC)、WDF(Server)、Symantec(加白程序资源)bypass:金山(数字签名)、火绒、ESET、360全家桶(物理机)、WDF(PC)、WDF(服务器提示复查(关云保护))、McAfee、Norton(加白程序资源)、卡巴企业版(时间5s 抖动50 Sleep_mask)必须使用Bof操作,shell运行就掉线。 阅读详情

相关推荐

MPC模型预测控制实战:从理论到代码实现(Python示例)

本文详细介绍了MPC模型预测控制的实战应用,从理论到Python代码实现。通过构建系统模型、预测方程、优化问题及约束处理,展示了如何实现一个完整的MPC控制器。文章还提供了水箱液位控制的应用案例,帮助读者掌握MPC在工业控制中的实际应用。

weixin_42653691的博客 466

Muddy Fields(二分图最大匹配 + 匈牙利算法)

  Muddy Fields Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 7569   Accepted: 2794 Description Rain has pummeled the cows' field, a rectangular grid of R rows an...

Simone chou... 1128

二、时间序列的预处理

一般情况下,拿到一个观察值序列之后,首先要对它的平稳性和纯随机性进行检验,这两个重要的检验称为序列的预处理。根据检验的结果可以将序列分为不同的类型,对不同类型的序列我们会采用不同的分析方法。 一、平稳性检验 1、特征统计量 (1)概率分布           数理统计的基础知识告诉我们分布函数或者密度函数能够完整地描述一个随机变量的统计特征。同样,一个堆积变量族{Xt} 的统计特征也完全由...

Nicole的博客 2万+

2226 Muddy Fields:木板填泥地,二分图最少定点覆盖-图解+分析

题目描述 思路分析 可以先看一道基础题,和这道题非常类似。在基础题中,我们将行/列分开作为二分图的点,如果某个坐标(x,y)上有个小行星,那么我们将x与y进行连接,也就意味着要么我们在横坐标位x的一行整一下,要么在纵坐标为y的一列整一下,如此这般,只要我们的所有边都至少有一个点连接,所有的小行星就都嗝屁了,于是问题转化为二分图最大匹配问题(最大匹配=最小顶点覆盖) 如果你理解上上面的意思,那么...

csyifanZhang的博客 550

基于NE555的触摸延时开关电路设计与实现

本文详细介绍了基于NE555芯片的触摸延时开关电路设计与实现方法。通过分析NE555的单稳态工作模式,结合定时电阻、电解电容等关键元件选型,提供了一套完整的电路搭建方案。文章还包含抗干扰设计、调试技巧及常见故障处理,帮助电子爱好者快速掌握触摸延时灯的制作要点。

weixin_29268267的博客 803

第十五届蓝桥杯省赛C/C++B组H题【拔河】题解(AC)

由于枚举三个点肯定会超时,所以只能枚举两个点,我们尝试枚举第一个区间。的复杂度,需要找出右区间中和左区间的和最相近的值,可以考虑使用。一开始,我们将所有可能的右区间的区间和,都插入。做法同上,用前缀和优化数组求和的过程。的数组和差值最小是多少,其中。递增进行枚举左区间,当。的数组,求两个子数组。为左端点的区间的和。

一只大采集~ 5286

【最小顶点覆盖】POJ 2226

这题跟POJ 3041有点区别,这里不是一整行一整行地消灭,是某几个连续的格子一起消灭,因此构图的时候要注意,从上到下把每行连续的从1开始标号,作为左集合,从左到右把每列连续的从1开始编号,作为右集合,接着就匈牙利算法求最大匹配数=最小顶点覆盖数,这里有点诡异,左右集合各自的编号数最大竟然多于50*50,要把数组开大点 #include #include #include #include

leolin_的专栏 760

【学长笔记】关于车牌识别的CCPD数据集按比例划分

本文介绍了一个用于CCPD车牌数据集划分的Python脚本,主要功能包括:1) 将数据集按比例划分为训练集、验证集和测试集;2) 支持图像与标签文件校验;3) 可自定义划分比例和样本数量限制;4) 自动生成标准目录结构。脚本使用随机种子确保可重复性,并通过tqdm显示进度条。处理后数据可直接用于YOLO等目标检测模型的训练与评估,建议在预处理完成后立即执行划分以避免数据泄露。文章还提供了相关技术博客的参考链接。

apple_53308981的博客 1489

PKU 2226 - Muddy Fields (最小点覆盖)

题意 用最少的木板覆盖。 思路 很有意思的建图。横着标号,然后竖着标号,建边,求最小点覆盖。 代码 #include #include #include #include #include #include #include #include #include #include #include #include #include #include

一只冰熊 973

基于MCP协议的AssistAI:深度集成Eclipse的AI编程助手实战指南

在AI辅助编程领域,大型语言模型(LLM)与开发工具的深度集成是提升开发效率的关键。其核心原理在于通过标准化的协议(如MCP,Model Context Protocol),将IDE的功能封装为AI可调用的工具集,从而实现环境感知与操作同步。这项技术的价值在于打破了传统AI编程工具与开发者工作流的割裂,使AI能够以符合工程规范的方式直接操作项目,如进行代码重构、运行测试和交互式调试。其典型应用场景包括复杂代码导航、自动化测试生成与精准的增量编译。本文以Eclipse插件AssistAI为例,详细解析了如何通

weixin_42531579的博客 572

【AI智能体】Codex 生成高质量电商套图实战操作详解

Codex 生成高质量电商套图实战操作详解

congge 4595

POJ 2226 Muddy Fields

Muddy Fields Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 6798   Accepted: 2506 Description Rain has pummeled the cows' field, a rectangular grid of R rows ...

weixin_33713350的博客 130

YOLOv8训练流程-原理解析[目标检测理论篇]

本篇文章主要介绍了YOLOv8训练的流程,主要介绍了Task Aligned Assigner正负样本匹配策略以及YOLOv8的损失计算。

ice 4527

POJ_2226 Muddy Fields(最小点覆盖)

Muddy Fields Time Limit: 1000MS Memory Limit: 65536K Problem Description Rain has pummeled the cows’ field, a rectangular grid of R rows and C columns (1 <= R <= 50, 1 <= C <= 50). While...

sigh_的博客 253

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

【poj2226】Muddy Fields 二分图

DescriptionRain has pummeled the cows’ field, a rectangular grid of R rows and C columns (1 <= R <= 50, 1 <= C <= 50). While good for the grass, the rain makes some patches of bare earth quite muddy. T

DQS的树洞 1100

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

POJ 2226 Muddy Fields(最小点覆盖)题解

题意:一片r*c的地,有些地方是泥地,需要铺地板。这些地板宽1,长无限,但只能铺在泥地上不能压到其他地方,问你铺满所有泥地最少几块 思路:我们把一行中连续的泥地看成整体,并把所有横的整体里的点编成一个id号,同样把竖的所有整体编号,这样一个点就有横竖两个编号,那么我给这两个编号连边,那么只要涂这个边就代表了这个点被模板盖住了,那么问题就转化为了最小点覆盖 思路:poj2226-Mud...

weixin_30802171的博客 85

poj 2226 Muddy Fields(最小覆盖点+构图)

http://poj.org/problem?id=2226 Muddy Fields Time Limit:1000MS Memory Limit:65536K Total Submissions:9022 Accepted:3348 Description Rain has pummeled the cows'...

deyou1988的专栏 188

poj2226-Muddy Fields

题目 给到一个矩阵,有些格子上是草,有些是水。需要用宽度为1,长度任意的若干块木板覆盖所有的水,并不能覆盖草,木板可以交叉,但只能横竖放置,问最少要多少块板。 分析 经典的矩阵二分图构图和最小点覆盖。 无非就是两种方向,横向和竖向。我们把水块连续的编成同一号,那么对于一个点,它会有一个横向编号和纵向编号。我们要覆盖这个点,只需要覆盖这条边即可。于是问题转化成了一个最小点覆盖问题,即在二...

dengtan9179的博客 148

POJ 2226 Muddy Fields 最小点覆盖+加建图(好题)

题目链接 题目一看就是最小点覆盖,这道题与POJ - 3041 算是一类题,但是3041算是一道十分裸的,因为删除的是整行或者整列,所以图其实是现成的,但是本题的难点就在如何建图。 思路:首先还是尽量去建立行与列之间的关系去构造出一条边,因为我们不能将 ※ 以外的点给连接起来,所以二分图的左右的含义不再是简单的行和列,我们需要将行分块以及列分块,就比如离散的思想一样,将每一行分成几块,列也是相...

swust5120171204的博客 211

POJ2226 Muddy Fields 二分图求最小覆盖点

POJ2226 Muddy Fields 二分图求最小覆盖点

NNDXNM的专栏 675

poj 2226 Muddy Fields

匈牙利算法

我要吃熊猫 370

poj 2226 Muddy Fields(最小点覆盖+巧妙构图)

Description Rain has pummeled the cows' field, a rectangular grid of R rows and C columns (1 <= R <= 50, 1 <= C <= 50). While good for the grass, the rain makes some patches o...

dielucuan8830的博客 162

【二分图】poj 2226 Muddy Fields

这题一知半解。。。

Gzbgreat的博客 448

POJ 2226 Muddy Fields(最小点覆盖)

POJ 2226 Muddy Fields 题目链接 题意:给定一个图,要求用纸片去覆盖'*'的位置,纸片可以重叠,但是不能放到'.'的位置,为最少需要几个纸片 思路:二分图匹配求最小点覆盖,和放车那题基本一样,就是注意要预处理一下行列,把连续横的'*'当成一行,竖的'*'当成一列,建图跑最小点覆盖即可 代码: #include #include #include

Remilia's 940

POJ - 2226 Muddy Fields(最小点覆盖-二分图最大匹配)

题目链接:点击查看 题目大意:给出一个n*m的地图,地图中‘*’代表泥地,‘.’代表空地,现在我们有两种木板,一种可以覆盖一行中的任意长度,我们成为行木板,另一种可以覆盖一列中的任意长度,我们成为列木板,但这两种木板都不能覆盖空地,现在要求用最少的木板覆盖所有泥地 题目分析:因为每一个方格都有两种方案被覆盖,即一种是被行木板覆盖,一种是被行木板所覆盖,一种是被列木板所覆盖,这样一来我们就可以将...

Falcon的博客 457

POJ 2226 Muddy Fields (最小点覆盖)

题意:一个row*col的矩阵表示一块田地,'*'表示湿地,'.'表示草地。现在FJ要在田地上铺木板盖掉所有的湿地,露出所有的草地。每块木板的宽度为1,长度为任意长。问FJ最少用几块木板就可以完成任务? 思路:匈牙利算法的最小点覆盖。将每行所含有的每一段做为一侧的点,将每列所含有的每一段作为另一侧的点,就是对每一段'*'赋给一个新的x,y坐标,使得不同的段x,y不同。 #i

Ezereal的博客 376
上一篇: POJ 3041 Asteroids 匈牙利算法/最小点覆盖
下一篇: POJ 2182 Lost Cows 线段树
ConwayTian
博客等级 码龄15年 173粉丝 339原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值