跳到主要内容

Prog - 047

备注

created by || avijneyam

⏲️ Release Date // 2022-04-11

💀 Solvers // 19

🧩 Type // prog

题目信息

magic_num_list = [12, 43, 36, 47, 21, 40, 23, 42, 14, 54, 10, 53, 14, 36, 32, 40, 28, 50, 22, 40]
Hint: Use python code for decoding the magic_num_list...

题目附件

import string

def magic_encode(flag):
flag, magic_num_list = divmod(flag, 61)
return f"{string.digits[1:] + string.ascii_uppercase + string.ascii_lowercase}" [magic_num_list]

解决

import string

magic_num_list = [12, 43, 36, 47, 21, 40, 23, 42, 14, 54, 10, 53, 14, 36, 32, 40, 28, 50, 22, 40]

charset = string.digits[1:] + string.ascii_uppercase + string.ascii_lowercase

res = ""

for i in magic_num_list:
tmp = ord(charset[i])-1
res += chr(tmp)

print("HMV{" + res + "}")


def magic_encode(flag):
flag, magic_num_list = divmod(flag, 61)
return f"{string.digits[1:] + string.ascii_uppercase + string.ascii_lowercase}"[magic_num_list]

# HMV{ChalLeNgEsArEaWeSoMe}