Skip to content

Instantly share code, notes, and snippets.

@CMGS
Created March 18, 2013 10:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CMGS/5186192 to your computer and use it in GitHub Desktop.
Save CMGS/5186192 to your computer and use it in GitHub Desktop.
#!/usr/local/bin/python2.7
#coding:utf-8
d = open('c.in','r').read()
d = d.split(',')
f1 = d[::3]
f2 = d[1::3]
f3 = d[2::3]
k = range(32, 123)
def calc(c):
r = []
for j in range(97, 123):
p = int(c) ^ j
if p not in k:
continue
r.append(j)
return set(r)
def m(f):
r = None
for i in range(len(f)):
rc = calc(f[i])
if not r:
r = rc
continue
r = r & rc
return r
print m(f1), m(f2), m(f3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment