summaryrefslogtreecommitdiff
path: root/16.c
diff options
context:
space:
mode:
Diffstat (limited to '16.c')
-rw-r--r--16.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/16.c b/16.c
index 4dff42c..6ad137e 100644
--- a/16.c
+++ b/16.c
@@ -157,7 +157,6 @@ valve_setdests(struct valve * v, struct valve * others, int nothers)
}
-#if 0
void
valve_distances_dump(struct valve const * valves, int nvalves, int * dists)
{
@@ -178,7 +177,6 @@ valve_distances_dump(struct valve const * valves, int nvalves, int * dists)
}
fprintf(stderr, "\n");
}
-#endif
// Precalculate distances between all pairs of valves
@@ -318,6 +316,8 @@ main(int argc, char ** argv)
// Calculate distances between all valves
dists = valve_distances(valves, nvalves);
+ if (debug)
+ valve_distances_dump(valves, nvalves, dists);
// Find start position
for (v = valves; v < valves + nvalves && !start; ++v) {
@@ -369,6 +369,7 @@ main(int argc, char ** argv)
// Is it a new high?
if (flow > max) {
+ max = flow;
if (debug) {
int j;
fprintf(stderr, "Found new max flow: %d: %s", max, start->name);
@@ -376,7 +377,6 @@ main(int argc, char ** argv)
fprintf(stderr, "->%s", path[j]->name);
fprintf(stderr, "\n");
}
- max = flow;
}
if (i < nflows) {