hdu1179——Ollivanders: Makers of Fine Wands since 382 BC.

CH382 PCIE 串口卡驱动程序 CH382 PCIE转双串口卡PC机驱动程序,测试非常好用。 立即下载

Ollivanders: Makers of Fine Wands since 382 BC.

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others)
Total Submission(s): 964    Accepted Submission(s): 539


Problem Description
In Diagon Alley ,there is only one Wand-seller,peeling gold letters over the door read Ollivanders: Makers of Fine Wands since 382 BC.A single wand lay on a faded purple cushion in the dusty window.
A tinkling bell rang somewhere in the depths of the shop as they stepped inside.It was a tiny place,empty execpt for a single spindly chair which Hagrid sat on to wait.Harry felt strangely as though he had entered a very strict library;he swallowd a log of new questions which had just occurred to him and looked instead at the thousands of narrow boxes piled neatly right up to the ceiling.For some reason,the back of his neck prickled.The very dust and silence in here seemed to tingle with some secret magic.
'Good afternoon,'said a soft voice.Harry jumped.Hagrid must have jumped,too,because there was a loud crunching noise and he got quickly off the spindly chair.
An old man was standing before them, his wide pale eyes shining like moons through the gloom of the shop.
'Hello,' said Harry awkwardly.
'Ah yes,' said the man. 'Yes,yes. I thought I'd be seeing you soon,Harry Potter.'It wasn't a question.You have your mother's eyes. It seems only yesterday she was in here herself,buying her first wand. Ten and a quarter inches long, swishy, made of willow. Nice wand for charm work.'
Mor Ollivander moved closer to Harry.Harry wished he would blink.Those sivery eyes were a bit creepy.
'Your father, on the other hand, favoured a mahogany wand.Eleven inches.Pliable.A little more power and excellent for transfiguration.Well ,I say your father favoured it - it's really the wand that choosed the wizard, of cource.'

Yes, some wands fit some wizards ,as we all know.But what Harry doesn't know is Ollivander have met a big trouble.That's more than twenty years ago,When Harry's father James Potter was still a student in Hogwarts.He went Diagon Alley to buy new books,passing by Ollivander's shop.Ollivander was crazy for a problem:He was too busy to choose most suitable wand for every wizard.Even more,there are too many customer that day.Though Ollivader knew every wand's favourite,he could not choose as many wizards as possible to get the wands. So James Potter,a very clever man ,gave him a magic disk with your program ,to help him sell wands as many as possible.

Please notice: one wand can only be sold to one wizard, and one wizard can only buy one wand,too.
 

Input
There are several cases. For each case, there is two integers N and M in the first line,which mean there is N wizards and M wands(0 < N <= M <= 100).
Then M lines contain the choices of each wand.The first integer in i+1th line is Ki,and after these there are Ki integers Bi,j which are the wizards who fit that wand. (0<=Ki<=N,1<=Bi,j<=N)
 

Output
Only one integer,shows how many wands Ollivander can sell.
 

Sample Input
  
3 4 3 1 2 3 1 1 1 1 0
 

Sample Output
  
2
Hint
Hint
Wand 1 fits everyone, Wand 2,3 only fit the first wizard,and Wand 4 does not fit anyone.So Ollivanders can sell two wands: sell Wand 1 to Wizard 2 and Wand 2 to Wizard 1,or sell Wand 1 to Wizard 3 and Wand 3 to Wizard 1 ,or some other cases. But he cannot sell 3 wands because no 3 wands just fit 3 wizards.
 

Source
 

Recommend
JGShining   |   We have carefully selected several similar problems for you:   1528  1507  1287  3338  1569


题目么那么长,有用的就是最后一段,告诉你魔杖适合的巫师,然后让你求出最多可以做多少个巫师的生意

明显的二分匹配,比如魔杖i适合巫师j,那么就从j连一条边到i,然后求个最大匹配就行了

#include <map>  
#include <set>  
#include <list>  
#include <stack>  
#include <queue>  
#include <vector>  
#include <cstdio>  
#include <cmath>  
#include <cstring>  
#include <iostream>  
#include <algorithm>  
  
using namespace std;

const int N = 110;
int mark[N];
bool vis[N];

struct node
{
	int next;
	int to;
}edge[N * N];
int head[N];
int tot;

void addedge(int from, int to)
{
	edge[tot].to = to;
	edge[tot].next = head[from];
	head[from] = tot++;
}

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

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

int main()
{
	int n, m;
	while (~scanf("%d%d", &n, &m))
	{
		memset (head, -1, sizeof(head) );
		tot = 0;
		int k, j;
		for (int i = 1; i <= m; i++)
		{
			scanf("%d", &k);
			while (k--)
			{
				scanf("%d", &j);
				addedge(j, i);
			}
		}
		int ans = hungary(n);
		printf("%d\n", ans);
	}
	return 0;
}


 
DW-TX382-1并1串专用驱动.zip 串口驱动程序串口驱动程序串口驱动程序串口驱动程序串口驱动程序串口驱动程序 立即下载

相关推荐

DW-TX382系列驱动

DW-TX382系列驱动

DW-TX382-1并1串专用驱动-PCI转RS232工控解决方案

是一个压缩文件,包含了特定硬件设备的驱动程序,即DIEWU公司生产的PCI转1并1串COM口RS232 9针设备的PCI扩展卡工控卡。这类硬件通常用于工控计算机系统中,用于将计算机的一个并行端口转换为一个串行端口(COM口),以便连接RS232标准的串行设备,如调制解调器、POS机等。 从标题和描述中,我们可以提取出以下知识点: 1. PCI扩展卡:PCI(Peripheral Component Interconnect)是一种早期的计算机总线标准,用于连接主板和各种外部设备。PCI扩展卡是插在计算机主板的PCI插槽中的硬件卡,用于扩展计算机的功能。在本例中,该扩展卡用于提供额外的串行通信接口。 2. 工控卡:工业控制卡(Industrial Control Card),简称工控卡,是一种用于工业自动化领域的计算机硬件扩展卡。它能够实现对工业设备的实时监控和控制,并能承受恶劣的工作环境。 3. 串行通信接口:串行通信接口,即串行端口(Serial Port),是一种用于串行数据传输的接口。常见的串行通信标准有RS232、RS485等。在本例中,该PCI扩展卡提供了RS232标准的9针串行端口。 4. 并行端口转换为串行端口(COM口):早期计算机系统中,标准的并行端口主要用于打印机连接,而随着技术的发展,串行端口因为其更高的稳定性和兼容性成为了更广泛使用的通信接口。通过特殊的硬件设备,如本例中的PCI转1并1串扩展卡,可以将一个并行端口转换成一个串行端口,从而扩展计算机的功能。 5. 驱动程序(Driver):驱动程序是一种软件,它能够使计算机的操作系统和硬件设备之间能够进行通信。在本例中,&quot;DW-TX382-1并1串专用驱动&quot;即为上述PCI扩展卡所配套使用的驱动程序,它需要安装在计算机上以确保硬件设备能够正常工作。 6. DIEWU公司:从标签信息可以看出,该PCI扩展卡由DIEWU公司生产。DIEWU可能是一家专注于工业自动化控制硬件设备生产的企业。对于其具体的企业信息和市场地位,需要通过进一步的信息查询来了解。 从压缩包子文件的文件名称列表中,我们可以看到包含了一张图片文件名 &quot;DIEWU PCI转1并1串 COM口 RS232 9针设备 PCI扩展卡工控卡pci串口-淘宝网.png&quot;,这表明该驱动程序可能是在网络零售平台淘宝网上销售的商品,潜在的用户可以通过网络平台进行购买和获取相关的产品信息。 总结来说,&quot;DW-TX382-1并1串专用驱动.zip&quot; 是一款适用于DIEWU公司生产的特定PCI扩展卡的驱动程序压缩包。该扩展卡将计算机的一个并行端口转换为一个RS232标准的串行端口,用于工业自动化控制系统中与串行设备的连接。了解这些知识点对于在安装和使用此类硬件时进行故障排除或性能优化都是非常有帮助的。 收起

DW-串口卡转接卡系列驱动

1、方法1:直接双击&ldquo;AUTORUN&rdquo;文件,根据产品芯片选择&ldquo;TXIC382X-PCI&amp;PCIe;&quot;或&quot;WCH38X-PCIe&quot;及&rdquo;WCH35X-PCIe&quot;三个选项(如不成功则用方法2) 2、方法2:右键单击&ldquo;计算机/我的电脑&rdquo;&gt;属性-设备管理器-找到转接卡设备&gt; 右键单击&gt;更新驱动程序软件-浏览计算机以查找驱动程序软件-复制粘贴驱动文件地址&gt;下一步 3、若以上方法均不成功,可自行百度到网上下载&ldquo;驱动精灵&rdquo;或&ldquo;驱动人生&rdquo;等第三方软件在线驱动。 注意:用方法2时,驱动文件一定要对应到正确的操作系统,不清想电脑系统的可右键单击&ldquo;计算机/我的电脑&rdquo;&gt;属性 中查看

hdu 1179

Ollivanders: Makers of Fine Wands since 382 BC. Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others) Total Submission(s): 479    Accepted Submission(s): 260 Prob

sdjzqing的专栏 1859

hdu1179Ollivanders: Makers of Fine Wands since 382 BC. (二分最大匹配)

Time Limit:1000MSMemory Limit:65536KB64bit IO Format:%I64d &amp;amp; %I64u Submit Status Practice HDU 1179 Description In Diagon Alley ,there is only one Wand-seller,peeling gold letters...

pxlsdz的博客 382

hdu 1179 Ollivanders: Makers of Fine Wands since 382 BC. (最大匹配)

题目:Ollivanders: Makers of Fine Wands since 382 BC. 题意:匹配魔法师和魔杖。 分析:二分图最大匹配。 代码: #include #include #include using namespace std; int match[110]; int g[110][110]; int vis[110]; int n,m; bool dfs(i

Hadis_yuki 874

HDU1179 Ollivanders: Makers of Fine Wands since 382 BC.【二分图匹配/匈牙利算法】

题目链接:Ollivanders: Makers of Fine Wands since 382 BC. #include&lt;bits/stdc++.h&gt; #define pb push_back using namespace std; const int maxn=111; vector&lt;int&gt; g[maxn&lt;&lt;2]; bool vis[maxn]; i...

MaJorieL 278

hdu1179 Ollivanders: Makers of Fine Wands since 382 BC(二分图模板)

Ollivanders: Makers of Fine Wands since 382 BC. Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others) Total Submission(s): 1528    Accepted Submission(s): 852

qq_35634181的博客 322

HDU Problem 1179 Ollivanders: Makers of Fine Wands since 382 BC.【二分图匹配】

Ollivanders: Makers of Fine Wands since 382 BC. Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others) Total Submission(s): 1515    Accepted Submission(s): 843 P

博客已搬迁到http://www.cnblogs.com/cniwoq/ 337

佳的美UTV258/302/332/382驱动软件

佳的美UTV258/302/332/382驱动软件(支持XP.VISTA.WIN7的32/64):

用c语言实现的屏幕魔棒程序源代码 WinTrans

用c语言实现的屏幕魔棒程序源代码,有详细说明。-with C Language screen Wand source code, a detailed description.

HDU】-1179-Ollivanders: Makers of Fine Wands since 382 BC.(二分图,魔杖)

Ollivanders: Makers of Fine Wands since 382 BC. Time Limit: 1000MS   Memory Limit: 65536KB   64bit IO Format: %I64d & %I64u Submit Status Description In Diagon Alley ,t

Bear1998的博客 587

HDU 1179 Ollivanders: Makers of Fine Wands since 382 BC.(最大匹配)

题目地址:点击打开链接 思路:简单二分图匹配,代码粘的详解的,所以解释有点扯淡,对应关系是,为每个魔法棒找巫师,对应为每个光棍找妹子,注意光棍要从1开始循环,不能从0开始循环,不然会出错,导致的结果妹子的丈夫为0时,有时会再给她一个丈夫 AC代码: #include #include int lol[110][110],visit[110],cf[110],n; bool find(in

Java识堂,一个有干货的微信公众号 499

HDU 1179 Ollivanders: Makers of Fine Wands since 382 BC.(二分图匹配+匈牙利算法)

In Diagon Alley ,there is only one Wand-seller,peeling gold letters over the door read Ollivanders: Makers of Fine Wands since 382 BC.A single wand lay on a faded purple cushion in the dusty window. A tinkling bell rang somewhere in the depths of the shop

HJY 379

HDU 1179 Ollivanders: Makers of Fine Wands since 382 BC. 最大匹配

转载请注明本文地址 题意:n个魔法师,m根魔杖,要配对,一人最多一根魔杖,一根魔杖最多配一个人。求最大匹配数。 思路: 裸最大匹配,不过题目有点长所以我直接开有道全文翻译了,看懂最后一段就可以了…… 代码: #include #include #include #include #include using namespace std; const int M

Shoutmon的专栏 836

Ollivanders: Makers of Fine Wands since 382 BC(HDU 1179)---二分图最大匹配数

题目链接 题目描述 In Diagon Alley ,there is only one Wand-seller,peeling gold letters over the door read Ollivanders: Makers of Fine Wands since 382 BC.A single wand lay on a faded purple cushion in the du...

weixin_43960284的博客 390
上一篇: hdu1151——Air Raid
下一篇: POJ3342——Party at Hali-Bula
tokers
博客等级 码龄12年 71粉丝 700原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值