You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
371 B
27 lines
371 B
2 years ago
|
lines = open("input.txt", 'r').read().splitlines()
|
||
|
leng = len(lines)
|
||
|
count = [0] * len(lines[0])
|
||
|
|
||
|
for s in lines:
|
||
|
for i in range(0, len(s)):
|
||
|
if bool(int(s[i])):
|
||
|
count[i] += 1
|
||
|
|
||
|
s = ""
|
||
|
t = ""
|
||
|
print(count)
|
||
|
for i in count:
|
||
|
if i > leng/2:
|
||
|
s += "1"
|
||
|
t += "0"
|
||
|
else:
|
||
|
s += "0"
|
||
|
t += "1"
|
||
|
|
||
|
gama = int(s, 2)
|
||
|
epsi = int(t, 2)
|
||
|
print(gama)
|
||
|
print(epsi)
|
||
|
print(gama*epsi)
|
||
|
|