You are viewing a single comment's thread. Return to all comments →
Simple solution in Python3:
from itertools import combinations n,m=map(int,input().split()) strings=[] for i in range(n): strings.append(input()) combos=list(combinations(strings,2)) or_res=[] for i in combos: or_res.append(bin(int('0b' + i[0], 2) | int('0b' + i[1], 2)).count('1')) m=max(or_res) print(m) print(or_res.count(m))
Seems like cookies are disabled on this browser, please enable them to open this website
ACM ICPC Team
You are viewing a single comment's thread. Return to all comments →
Simple solution in Python3: