aboutsummaryrefslogtreecommitdiff
path: root/2025/README.md
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-12-09 21:46:42 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2025-12-09 21:46:42 +0100
commit4dc2097b38697614dba7a58bf2ec53e1e54e52fe (patch)
tree0df81e531ef9e0551eaf5be64da6de088d86ce1b /2025/README.md
parente87e83de464a2ee47d020fbe532f6f558fa83369 (diff)
downloadaoc-4dc2097b38697614dba7a58bf2ec53e1e54e52fe.tar.gz
aoc-4dc2097b38697614dba7a58bf2ec53e1e54e52fe.zip
Fixed part 2 for edge cases not present in input file
Diffstat (limited to '2025/README.md')
-rw-r--r--2025/README.md25
1 files changed, 25 insertions, 0 deletions
diff --git a/2025/README.md b/2025/README.md
index c1d3f2c..d75a4d3 100644
--- a/2025/README.md
+++ b/2025/README.md
@@ -148,3 +148,28 @@ and in fact I wasted a lot of time searching a quadratic or O(n^2log n)
148solution before I focused on formalizing a cubic one. The problem is that 148solution before I focused on formalizing a cubic one. The problem is that
149I did not have smaller inputs to try my code against, so I this solution 149I did not have smaller inputs to try my code against, so I this solution
150was too slow I did not have any way to check that it was at least correct. 150was too slow I did not have any way to check that it was at least correct.
151
152EDIT (about 12h after solving part 2): apparently my algorithm is not
153entirely correct. In particular, it can fail by selecting a rectangle
154that is completely external to the figure and none of whose sides overlaps
155any of the lines.
156
157For example with this input:
158
159```
160101,51
161101,0
1620,0
1630,2
1641,2
1651,1
166100,1
167100,50
16899,50
16999,51
170101,51
171```
172
173The first version of my program return 4851 instead of 202. I added a
174check for this case in `b-fixed.py`, hopefully it works in 100% of the
175cases now.

Generated with cgit - Back to sebastiano.tronto.net