文件名称:white_black
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:367.32kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
1、问题描述
设平面上分布着n个白点和n个黑点,每个点用一对坐标(x, y)表示.一个黑点b=(xb,yb)支配一个白点w=(xw, yw)当且仅当xb>=xw和yb>=yw.若黑点b支配白点w,则黑点b和白点w可匹配(可形成一个匹配对).在一个黑点最多只能与一个白点匹配,一个白点最多只能与一个黑点匹配的前提下,求n个白点和n个黑点的最大匹配对数.
2、具体要求
要求:时间效率在O(NlgN)
3、实现方法
基于贪心算法
以x坐标的升序对黑点排序(可用QUICKSORT或者HEAPSORT),对白点生成一个小根堆!-1 Descr iption of the problem based on the distribution of plane n-n-white spots and black spots, each point with a pair of coordinates (x, y) said. A black point b = (xb, yb) dominating a white point w = ( xw, yw) if and only if xb> = xw and yb> = yw. If the black point b dominant white w, then the black point and white point w b can match (which can form a matched pair). in a black spot at most can only be matched with a white spot, a white point can only match with the premise of a black point, find the n-n-white spots and black spots on the maximum number of matches. 2, specific requirements requirements: time efficiency in the O ( NlgN) 3, Implementation of the greedy algorithm based on x coordinates in ascending order of black spots (available QUICKSORT or HEAPSORT), generating a small white spot root heap!
设平面上分布着n个白点和n个黑点,每个点用一对坐标(x, y)表示.一个黑点b=(xb,yb)支配一个白点w=(xw, yw)当且仅当xb>=xw和yb>=yw.若黑点b支配白点w,则黑点b和白点w可匹配(可形成一个匹配对).在一个黑点最多只能与一个白点匹配,一个白点最多只能与一个黑点匹配的前提下,求n个白点和n个黑点的最大匹配对数.
2、具体要求
要求:时间效率在O(NlgN)
3、实现方法
基于贪心算法
以x坐标的升序对黑点排序(可用QUICKSORT或者HEAPSORT),对白点生成一个小根堆!-1 Descr iption of the problem based on the distribution of plane n-n-white spots and black spots, each point with a pair of coordinates (x, y) said. A black point b = (xb, yb) dominating a white point w = ( xw, yw) if and only if xb> = xw and yb> = yw. If the black point b dominant white w, then the black point and white point w b can match (which can form a matched pair). in a black spot at most can only be matched with a white spot, a white point can only match with the premise of a black point, find the n-n-white spots and black spots on the maximum number of matches. 2, specific requirements requirements: time efficiency in the O ( NlgN) 3, Implementation of the greedy algorithm based on x coordinates in ascending order of black spots (available QUICKSORT or HEAPSORT), generating a small white spot root heap!
(系统自动生成,下载前可以参看下载内容)
下载文件列表
2008301500209:黑白点问题/1.cpp
2008301500209:黑白点问题/1.dsp
2008301500209:黑白点问题/1.dsw
2008301500209:黑白点问题/1.ncb
2008301500209:黑白点问题/1.opt
2008301500209:黑白点问题/1.plg
2008301500209:黑白点问题/2008301500209:黑白点问题/1.cpp
2008301500209:黑白点问题/2008301500209:黑白点问题/1.dsp
2008301500209:黑白点问题/2008301500209:黑白点问题/1.dsw
2008301500209:黑白点问题/2008301500209:黑白点问题/1.ncb
2008301500209:黑白点问题/2008301500209:黑白点问题/1.opt
2008301500209:黑白点问题/2008301500209:黑白点问题/1.plg
2008301500209:黑白点问题/2008301500209:黑白点问题/Debug/1.exe
2008301500209:黑白点问题/2008301500209:黑白点问题/Debug/1.ilk
2008301500209:黑白点问题/2008301500209:黑白点问题/Debug/1.obj
2008301500209:黑白点问题/2008301500209:黑白点问题/Debug/1.pch
2008301500209:黑白点问题/2008301500209:黑白点问题/Debug/1.pdb
2008301500209:黑白点问题/2008301500209:黑白点问题/Debug/vc60.idb
2008301500209:黑白点问题/2008301500209:黑白点问题/Debug/vc60.pdb
2008301500209:黑白点问题/2008301500209:黑白点问题/resource.h
2008301500209:黑白点问题/2008301500209:黑白点问题/Script1.rc
2008301500209:黑白点问题/2008301500209:黑白点问题/Script2.rc
2008301500209:黑白点问题/Debug/1.exe
2008301500209:黑白点问题/Debug/1.ilk
2008301500209:黑白点问题/Debug/1.obj
2008301500209:黑白点问题/Debug/1.pch
2008301500209:黑白点问题/Debug/1.pdb
2008301500209:黑白点问题/Debug/vc60.idb
2008301500209:黑白点问题/Debug/vc60.pdb
2008301500209:黑白点问题/resource.h
2008301500209:黑白点问题/Script1.rc
2008301500209:黑白点问题/Script2.rc
2008301500209:黑白点问题/2008301500209:黑白点问题/Debug
2008301500209:黑白点问题/2008301500209:黑白点问题
2008301500209:黑白点问题/Debug
2008301500209:黑白点问题
2008301500209:黑白点问题/1.dsp
2008301500209:黑白点问题/1.dsw
2008301500209:黑白点问题/1.ncb
2008301500209:黑白点问题/1.opt
2008301500209:黑白点问题/1.plg
2008301500209:黑白点问题/2008301500209:黑白点问题/1.cpp
2008301500209:黑白点问题/2008301500209:黑白点问题/1.dsp
2008301500209:黑白点问题/2008301500209:黑白点问题/1.dsw
2008301500209:黑白点问题/2008301500209:黑白点问题/1.ncb
2008301500209:黑白点问题/2008301500209:黑白点问题/1.opt
2008301500209:黑白点问题/2008301500209:黑白点问题/1.plg
2008301500209:黑白点问题/2008301500209:黑白点问题/Debug/1.exe
2008301500209:黑白点问题/2008301500209:黑白点问题/Debug/1.ilk
2008301500209:黑白点问题/2008301500209:黑白点问题/Debug/1.obj
2008301500209:黑白点问题/2008301500209:黑白点问题/Debug/1.pch
2008301500209:黑白点问题/2008301500209:黑白点问题/Debug/1.pdb
2008301500209:黑白点问题/2008301500209:黑白点问题/Debug/vc60.idb
2008301500209:黑白点问题/2008301500209:黑白点问题/Debug/vc60.pdb
2008301500209:黑白点问题/2008301500209:黑白点问题/resource.h
2008301500209:黑白点问题/2008301500209:黑白点问题/Script1.rc
2008301500209:黑白点问题/2008301500209:黑白点问题/Script2.rc
2008301500209:黑白点问题/Debug/1.exe
2008301500209:黑白点问题/Debug/1.ilk
2008301500209:黑白点问题/Debug/1.obj
2008301500209:黑白点问题/Debug/1.pch
2008301500209:黑白点问题/Debug/1.pdb
2008301500209:黑白点问题/Debug/vc60.idb
2008301500209:黑白点问题/Debug/vc60.pdb
2008301500209:黑白点问题/resource.h
2008301500209:黑白点问题/Script1.rc
2008301500209:黑白点问题/Script2.rc
2008301500209:黑白点问题/2008301500209:黑白点问题/Debug
2008301500209:黑白点问题/2008301500209:黑白点问题
2008301500209:黑白点问题/Debug
2008301500209:黑白点问题
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.