@[030717yhw](/user/601534) 代码(?
```cpp
#include<bits/stdc++.h>
using namespace std;
bool a[2048];
int n;
void dfs(int l,int r)
{
bool zero=false,one=false;
for(int i=l;i<=r;i++)
{
if(a[i]==0)
zero=true;
if(a[i]==1)
one=true;
}
if(l!=r){
dfs(l,(l+r)/2);
dfs((l+r)/2+1,r);
}
if(zero==true&&one==true)cout << 'F';
if(zero==false&&one==true)cout << 'I';
if(zero==true&&one==false)cout << 'B';
}
int main(){
cin >> n;
int s=1;
for(int i=1;i<=n;i++)
s*=2;
for(int i=1;i<=s;i++){
char c;
cin>>c;
a[i]=(c=='1');
}
dfs(1,s);
return 0;
}
```
by UchihaCelery @ 2022-12-06 19:25:53