// Rocky Mountain Regional Contest 2015: Amazing Race // Author: Per Austrin #include #include #include #include using namespace std; typedef vector vi; const double oo = 1<<20; int mint[1<<20][22], back[1<<20][22]; int n, T, p[30], t[30], d[30], A[30][30]; int MinT(int S, int at) { if (S & (1< ans || v == ans && vis < best) ans = v, best = vis; } } printf("%d\n", ans); for (int i = 0; i < best.size(); ++i) printf("%d%c", best[i], i==best.size()-1 ? '\n' : ' '); return 0; }