#include #include using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int N,Q; cin >> N >> Q; string s; cin >> s; int answer = 0; vector C(N); auto f = [&](int pos) -> void { C.at(pos) = 0; int ap = 0,start = pos,ng = 0; vector c(10); while(pos < N){ int v = s.at(pos)-'0'; if(ng&(1<> pos >> c,pos--; for(int i=pos; i>=pos-30; i--){ if(i < 0) break; answer -= C.at(i); } s.at(pos) = c; for(int i=pos; i>=pos-30; i--){ if(i < 0) break; f(i),answer += C.at(i); } cout << answer-N-(N-1) << "\n"; } }