Chessboard Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 12800 Accepted: 4000 Description Alice and Bob often play games on chessboard. One day, Alice draws a board with size M * N. She wants Bob to use a lot of cards with size 1 * 2…
很裸,左点阵n,右点阵m 问最大匹配是否为n #include <cstdio> #include <cstring> #include <vector> using namespace std; vector <int> edge[103]; int pre[303]; bool vis[303]; int n, m; bool dfs(int u) { for(int i = 0; i < (int)edge[u].size(); i++) { i…
COURSES Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 16877 Accepted: 6627 Description Consider a group of N students and P courses. Each student visits zero, one or more than one courses. Your task is to determine whether it is poss…
Problem DescriptionFrank N. Stein is a very conservative high-school teacher. He wants to take some of his students on an excursion, but he is afraid that some of them might become couples. While you can never exclude this possibility, he has made so…
The Perfect Stall Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 24081 Accepted: 10695 Description Farmer John completed his new barn just last week, complete with all the latest milking technology. Unfortunately, due to engineering p…
The Perfect Stall Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 16396 Accepted: 7502 Description Farmer John completed his new barn just last week, complete with all the latest milking technology. Unfortunately, due to engineering pr…
POJ 3041 Asteroids / UESTC 253 Asteroids(二分图最大匹配,最小点匹配) Description Bessie wants to navigate her spaceship through a dangerous asteroid field in the shape of an N x N grid (1 <= N <= 500). The grid contains K asteroids (1 <= K <= 10,000), whic…
POJ 2289(多重匹配+二分) 把n个人,分到m个组中.题目给出每一个人可以被分到的那些组.要求分配完毕后,最大的那一个组的人数最小. 用二分查找来枚举. #include<iostream> #include<string> #include<cstring> #include<cstdio> using namespace std; int map[1010][510]; int vis[1010]; int link[1010][510]; int…
Taxi Cab Scheme Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 5710 Accepted: 2393 Description Running a taxi station is not all that simple. Apart from the obvious demand for a centralised coordination of the cabs in order to pick up…
题意:除了所给的一些点外,问能不能用1*2的矩形覆盖所有的点,矩形间不能重叠. 思路:简单二分匹配,,,,,,, #include<stdio.h> #include<string.h> const int N=1200; int match[N],link[N],map[35][35],n,m; int dir[4][2]={0,1,0,-1,1,0,-1,0}; int find(int u) { int i,v,x,y,X,Y; x=u/m;y=u%m; for(i=0;i&…
COURSES Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 18993 Accepted: 7486 Description Consider a group of N students and P courses. Each student visits zero, one or more than one courses. Your task is to determine whether it is poss…
The dog task Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 2559 Accepted: 1038 Special Judge Description Hunter Bob often walks with his dog Ralph. Bob walks with a constant speed and his route is a polygonal line (possibly self-in…
Muddy Fields Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 9754 Accepted: 3618 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, t…
Purifying Machine Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 5004 Accepted: 1444 Description Mike is the owner of a cheese factory. He has 2N cheeses and each cheese is given a binary number from 00...0 to 11...1. To keep his chee…
Girls and Boys Time Limit: 5000MS Memory Limit: 10000K Total Submissions: 11694 Accepted: 5230 Description In the second year of the university somebody started a study on the romantic relations between the students. The relation "romantically in…
原题连接:http://poj.org/problem?id=3041 Asteroids Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 17985 Accepted: 9798 Description Bessie wants to navigate her spaceship through a dangerous asteroid field in the shape of an N x N grid (1 <…
二分匹配:二分图的一些性质 二分图又称作二部图,是图论中的一种特殊模型. 设G=(V,E)是一个无向图,如果顶点V可分割为两个互不相交的子集(A,B),并且图中的每条边(i,j)所关联的两个顶点i和j分别属于这两个不同的顶点集(i in A,j in B),则称图G为一个二分图. 1.一个二分图中的最大匹配数等于这个图中的最小点覆盖数 König定理是一个二分图中很重要的定理,它的意思是,一个二分图中的最大匹配数等于这个图中的最小点覆盖数.如果你还不知道什么是最小点覆盖,我也在这里说一下:假如选…
题目:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2361 来源:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=26760#problem/B Beloved Sons Time Limit: 2 Seconds Memory Limit: 65536 KB Special Judge Once upon a time there liv…
poj 3041——Asteroids Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 22604 Accepted: 12247 Description Bessie wants to navigate her spaceship through a dangerous asteroid field in the shape of an N x N grid (1 <= N <= 500). The g…
Asteroids POJ - 3041 Bessie wants to navigate her spaceship through a dangerous asteroid field in the shape of an N x N grid (1 <= N <= 500). The grid contains K asteroids (1 <= K <= 10,000), which are conveniently located at the lattice po…