Created
October 31, 2020 21:59
-
-
Save gerdoe-jr/8354b642701ef0553d88159a8a83742c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
while True: | |
f = [int(i) for i in list(input())] | |
a = [f[i * 2] for i in range(len(f) // 2)] | |
b = [f[1], f[2], f[5], f[6], f[9], f[10]] | |
c = [f[i] for i in range(3, 7)] | |
c.append(f[11]) | |
d = [f[i] for i in range(7, 12)] | |
ans = 0 | |
was = 0 | |
wasshit = False | |
if (sum(a) - f[0]) % 2 != f[0]: | |
ans += 0 | |
was += 1 | |
wasshit = True | |
if (sum(b) - f[1]) % 2 != f[1]: | |
ans += 1 | |
was += 1 | |
wasshit = True | |
if (sum(c) - f[3]) % 2 != f[3]: | |
ans += 3 | |
was += 1 | |
wasshit = True | |
if (sum(d) - f[7]) % 2 != f[7]: | |
ans += 7 | |
was += 1 | |
wasshit = True | |
print(f) | |
if wasshit is True: | |
f[ans] = (f[ans] + 1) % 2 | |
print(ans + was) | |
f.pop(0) | |
f.pop(0) | |
f.pop(1) | |
f.pop(4) | |
print(f) | |
print(''.join(str(i) for i in f)) | |
# print(a, b, c, d, sep='\n') | |
# print('', | |
# (sum(a) - f[0]) % 2 == f[0], | |
# (sum(b) - f[1]) % 2 == f[1], | |
# (sum(c) - f[3]) % 2 == f[3], | |
# (sum(d) - f[7]) % 2 == f[7], | |
# sep='\n') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment