描述 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 possible to form a committee of exactly P students that satisfies simultaneously the conditions: every st…
Destroying The Graph Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 8198 Accepted: 2635 Special Judge Description Alice and Bob play the following game. First, Alice draws some directed graph with N vertices and M arcs. After that B…
Going Home Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 22088 Accepted: 11155 Description On a grid map there are n little men and n houses. In each unit time, every little man can move one unit step, either horizontally, or vertica…
题目描述 学校放假了 · · · · · · 有些同学回家了,而有些同学则有以前的好朋友来探访,那么住宿就是一个问题.比如 A 和 B 都是学校的学生,A 要回家,而 C 来看B,C 与 A 不认识.我们假设每个人只能睡和自己直接认识的人的床.那么一个解决方案就是 B 睡 A 的床而 C 睡 B 的床.而实际情况可能非常复杂,有的人可能认识好多在校学生,在校学生之间也不一定都互相认识.我们已知一共有 n 个人,并且知道其中每个人是不是本校学生,也知道每个本校学生是否回家.问是否存在一个方案使得所…