Created
April 24, 2015 14:43
-
-
Save trendsetter37/9fe36d722133656ead33 to your computer and use it in GitHub Desktop.
ACM ICPC 2014 Team
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def check_match2(person1, person2): | |
return bin(int('0b'+person1,2) | int('0b'+person2,2)).count('1') | |
def make_combos2(people): | |
plist = []; plist.append(input()) | |
count = 0 | |
maximum = 0 | |
for i in range(people-1): | |
person = input() | |
plist.append(person) | |
for person0 in plist: | |
ck = check_match2(person0, person) | |
if ck > maximum: | |
maximum = ck | |
count = 1 | |
elif ck == maximum: | |
count+=1 | |
return [maximum, count] | |
if __name__ == '__main__': | |
people, topics = input().split() | |
print("{}\n{}".format(*make_combos2(int(people)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment