func_code_string: #include <bits/stdc++.h>   int gcd(int x, int y) {     int r1 = x, q, r2 = y, r;     while (r2 > 0) {       q = r1 / r2;       r = r1 - q * r2;       r1 = r2;       r2 = r;     }     return r1;   }   using namespace std;   int main(int argc, char const *argv[]) {     int n, m, x, cnt;     char c;     cin >> n >> m;     char arr[n];     int arr1[n];     map<int, pair<int, int> > arr2;     cnt = 0;     cin >> arr;     arr1[0] = -1;     for (int i = 1; i < n; i++) {       arr1[i] = -1;       if (arr[i] ==  .  && arr[i - 1] ==  . ) {         arr2[cnt] = make_pair(i, i - 1);         arr1[i] = cnt;         cnt++;       }     }     for (int i = 0; i < m; i++) {       cin >> x >> c;       x--;       if (arr[x] ==  .  && c ==  .  || arr[x] !=  .  && c !=  . )         ;       else if (arr[x] !=  .  && c ==  . ) {         if (x != 0 && arr[x - 1] ==  . ) {           arr2[cnt] = make_pair(x, x - 1);           arr1[x] = cnt;           cnt++;         }         if (x != n - 1 && arr[x + 1] ==  . ) {           arr2[cnt] = make_pair(x + 1, x);           arr1[x + 1] = cnt;           cnt++;         }       } else {         if (x == n - 1) {           if (arr1[x] == -1)             ;           else {             arr2.erase(arr2.find(arr1[x]));             arr1[x] = -1;           }         } else {           if (arr1[x] != -1 && arr1[x + 1] != -1) {             arr2.erase(arr2.find(arr1[x + 1]));             arr1[x + 1] = -1;             arr2.erase(arr2.find(arr1[x]));             arr1[x] = -1;           } else if (arr1[x] != -1) {             arr2.erase(arr2.find(arr1[x]));             arr1[x] = -1;           } else if (arr1[x + 1] != -1) {             arr2.erase(arr2.find(arr1[x + 1]));             arr1[x + 1] = -1;           } else {           }         }       }       arr[x] = c;       printf( %d , arr2.size());       printf(  n );       ;     }     return 0;   }   