摘要: 题意是老师要带学生出游,但有怕学生会成为一对。给出学生们不会成为一对的条件:1身高相差超过402性别相同3音乐风格不一样4最喜欢的运动一样然后给出每个学生的资料,问能带多少学生出去,使得这些学生不会成为一对。构图时先求出会成为一对的对数ans,然后总数n-ans/2就是答案。#include <iostream>#include <cstring>#include <string>using namespace std;const int MAX = 505;struct student{ int h; char sex; string style,spor 阅读全文
posted @ 2011-03-16 10:29 c++fans 阅读(206) 评论(0) 推荐(0) 编辑