aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/2015/day14/aoc.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/2015/day14/aoc.h b/src/2015/day14/aoc.h
index 63b584c..5772e99 100644
--- a/src/2015/day14/aoc.h
+++ b/src/2015/day14/aoc.h
@@ -65,9 +65,10 @@ struct olympics {
x.pop();
}
x.push(i);
- }
- if (ps[i] == ps[x.top()]) {
- x.push(i);
+ } else {
+ if (ps[i] == ps[x.top()]) {
+ x.push(i);
+ }
}
}
while (!x.empty()) {