func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, m;   int L[36000], R[36000];   int D[36000], U[36000];   int C[36000];   int S[185], H[185], mark[36000], OK[185], tans[36000];   int ak, size;   void Link(int r, int c) {     S[c]++;     C[size] = c;     U[size] = U[c];     D[U[c]] = size;     D[size] = c;     U[c] = size;     if (H[r] == -1)       H[r] = L[size] = R[size] = size;     else {       L[size] = L[H[r]];       R[L[H[r]]] = size;       R[size] = H[r];       L[H[r]] = size;     }     mark[size] = r;     size++;   }   void remove(int c) {     int i;     for (i = D[c]; i != c; i = D[i]) L[R[i]] = L[i], R[L[i]] = R[i];   }   void resume(int c) {     int i;     for (i = U[c]; i != c; i = U[i]) L[R[i]] = R[L[i]] = i;   }   int h() {     int i, j, k, count = 0;     bool visit[185];     memset(visit, 0, sizeof(visit));     for (i = R[0]; i; i = R[i]) {       if (visit[i]) continue;       count++;       visit[i] = 1;       for (j = D[i]; j != i; j = D[j]) {         for (k = R[j]; k != j; k = R[k]) visit[C[k]] = 1;       }     }     return count;   }   void Dance(int k) {     int i, j, c, Min, ans;     ans = h();     if (k + ans >= ak) return;     if (!R[0]) {       if (k < ak) {         ak = k;         for (int i = 0; i < k; i++) {           tans[i] = mark[OK[i]];         }       }       return;     }     for (Min = 185, i = R[0]; i; i = R[i])       if (S[i] < Min) Min = S[i], c = i;     for (i = D[c]; i != c; i = D[i]) {       OK[k] = i;       remove(i);       for (j = R[i]; j != i; j = R[j]) remove(j);       Dance(k + 1);       for (j = L[i]; j != i; j = L[j]) resume(j);       resume(i);     }     return;   }   int xx[5] = {0, 0, 0, 1, -1};   int yy[5] = {0, 1, -1, 0, 0};   int mat[400][400];   int main() {     int tn, tm;     while (scanf( %d%d , &tn, &tm) == 2) {       memset(mat, 0, sizeof(mat));       for (int i = 1; i <= tn; i++) {         for (int j = 1; j <= tm; j++) {           for (int k = 0; k < 5; k++) {             int x = i + xx[k], y = j + yy[k];             if (x >= 1 && x <= tn && y >= 1 && y <= tm) {               mat[(i - 1) * tm + j][(x - 1) * tm + y] = 1;             }           }         }       }       n = tn * tm, m = tn * tm;       for (int i = 0; i <= m; i++) {         S[i] = 0;         U[i] = D[i] = i;         L[i + 1] = i;         R[i] = i + 1;       }       R[m] = 0;       memset(H, -1, sizeof(H));       memset(mark, 0, sizeof(mark));       memset(tans, 0, sizeof(tans));       size = m + 1;       for (int i = 1; i <= n; i++) {         for (int j = 1; j <= m; j++) {           if (mat[i][j]) Link(i, j);         }       }       ak = 185;       Dance(0);       printf( %d n , n - ak);     }     return 0;   }   