解题思路:
注意事项:
参考代码:
def dfs(s): global R R.append(s) if len(s) <= 1: return dfs(s[len(s)//2:]) dfs(s[:len(s)//2]) if __name__ == '__main__': R = [] n = int(input()) s = input().strip() dfs(s) for i in range(len(R)-1,-1,-1): if R[i].count('0') != 0 and R[i].count('1') != 0: print('F',end='') elif R[i].count('0') == 0: print('I',end='') elif R[i].count('1') == 0: print('B',end='')
0.0分
1 人评分