Skip to content

Instantly share code, notes, and snippets.

@trendsetter37
Created April 24, 2015 14:43
Show Gist options
  • Save trendsetter37/9fe36d722133656ead33 to your computer and use it in GitHub Desktop.
Save trendsetter37/9fe36d722133656ead33 to your computer and use it in GitHub Desktop.
ACM ICPC 2014 Team
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