Advertisement
PikMike

Untitled

Dec 20th, 2015
322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.73 KB | None | 0 0
  1. t = open("tests.in", "rb")
  2. out = open("out.txt", "wb")
  3. s = t.readline().split()[0]
  4. z = []
  5. lst = 0
  6. print(len(s))
  7. s = s.replace(b"\xd1\x8c", b"\xd0\xac")
  8. while s.find(b"\xd0\xac", lst) != s.find(b"."):
  9.     z.append(s[lst:s.find(b"\xd0\xac", lst)])
  10.     lst = s.find(b"\xd0\xac", lst) + 2
  11. z.append(s[lst:])
  12. for s in z:
  13.     a = []
  14.     for i in range(0, len(s), 22):
  15.         c = s[i:i + 22]
  16.         c = c.replace(b"\xd0\xab", b'1')
  17.         c = c.replace(b"\xd1\x8b", b'0')
  18.         a.append(int(c[::-1], 2))
  19.     for i in a[::-1]:
  20.         out.write(chr(i + 1).encode())
  21.     out.write(b" ")
  22. out.close()
  23. outw = open("out.txt", "rb")
  24. outww = open("outw.txt", "wb")
  25. t = outw.readline().split()
  26. for i in t[::-1]:
  27.     outww.write(i + b" ")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement