func_code_string: #include <bits/stdc++.h>   using namespace std;   inline long long getnum() {     char c = getchar();     long long num, sign = 1;     for (; c <  0  || c >  9 ; c = getchar())       if (c ==  - ) sign = -1;     for (num = 0; c >=  0  && c <=  9 ;) {       c -=  0 ;       num = num * 10 + c;       c = getchar();     }     return num * sign;   }   char S[200020];   char T[200020];   vector<pair<int, int> > V;   int main() {     int n = getnum(), k = getnum();     gets(T + 3);     int rot = 3;     for (rot = 3; rot <= n + 2; rot++) {       if (T[rot] == T[rot + 1]) break;     }     for (int i = 3, j = rot; i <= n + 2; i++, j++) {       if (j == n + 3) j = 3;       S[i] = T[j];     }     S[1] = S[n + 1];     S[2] = S[n + 2];     S[n + 3] = S[3];     S[n + 4] = S[4];     for (int i = 0; i <= n + 4;) {       int x = i;       while (S[i] == S[x] && i <= n + 4) i++;       if (i - x > 1) V.push_back(make_pair(x, i - 1));     }     if (V.size() == 0) {       if (k % 2) {         for (int i = 3; i <= n + 2; i++) S[i] =  B  +  W  - S[i];       }       S[n + 3] = 0;       printf( %s , S + 3);       return 0;     }     for (int i = 0; i < V.size() - 1; i++) {       int l = V[i].second;       int r = V[i + 1].first;       int t = min(k, (r - l) / 2);       l++, r--;       for (int tt = 1; tt <= t; l++, tt++) S[l] = S[V[i].second];       for (int tt = 1; tt <= t; r--, tt++) S[r] = S[V[i + 1].first];       for (; l <= r; l++) S[l] =  B  +  W  - S[l - 1];     }     T[n + 3] = 0;     for (int i = rot, j = 3; j <= n + 2; i++, j++) {       if (i == n + 3) i = 3;       T[i] = S[j];     }     printf( %s , T + 3);   }   