2 条题解
-
0Guest LV 0
-
02021-10-14 20:24:40@
#include<bits/stdc++.h> using namespace std; char a[1040]; int n; char FBITREE(int l,int r){ if (l == r) if (a[l] == '1') return 'I'; else return 'B'; char fl = FBITREE(l,(l+r)/2); cout<<fl; char fr = FBITREE((l+r)/2+1,r); cout<<fr; if (fl == fr) return fl; else return 'F'; } int main(){ cin>>n>>a; int al = strlen(a); cout<<FBITREE(0,al-1)<<endl; }
-
02021-10-14 20:24:29@
AC了没?
- 1