Algorithm Analysis: Rectangle Intersection and Index Marking
Maximum Square Area in Rectangle IntersectionWhen given coordinates for the bottom-left and top-right corners of multiple axis-aligned rectangles, the goal is to determine the area of the largest square that can fit entirely within the intersection of any two rectangles. The core logic involves identifying the overlapping region. If two rectang ...
Posted on Wed, 24 Jun 2026 17:56:22 +0000 by ChaosKnight
Finding Line Intersections with Cross Product
Vector Representation of Lines
Key concepts:
Treat points as vectors to leverage vector addision for point translation.
Represent lines using a point plus a direction vector, wich naturally handles vertical lines.
Consider two lines intersecting at point I. Line 1 is defined by point p₁ and direction vector v₁, while Line 2 uses point p₂ and ...
Posted on Sat, 13 Jun 2026 17:15:08 +0000 by GrexP
Solving Key Problems from Codeforces Round 1057 (Div. 2)
A. Apple Tree Ring
Given a sequence of integers representing apple counts on trees arranged in a circle, determine the maximum number of distinct values that can be consumed under infinite rotations. Since rotations allow arbitrary reordering over time, the optimal strategy is to consume one unique value per round. Hence, the answer equals the ...
Posted on Tue, 26 May 2026 23:07:05 +0000 by interpim