// Topcoder SRM 570 DIV 2 1 Chopsticks
import java.util.*;
import java.math.*;
public class Chopsticks {
public static void main(String[] args) {
System.out.println(
//
new Chopsticks().getmax(
null
));
}
public int getmax(int[] length) {
int[] nlen = new int[101];
for (int i = 0; i < length.length; i++) {
nlen[length[i]] += 1;
}
int guest = 0;
for (int i = 1; i <= 100; i++) {
guest += (nlen[i] / 2);
}
return guest;
}
}
No comments:
Post a Comment