Stable Matching-稳定匹配问题【G-S算法,c++】
题目描述:(Gale-Shapley算法)
Teenagers from the local high school have asked you to help them with the organization of next year’s Prom. The idea is to find a suitable date for everyone in the class in a fair and civilized way. So, they have organized a web site where all students, boys and girls, state their preferences among the class members, by ordering all the possible candidates. Your mission is to keep everyone as happy as possible. Assume that there are equal numbers of boys and girls.
当地高中的青少年要求您帮助他们组织明年的舞会。 想法是以公平文明的方式为班上的每个人找到合适的约会对象。 因此,他们组织了一个网站,所有学生,男孩和女孩,通过订购所有可能的候选人,在班级成员中陈述他们的偏好。 你的任务是让每个人都尽可能开心。 假设男孩和女孩的数量相等。
Given a set of preferences, set up the blind dates such t