摘要:
先判断是否为二分图 , dfs 对每个点染色, 如果不会出现矛盾就说明是二分图。然后就是匈牙利直接水过了。。。The Accomodation of StudentsTime Limit: 5000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1345Accepted Submission(s): 661 Problem DescriptionThere are a group of students. Some of them may know each other, 阅读全文
摘要:
简单的二分图。思路:对于每个不是ponds的点标号,建图时把每个点拆成两个,然后在这两部分进行最大匹配,具体的建边的方法是, 每个标号点,都找和他相邻的点连边。最后用匈牙利算法算出最大匹配后, 将总数除以2就是结果Uncle Tom's Inherited LandTime Limit: 2 Seconds Memory Limit: 65536 KBYour old uncle Tom inherited a piece of land from his great-great-uncle. Originally, the property had been in the shape 阅读全文