POJ3692——Kindergarten

YOLO26涨点改进 | 小目标损失函数独家改进篇 | TGRS 2025 | 引入AdaFocalLoss损失函数,改进小目标检测,自适应聚焦小目标与样本分布不平衡,提升检测精度与训练稳定性 本文提出将AdaFocalLoss损失函数应用于YOLO26模型优化,有效提升小目标检测性能。AdaFocalLoss通过目标尺寸感知机制和IoU引导的动态调节,自动调整训练权重和聚焦程度,解决了样本不平衡问题。相比传统损失函数,它无需手动调参,能增强训练稳定性,在多尺度、复杂场景下表现优异。文章详细介绍了AdaFocalLoss的原理、优势及实现方法,并提供了代码集成指南。实验表明该方法能显著提升检测精度和鲁棒性,特别适用于小目标检测任务。 阅读详情

Description

In a kindergarten, there are a lot of kids. All girls of the kids know each other and all boys also know each other. In addition to that, some girls and boys know each other. Now the teachers want to pick some kids to play a game, which need that all players know each other. You are to help to find maximum number of kids the teacher can pick.

Input

The input consists of multiple test cases. Each test case starts with a line containing three integers
G, B (1 ≤ G, B ≤ 200) and M (0 ≤ M ≤ G × B), which is the number of girls, the number of boys and
the number of pairs of girl and boy who know each other, respectively.
Each of the following M lines contains two integers X and Y (1 ≤ X≤ G,1 ≤ Y ≤ B), which indicates that girl X and boy Y know each other.
The girls are numbered from 1 to G and the boys are numbered from 1 to B.

The last test case is followed by a line containing three zeros.

Output

For each test case, print a line containing the test case number( beginning with 1) followed by a integer which is the maximum number of kids the teacher can pick.

Sample Input

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

Sample Output

Case 1: 3
Case 2: 4

Source

2008 Asia Hefei Regional Contest Online by USTC

题意就是让你找出最多的人,他们之间是相互认识的,条件告诉我们男孩和男孩是相互认识的,女孩也是,而且部分男孩女孩认识,那么我们就可以以男孩为一个集合,女孩为一个集合,然后二分匹配,如果某个男孩和某个女孩不认识,我们就连一条边,进行最大匹配。然后求最大独立集,由于建边的缘故,最大独立集里的点其实是相互认识的。
#include<stdio.h>
#include<string.h>

const int maxn=205;
bool each[maxn][maxn];
struct node
{
	int to;
	int next;
}edge[maxn*maxn];
int head[maxn];
int mark[maxn];
bool used[maxn];
int tot;
int N;
void addedge(int from,int to)
{
	edge[tot].to=to;
	edge[tot].next=head[from];
	head[from]=tot++;
}

bool dfs(int x)
{
	for(int i=head[x];i!=-1;i=edge[i].next)
	{
		if(!used[edge[i].to])
		{
			used[edge[i].to]=1;
			if(mark[edge[i].to]==-1 || dfs(mark[edge[i].to]))
			{
				mark[edge[i].to]=x;
				return true;
			}
		}
	}
	return false;
}

int hungary()
{
	int ans=0;
	memset(mark,-1,sizeof(mark));
	for(int i=1;i<=N;i++)
	{
		memset(used,0,sizeof(used));
		if(dfs(i))
		  ans++;
	}
	return ans;
}

int main()
{
	int G,B,M,icase=1;
	while(~scanf("%d%d%d",&G,&B,&M))
	{
		if(!G && !B && !M)
		  break; 
		memset(each,0,sizeof(each));//数组值为0代表相互不认识 
		memset(head,-1,sizeof(head));
		tot=0;
		N=G;
		int x,y;
		for(int i=1;i<=M;i++)
		{
			scanf("%d%d",&x,&y);
			each[x][y]=1;//相互认识 
		}
		for(int i=1;i<=G;i++)
		  for(int j=1;j<=B;j++)
		  {
  			if(!each[i][j])//相互不认识的连边 
 			 	addedge(i,j);
  		  }
       printf("Case %d: %d\n",icase++,G+B-hungary());
	}
	return 0;
}



出现 Tomcat:HTTP状态 404 - 未找到解决方法(图文分析) 出现如下问题 HTTP状态 404 - 未找到 类型 状态报告 消息 请求的资源[/ajax_war_exploded/]不可用 描述 源服务器未能找到目标资源的表示或者是不愿公开一个已经存在的资源表示。 Apache Tomcat/8.5.69 解决方法如下: 网上中的操作有步操作多数都误导 这个部署的环境目录上面是web.xml 下面的目录路径是web即可不用到webapp 保存重启服务器即可使用 其他配置中启动tomcat的操作具体 JRE 1.8 ... 阅读详情

相关推荐

斯坦福HumanPlus机器人核心技术解析:从HST强化学习框架到HIT模仿学习的实现路径

本文深入解析了斯坦福HumanPlus人形机器人的核心技术实现路径。其核心在于HST强化学习框架与HIT模仿学习架构的协同:HST作为“小脑”,通过rsl_rl框架在仿真中训练稳健的低级运动控制;HIT作为“大脑”,基于改进的Transformer架构学习高级任务规划。文章详细拆解了从算法原理、代码实现到硬件部署的全流程,为复现这一前沿机器人系统提供了实战指南。

weixin_29082143的博客 281

查分+spfa

bzoj2330#include #include #define N 100100 using namespace std; typedef long long ll; struct node { int to; int val; int next; }; node edge[N * 5]; int head[N]; int mp[N]; int d[N]; int

t6x6vy1d0e2o4s的博客 249

2023东华大学机试OJ进阶版1-81题

先排序。每次找两个最小的数,把其中一个置为两数之和,并累加这个和值,另一个数置为-1,然后再排序,重复操作,直到只剩下一个数。105。

m0_49263811的博客 2797

poj3159——Candies

<br />差分约束系统问题<br />果然,普通的dij过不了<br />采用学长的意见,用SPFA+堆栈水过<br />注意:spfa过程中,vis[k]=1重新考虑下一轮是否再入栈<br />#include<stdio.h> #include<string.h> #define max 150005 #define N 30005 #define maxcost 1000000000 struct node { int to,val; int next; }e[max]; i

r_ax的专栏 605

Windows 10/11下Drive Composer Pro 2.9.0完整安装与连接ACS880变频器实战教程

本文详细介绍了在Windows 10/11系统上安装Drive Composer Pro 2.9.0并连接ACS880变频器的完整教程。从系统环境准备、软件安装到许可证配置,再到USB、蓝牙和以太网三种连接方式的实战操作,帮助工业自动化工程师快速掌握ABB变频器的调试技巧。

weixin_32956805的博客 528

奈曼-皮尔逊准则

奈曼-皮尔逊准则 如果各个假设的先验概率P(Hi)(i=0,1)P(H_i)(i=0,1)P(Hi​)(i=0,1)已知,并且每种判决的代价函数已知,这时,可以用贝叶斯准则进行判决。 如果进一步假设正确判决不付出的代价,而错误判决代价相同,即c00=c11=0,c01=c10=1c_{00}=c_{11}=0,c_{01}=c_{10}=1c00​=c11​=0,c01​=c10​=1,这时可以用最小平均错误概率准则进行判决。 在不知道先验概率P(Hi)(i=0,1)P(H_i)(i=0,1)P(Hi​)(

little_soldier的专栏 1万+

POJ 3159 - Candies(查分约束)

题目: http://poj.org/problem?id=3159 题意: 给n个人派糖果,m组数据,(u,v,w)表示u比v的糖果少的个数不超过w,u-v 最后求出n比1最多 多多少糖果。 思路: 查分约束。 对于(u,v,w)小值向大值建边(u,v).由于要一系列满足不等式,所以应该去(u,v)的最小值,所以转换为求最短路。 spfa算法+栈优化。 AC. #i

Halo 599

手把手教你用MATLAB和PSIM搞定Buck电路控制器:从传递函数到运放电路实战

本文详细介绍了如何使用MATLAB和PSIM协同设计Buck电路控制器,从传递函数推导到运放电路实现的完整流程。通过小信号建模、波特图分析和双平台仿真验证,帮助电力电子工程师解决理论到实践的转化难题,提升Buck电路控制器设计的效率和可靠性。

weixin_29271053的博客 269

最短路练习11/poj/3159 【差分约束系统】Candies

没看题解前完全不知道题是啥意思,完全不能把这道题跟最短路联系在一块0.0 题意:现在有一些小朋友,有许多的糖果,给出m组关系;例如1 2 5表示1号小朋友不想让2号小朋友比他多超过5个糖果,2 1 4表示2号小朋友不想让1号小朋友比他多超过4个糖果, 然后列为关系式:a2-a1<=5,a1-a2<=4;求1号小朋友和n号小朋友最多能相差多少糖果; 思路:差分约束系统是什么东东我看了一晚上也没怎么弄明白。就知道这道题是差分约束的裸模板; 看不懂就把它当成最短路就行,例如样例,把样例变成a2<=

Accepted 379

别再到处找教程了!Windows下用FFmpeg+Mediamtx+VLC搭建本地RTSP流媒体服务器,保姆级配置流程

本文详细介绍了在Windows系统下使用FFmpeg、Mediamtx和VLC搭建本地RTSP流媒体服务器的完整流程。从环境准备到核心配置,再到推流和拉流的实战技巧,提供了保姆级的避坑指南和优化建议,帮助开发者快速实现稳定的流媒体服务部署。

weixin_42614269的博客 213

嵌入式视频应用开发者必读:嵌入式Linux+FFmpeg硬件编解码实战指南

在嵌入式Linux上,FFmpeg支持多种硬件加速API,比如VAAPI、VDPAU、CUDA,以及针对特定平台的专用接口(如NVIDIA的NVENC、Intel的QSV、ARM的Mali)。FFmpeg的硬件解码通过-hwaccel参数启用,咱们以常见的H.264和HEVC(H.265)格式为例,展示如何用VAAPI和V4L2实现高效解码。: FFmpeg硬件加速需要额外的库,比如libva(VAAPI)、libv4l2(V4L2)或libnvcodec(CUDA)。

大模型大数据攻城狮的专栏 2205

poj 3159 Candies

poj 3159 Candies Time Limit: 1500MS Memory Limit: 131072K Total Submissions: 28461 Accepted: 7868 DescriptionDuring the kindergarten days, flymouse was the monitor of his class. Occasion

Switch的博客 1097

ESP32-C3入门教程 环境篇②——Windows开发环境准备

文章目录一、注意事项二、下载ESP-IDF工具安装器三、安装内容四、详细安装步骤报错处理 一、注意事项 请注意 ESP-IDF 和 ESP-IDF 工具的安装路径不能超过 90 个字符,安装路径过长可能会导致构建失败。 Python 或 ESP-IDF 的安装路径中一定不能包含空格或括号。 除非操作系统配置为支持 Unicode UTF-8,否则 Python 或 ESP-IDF 的安装路径中也不能包括特殊字符(非 ASCII 码字符、中文字符) 二、下载ESP-IDF工具安装器 ESP-IDF Win

5246

POJ3692——Kindergarten(最大二分匹配)

POJ3692——Kindergarten description: In a kindergarten, there are a lot of kids. All girls of the kids know each other and all boys also know each other. In addition to that, some girls and boys k

WaveBridge的博客 670

最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版

Part-E1-SDIO-Specification-Ver4.00-Final-120220.pdf:最新的sdio 4.0 spec 协议标准 带书签 高清完整PDF版,包括SDIO 接口的外设,SDIO 接口官方协议等。

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

POJ 3692 Kindergarten(最大独立集)

POJ 3692 Kindergarten(最大独立集) http://poj.org/problem?id=3692 题意:        已知班级有g个女孩和b个男孩,所有女生之间都相互认识,所有男生之间也相互认识,给出m对关系表示哪个女孩与哪个男孩认识。现在要选择一些学生来组成一个团,使得里面所有人都认识,求此团最大人数。 分析:        任意两个同学之间要么认识,要么不认识

code 958

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

poj3692_Kindergarten

poj3692_Kindergarten 这题目大意是:男孩互相认识,女孩互相认识,一部分男女之间认识,老师要选一部分人,要求这部分人必须都相互认识。 这是一个二部图,先求出补图,在补图中G‘左右两点有连线说明在G中两者不认识,反之成立。 所以就是在补图中怎样来构造左右两部分间互相之间没有连线的图。============&gt...

weixin_30698297的博客 100

深度学习工具包 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")

POJ 3692 Kindergarten(最大独立集)

POJ 3692 Kindergarten 题目链接 题意:一个班级内,男的都互相认识,女的都互相认识,现在有k对男女互相认识,要求选出最多的人,使得他们两两互相认识 思路:最大独立集,把不认识的连边,就可以求出最大独立集就是两两互相认识的 代码: #include #include #include #include using namespace std;

Remilia's 742

POJ 3692 Kindergarten

POJ 3692 Kindergarten 题目链接:POJ 3692 题意: 在幼儿园,有g个女生,b个男生,女生之间是互相认识的,男生之间也是互相认识的,然后男生女孩之间有m个关系,代表是互相认识的。 从他们之中选取一些出来,使得大家互相认识而且总人数最多。 分析: 转化为补图,补图中有边的说明是不为识的,那么想要剩下的人都认识,就得把边去掉,也就是去掉最少的点使所

小酷Miki的专栏 426

poj3692 Kindergarten

Kindergarten Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 7244 Accepted: 3568 DescriptionIn a kindergarten, there are a lot of kids. All girls of the kids know each other and

樱花满地集于我心,楪舞纷飞祈愿相随 306

【二分图最大独立集】POJ 3692:Kindergarten

一、题目内容 POJ 3692 原题地址 二、题意解释 一群男孩女孩,同性之间都相互认识,但是异性之间只有某些人认识彼此。给出相互认识的异性的各自编号。 求组成一个小队,这个小队里的人都相互认识。问这个小队最多能有多少人。 三、代码及注释 #include<stdio.h> #include<iostream> #include<string.h> using namespace std; /* 把相互不了解的人作为边构建二分图,这样题意是选择相互了解的人,那么是选择二

szy_fasheng的博客 216

POJ3692 Kindergarten

题意 有G个女孩和B个男孩,男生互相认识,女生也互相认识,有M对男生认识女生,现要选出最多的人并且互相认识。 1 ≤G,B≤ 200,0 ≤M≤G×B 题解 但是我们发现,男孩之间都互相认识,女孩之间也互相认识,这样不能划分点集的。 但是男孩之间都互相认识,女孩之间也互相认识,所以男孩和男孩,女孩和女孩之间不存在不认识关系 如果以不认识作为边的话,认识不连边,这样...

weixin_30642029的博客 161

poj 3692 Kindergarten

<br />啊。。这次终于挑相互认识的小盆友出去玩咧。。呵呵。。<br /> <br />女生之间都相互认识,男生之间也是。给你男女认识对数,求出最大数量的小盆友相互都认识。。。<br /> <br />类似于之前那几道,建图,只不过这次匈牙利算法算的是未标记的图,在讨论里见这个叫补图。。。<br /> <br />开始一直不对因为,这个矩阵不是N*N的,因为我的初始化全是0,而最后判断的也是0的点才。。。所以界限需要严格定一下。。。<br /> <br />最后就用总人数减去不认识的最少人数(最小顶点覆盖

小媛在努力~ 1425

[poj3692]Kindergarten

最大团=反图的最大独立集,而反图又恰好是一张二分图,根据二分图的最大独立集=n-最大匹配就可以做了。 1 #include<cstdio> 2 #include<cstring> 3 #define N 405 4 struct ji{ 5 int nex,to; 6 }edge[N*N]; 7 int E,t,n,m,k,x,y...

weixin_30505043的博客 146

POJ3692:Kindergarten

http://poj.org/problem?id=3692 题目大意:有一群男孩,他们互相认识,有一群女孩,她们也互相认识,这些男孩中有以些认识女孩中的某些人,现在找出一群孩子使得他们都认识,并且数目最多。 有题目给定的条件,可以很容易的将其判定为二分图的匹配,但是要从其中找出都互相认识的,并且使得数目最大,比较困难,我们可以逆向思考,找出一个集合使得其中的人数最多,并且集合中的所有人都

BootStar 494

poj 3692 Kindergarten

In a kindergarten, there are a lot of kids. All girls of the kids know each other and all boys also know each other. In addition to that, some girls and boys know each other. Now the teachers want to

---小菜鸟--- 240

poj3692Kindergarten

题意:有G个女生,M个男生,其中女生之间全部ren

u014221090的专栏 428
上一篇: POJ2594-Treasure Exploration
下一篇: POJ2195——Going Home
tokers
博客等级 码龄12年 71粉丝 700原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值