题解:
二分最终答案,然后转化为0,1串。
发现连续的0,1串每次往左右扩展1,那么我们找到距离中点最近的即可。
#include <bits/stdc++.h>
using namespace std;
const int RLEN=1<<18|1;
inline char nc() {
static char ibuf[RLEN],*ib,*ob;
(ib==ob) && (ob=(ib=ibuf)+fread(ibuf,1,RLEN,stdin));
return (ib==ob) ? -1 : *i