# C~K要找女朋友了！！！

### C~K要找女朋友了！！！

Time Limit: 1000 ms Memory Limit: 131072 KiB

#### Problem Description

ps:由于MeiK比较傻，所以名单里可能会有重复的女生的信息，若信息重复，则第一次输入为有效信息。

ps：联系方式不超过11个字符。

#### Sample Input

4
160 170 20 22

#### Sample Output

2



#### Source

import java.util.*;

class Person {
String name, tele;
int age, heigh;

public Person(String name, int heigh, int age, String tele) {
this.name = name;
this.heigh = heigh;
this.age = age;
this.tele = tele;
}

public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + age;
result = prime * result + heigh;
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((tele == null) ? 0 : tele.hashCode());
return result;
}

public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Person other = (Person) obj;
if (age != other.age)
return false;
if (heigh != other.heigh)
return false;
if (name == null) {
if (other.name != null)
return false;
} else if (!name.equals(other.name))
return false;
if (tele == null) {
if (other.tele != null)
return false;
} else if (!tele.equals(other.tele))
return false;
return true;
}

public String toString() {
return name + " " + heigh + " " + age + " " + tele;
}

}

public class Main {

public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()) {
int t = sc.nextInt();
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
int d = sc.nextInt();
List<Person> l = new ArrayList<Person>();
while (t != 0) {
String name = sc.next();
int heigh = sc.nextInt();
int age = sc.nextInt();
String tele = sc.next();
if (age >= c && age <= d && heigh >= a && heigh <= b) {
Person p = new Person(name, heigh, age, tele);
if (!l.contains(p)) {
}
}
t--;
}
Collections.sort(l, new Comparator<Person>() {

public int compare(Person o1, Person o2) {
if(o1.heigh == o2.heigh)
return o2.age - o1.age;
return o1.heigh-o2.heigh;
}
});
System.out.println(l.size());
Iterator<Person> it = l.iterator();
while(it.hasNext()) {
System.out.println(it.next());
}
}
sc.close();
}
}

• 广告
• 抄袭
• 版权
• 政治
• 色情
• 无意义
• 其他

120