CodeForcesGym 100753B Bounty Hunter II
Bounty Hunter II
This problem will be judged on CodeForcesGym. Original ID: 100753B
64-bit integer IO format: %I64d Java class name: (Any)

#include <bits/stdc++.h>
using namespace std;
const int maxn = ;
vector<int>g[maxn];
int Link[maxn],n;
bool used[maxn];
bool match(int u){
for(int i = g[u].size()-; i >= ; --i){
if(used[g[u][i]]) continue;
used[g[u][i]] = true;
if(Link[g[u][i]] == - || match(Link[g[u][i]])){
Link[g[u][i]] = u;
return true;
}
}
return false;
}
int main(){
int m;
while(~scanf("%d",&n)){
for(int i = ; i < maxn; ++i) g[i].clear();
for(int i = ; i < n; ++i){
scanf("%d",&m);
for(int j = ,v; j < m; ++j){
scanf("%d",&v);
g[i].push_back(v + n);
}
}
memset(Link,-,sizeof Link);
int ret = ;
for(int i = ; i < n; ++i){
memset(used,false,sizeof used);
if(match(i)) ++ret;
}
printf("%d\n",n - ret);
}
}
/*
4
1 1
1 2
0
1 1 6
0
1 2
2 4 5
1 2
0
0 5
1 4
1 4
1 4
1 4
0
*/
CodeForcesGym 100753B Bounty Hunter II的更多相关文章
- CodeForcesGym 100753B Bounty Hunter II 二分图最小路径覆盖
关键在建图 题解:http://www.cnblogs.com/crackpotisback/p/4856159.html 学习:http://www.cnblogs.com/jackiesteed/ ...
- How to become a successful bug bounty hunter
出处:https://www.hackerone.com/blog/become-a-successful-bug-bounty-hunter 如果你梦想成为赏金猎人,你的梦想就会成真 - 不要把你的 ...
- csu1527: Bounty Hunter
Time Limit:5000MS Memory Limit:131072KB 64bit IO Format:%lld & %llu Submit Status id=134 ...
- German Collegiate Programming Contest 2015(第三场)
Divisions David is a young boy and he loves numbers. Recently he learned how to divide two numbers.D ...
- 2015 German Collegiate Programming Contest (GCPC 15) + POI 10-T3(12/13)
$$2015\ German\ Collegiate\ Programming\ Contest\ (GCPC 15) + POI 10-T3$$ \(A.\ Journey\ to\ Greece\ ...
- Bug Bounty Reference
https://github.com/ngalongc/bug-bounty-reference/blob/master/README.md#remote-code-execution Bug Bou ...
- ARTIFICIAL INTELLIGENCE FOR GAMES (Ian Millington / John Funge 著)
相关网站:http://www.ai4g.com PART I AI AND GAMESCHAPTER1 INTRODUCTIONCHAPTER2 GAME AIPART II TECHNIQUESC ...
- 五、Pandas玩转数据
Series的简单运算 import numpy as np import pandas as pd s1=pd.Series([1,2,3],index=['A','B','C']) print(s ...
- Gson解析Json数组
需求:从steam官网获取英雄数据,即为Json数据,并导入到本地数据库 Json数据是这样的 { "result": { "heroes": [ { &quo ...
随机推荐
- Linux进入单用户模式的两种方法
单用户模式的作用 在使用Linux系统中,维护人员经常会碰到一个问题,就是在拥有root账号权限和密码的用户中,总是会出现忘记root密码的情况. 遇到这种情况,一般情况下,维护人员就会通过最常用的方 ...
- Objective-C程序
创建: 2018/01/17 完成: 2018/01/19 对象(object)与信息 信息式 声明实例变量 id obj; 向对象变量发送信息 [obj msg] //这就是信息式 例: [ ...
- E20171225-hm
abstract adj. 抽象的,理论上的; 难解的; 抽象派的; 茫然的;
- bzoj 1655: [Usaco2006 Jan] Dollar Dayz 奶牛商店【高精度+完全背包】
居然要用高精度! 懒得operator了,转移是裸的完全背包 #include<iostream> #include<cstdio> using namespace std; ...
- P2470 [SCOI2007]压缩
传送门 区间dp,记\(dp(l,r,t)\)表示区间\((l,r)\),\(t\)表示这个区间中能不能放\(M\).如果可以,枚举中间哪里放\(M\)来压缩.也可以不压缩,后面直接跟上去.如果左右重 ...
- Rabbitmq笔记一
几个基本概念 Producer 生产者,发送消息的一方,图中左侧的client. Consumer 消费者,接收消息的一方,图中后侧的client. Broker 消息中间件的服务节点,一般一个Rab ...
- 对mysql修改库里面所有的引擎mysaim 为 innodb
1.查看当前数据引擎的命令: show engines; 2. USE `[DBNAME]`; SELECT GROUP_CONCAT(CONCAT( 'ALTER TABLE ' ,TABLE_NA ...
- ViewPager(4)用viewpager实现splash view
1,示例 2,代码 SplashMain.java import android.os.Bundle; import android.support.v4.app.Fragment; import a ...
- JSP/Servlet Web应用中.properties文件的放置与读取
本地项目 在本地类库中,我经常使用当前目录来放置.properties文件,这时调用方只要引用我的jar,并且将我的.properties放在他的classpath里面即可,比如: p.load(ne ...
- JOptionPane.showMessageDialog出现在浏览器下面的解决方法
将JOptionPane.showMessageDialog(null, result, "发布公告:", JOptionPane.INFORMATION_MESSAGE);中的参 ...