print("Enter the text within tqlctf{ ... }:") # tqlctf{123456789} id = input();
id_bytes = bytes(id, "ascii") bits = ''.join(["{0:08b}".format(x) for x in id_bytes]) # 转成二进制存到bits
print(bits)
n = len(bits)
N = 5000
# print(n) # print(N) print(2**29)
defget_lit(i): return (i + 1) * (2 * int(bits[i]) - 1) # (i + 1) * -1 or 1
for t inrange(N): i = random.randint(0, n - 1) # i = [0, 135] p = random.randint(0, 2) # p = [0, 2] true_lit = get_lit(i) for j inrange(3): if j == p: print(true_lit, end = " ") else: tmp = random.randint(0, n - 1) # tmp = [0, 135] rand_true = get_lit(tmp) if random.randint(0, 3) == 0: print(rand_true, end = " ") else: print(-rand_true, end = " ")