Language: C++

#include <cstdio>
#include <vector>
#include <algorithm>

using namespace std;

using Weight=long long;
static const Weight INF=1LL<<57;

struct Edge {
    size_t src, dst;
    Weight weight;
    Edge() {}
    Edge(size_t src, size_t dst, Weight weight=1):
        src(src), dst(dst), weight(weight)
    {}
};

bool operator<(const Edge &e, const Edge &f) {
    if (e.weight != f.weight) {
        return e.weight > f.weight;
    } else {
        return e.src!=f.src? e.src<f.src : e.dst<f.dst;
    }
}

using Edges=vector<Edge>;
using Vertex=vector<Edge>;
using Graph=vector<Vertex>;

void join(Graph &g, size_t s, size_t d, Weight w=1) {
    // non-directed
    g[s].push_back(Edge(s, d, w));
    g[d].push_back(Edge(d, s, w));
}

void connect(Graph &g, size_t s, size_t d, Weight w=1) {
    // directed
    g[s].push_back(Edge(s, d, w));
}

Weight chinese_postman(const Graph &g) {
    size_t V=g.size();
    vector<vector<Weight>> h(V, vector<Weight>(V, INF));
    vector<size_t> deg(V);

    Weight total=0;
    for (size_t i=0; i<V; ++i)
        for (const Edge &e: g[i]) {
            if (e.src > e.dst) continue;

            if (h[e.src][e.dst] > e.weight)
                h[e.src][e.dst] = h[e.dst][e.src] = e.weight;

            ++deg[e.src], ++deg[e.dst];
            total += e.weight;
        }

    vector<size_t> oddnode;
    for (size_t i=0; i<V; ++i)
        if (deg[i] & 1)
            oddnode.push_back(i);

    for (size_t k=0; k<V; ++k)
        for (size_t i=0; i<V; ++i)
            for (size_t j=0; j<V; ++j)
                if (h[i][j] > h[i][k] + h[k][j])
                    h[i][j] = h[i][k] + h[k][j];

    size_t n=oddnode.size();
    vector<size_t> dp(1<<n, INF); dp[0]=0;

    for (size_t s=0; s<(1u<<n); ++s)
        for (size_t i=0; i<n; ++i) {
            if (1<<i & s) continue;

            for (size_t j=i+1; j<n; ++j) {
                if (1<<j & s) continue;

                size_t u=oddnode[i], v=oddnode[j];
                dp[1<<i|1<<j|s] = min(dp[1<<i|1<<j|s], dp[s]+h[u][v]);
            }
        }

    return total + dp[(1<<n)-1];
}

int main() {
    size_t V, E;
    scanf("%zu %zu", &V, &E);

    Graph g(V);
    for (size_t i=0; i<E; ++i) {
        size_t s, t;
        Weight d;
        scanf("%zu %zu %lld", &s, &t, &d);

        connect(g, s, t, d);
    }

    printf("%lld\n", chinese_postman(g));
    return 0;
}

Compiler output:
a.cc: In function 'Weight chinese_postman(const Graph&)':
a.cc:81:38: error: no matching function for call to 'min(__gnu_cxx::__alloc_traits<std::allocator<long unsigned int>, long unsigned int>::value_type&, long long unsigned int)'
   81 |                 dp[1<<i|1<<j|s] = min(dp[1<<i|1<<j|s], dp[s]+h[u][v]);
      |                                   ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:62,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:81:38: note:   deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'long long unsigned int')
   81 |                 dp[1<<i|1<<j|s] = min(dp[1<<i|1<<j|s], dp[s]+h[u][v]);
      |                                   ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:81:38: note:   mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int'
   81 |                 dp[1<<i|1<<j|s] = min(dp[1<<i|1<<j|s], dp[s]+h[u][v]);
      |                                   ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~