算法一:尺取法O(N)
#include <iostream>
#include <cstring>
#include <algorithm>
#define debug1(var) \
cout << #var << " = " << var << endl
#define debug(var1, var2) \
cout << #var1 << " = " << var1 << " " << #var2 << " = " << var2 << endl
using namespace std;
typedef long long LL;
const int N = 1e6 + 10;
int n, a, b;
LL zero[N], one[N];
LL res;
char s[N