func_code_string: #include <bits/stdc++.h>   const int MaxN = 300;   using namespace std;   int n, m;   long long K;   int A1[MaxN + 5][2], A3[MaxN + 5][MaxN + 5];   const long long INF = 1e18;   long long A2[MaxN + 5][MaxN + 5];   int fail[MaxN + 5];   void Get(string s) {     int z = (int)s.length();     fail[0] = 0;     for (int i = 1; i < z; i++) {       int j = fail[i - 1];       while (j > 0 && s[j] != s[i]) j = fail[j - 1];       if (s[j] == s[i]) j++;       fail[i] = j;     }     for (int i = 0; i <= z; i++) {       for (int j = 0; j < 2; j++) {         if (i < z && s[i] == char( 0  + j))           A1[i][j] = i + 1;         else if (i == 0)           A1[i][j] = 0;         else           A1[i][j] = A1[fail[i - 1]][j];       }     }     for (int i = 0; i <= z; i++) {       for (int j = 0; j < 2; j++) {         A3[i][j] = A1[i][j];         A2[i][j] = (A3[i][j] == z ? 1 : 0);       }     }     for (int i = 2; i <= n; i++) {       for (int j = 0; j <= z; j++) {         A3[j][i] = A3[A3[j][i - 2]][i - 1];         A2[j][i] = min((A2[j][i - 2] + A2[A3[j][i - 2]][i - 1]), INF);       }     }   }   int main() {     while (~scanf( %d%lld%d , &n, &K, &m)) {       string res =   ;       for (int i = 0; i < m; i++) {         if (res !=   ) Get(res);         int x = 0;         if (res !=    && A3[0][n] == i) x = 1;         if (K == 1 && x == 1) break;         K -= x;         Get(res +  0 );         long long tmp = A2[0][n];         if (K > tmp) {           res +=  1 ;           K -= tmp;         } else           res +=  0 ;       }       cout << res << endl;     }     return 0;   }   