func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, sum, dp[1 << 16], arc[16][16], d[16];   void Floyd() {     int k, i, j;     for (k = 0; k < n; k++)       for (i = 0; i < n; i++)         for (j = 0; j < n; j++) arc[i][j] = min(arc[i][j], arc[i][k] + arc[k][j]);   }   int getans() {     int i, j, x, t, totol;     Floyd();     for (i = 1; i < n; i++)       if (d[i] && arc[0][i] > 1000000007) return -1;     memset(dp, 0x7f, sizeof(dp));     dp[0] = 0;     totol = (1 << n) - 1;     for (t = 0; t <= totol; t++) {       for (i = 0; i < n; i++)         if (d[i] % 2 && (t & (1 << i))) break;       if (i == n) dp[t] = 0;       for (i = 0; i < n; i++)         if (d[i] % 2 && !(t & (1 << i)))           for (j = i + 1; j < n; j++)             if (d[j] % 2 && !(t & (1 << j)) && arc[i][j] < 1000000007)               dp[t | (1 << i) | (1 << j)] =                   min(dp[t | (1 << i) | (1 << j)], dp[t] + arc[i][j]);     }     if (dp[totol] > 1000000007) return -1;     return sum + dp[totol];   }   int main() {     int m;     while (~scanf( %d%d , &n, &m)) {       sum = 0;       memset(arc, 0x3f, sizeof(arc));       memset(d, 0, sizeof(d));       for (int i = 1; i <= m; i++) {         int x, y, l;         scanf( %d%d%d , &x, &y, &l);         sum += l;         x--, y--;         arc[y][x] = arc[x][y] = min(arc[x][y], l);         d[x]++, d[y]++;       }       printf( %d n , getans());     }     return 0;   }   