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0,16):
for j in range(0,16):
if (data[i * 16 + j] == 0):
flag+='0'
else:
if (data[i * 16 + j] == 33):
flag+='#'
else:
flag+='*'
flag+='\n'
print(flag)
flag{MEWEWEMJM}
总结:
- 意识到是迷宫,但是没有意识到16*16的情况下,上下移动只需要加减16即可
- 没有意识到(unsigned int)类型转换后结果一定为正数,所以若v2-240<0时溢出为正数