func_code_string: #include <bits/stdc++.h>   using namespace std;   int adder[1234567], pre[1234567];   int main() {     std::ios::sync_with_stdio(false);     long long n, k;     cin >> n >> k;     int i, l, r;     l = 0;     r = 0;     string s;     cin >> s;     for (i = 1; i < n; i++) {       if (r < i) {         l = i;         r = i;         while (r < n && s[r] == s[r - l]) r++;         pre[i] = r - l;         r--;         continue;       }       if (r - i + 1 > pre[i - l]) {         pre[i] = pre[i - l];       } else {         l = i;         while (r < n && s[r] == s[r - l]) r++;         pre[i] = r - l;         r--;       }     }     long long haha, haha1, endp;     for (i = 1; i < n; i++) {       haha = k * i;       haha1 = (k + 1) * i;       endp = i + pre[i];       if (haha > endp) continue;       haha1 = min(haha1, n);       haha1 = min(haha1, endp);       adder[haha]++;       adder[haha1 + 1]--;     }     if (k == 1) {       adder[n]++;     }     for (i = 1; i <= n; i++) {       adder[i] += adder[i - 1];       if (adder[i])         cout << 1;       else         cout << 0;     }     return 0;   }   