We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e834484 commit d5da1c2Copy full SHA for d5da1c2
aoc/2025/09/09.vn.py
@@ -53,12 +53,13 @@ def inter(self, ray):
53
from tqdm.auto import tqdm
54
from functools import cache
55
from itertools import combinations
56
+import matplotlib.pyplot as plt
57
58
59
xs = sorted(set(x for x, y in inp))
60
ys = sorted(set(y for x, y in inp))
61
-
62
+original = inp
63
inp = [(xs.index(x), ys.index(y)) for x, y in inp]
64
65
edges = []
@@ -120,4 +121,17 @@ def inside(p):
120
121
if allIn:
122
res2 = max(res2, area)
123
-print(res1, res2)
124
+print(res1, res2)
125
+
126
+fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(16, 8))
127
128
+for i, (x, y) in enumerate(original):
129
+ x2, y2 = original[(i+1) % len(original)]
130
+ ax1.plot([x, x2], [y, y2], 'b-', marker='o')
131
132
+for i, (x, y) in enumerate(inp):
133
+ x2, y2 = inp[(i+1) % len(inp)]
134
+ ax2.plot([x, x2], [y, y2], 'r-', marker='o')
135
136
137
+plt.show()
script.js
@@ -21,7 +21,7 @@ const PACKAGES_TO_LOAD = [
21
// Common packages
22
'numpy',
23
// 'pandas',
24
- // 'matplotlib',
+ 'matplotlib',
25
// 'scikit-learn',
26
// 'scipy',
27
0 commit comments