func_code_string: #include <bits/stdc++.h>   int cc[3000];   int good(int i) {     return !(cc[i] == 0 && cc[i + 1] == 0 && cc[i + 2] == 1 && cc[i + 3] == 1) &&            !(cc[i] == 0 && cc[i + 1] == 1 && cc[i + 2] == 0 && cc[i + 3] == 1) &&            !(cc[i] == 1 && cc[i + 1] == 1 && cc[i + 2] == 1 && cc[i + 3] == 0) &&            !(cc[i] == 1 && cc[i + 1] == 1 && cc[i + 2] == 1 && cc[i + 3] == 1);   }   int main() {     static int dp[3000][3000], lcp[3000 + 1][3000 + 1], ll[3000];     int m, i, j, l, sum;     scanf( %d , &m);     for (i = 0; i < m; i++) scanf( %d , &cc[i]);     for (i = m - 1; i >= 0; i--)       for (j = m - 1; j >= 0; j--)         lcp[i][j] = cc[i] == cc[j] ? 1 + lcp[i + 1][j + 1] : 0;     for (i = 0; i < m; i++)       for (j = 0; j < i; j++)         if (ll[i] < lcp[i][j]) ll[i] = lcp[i][j];     for (i = 0; i < m; i++)       for (j = i; j < m; j++) {         if (j - i < 3 || (j - i == 3 && good(i)))           dp[i][j] = (dp[i][j] + 1) % 1000000007;         if (dp[i][j])           for (l = 1; l <= 4 && j + l < m; l++)             if (l < 4 || good(j + 1))               dp[i][j + l] = (dp[i][j + l] + dp[i][j]) % 1000000007;       }     sum = 0;     for (j = 0; j < m; j++) {       for (i = 0; i <= j; i++)         if (i + ll[i] <= j) sum = (sum + dp[i][j]) % 1000000007;       printf( %d n , sum);     }     return 0;   }   