Competitive Programming Problem Set Solutions
Problem T1
Problem Statement Given n team members with their individual speeds a[i] and carrying capacities w[i], determine the maximum achievable team speed where faster members can assist slower ones.
Solution Approach The key insight is that the answer exhibits monotonicity, making binary search applicable. If a target speed x can be achieve ...
Posted on Tue, 04 Aug 2026 16:22:54 +0000 by xpressmail
Optimizing Laser Path and Diagonal Grid Separation Problems
When solving this problem, precision errors in floating-point comparisons led to multiple failed submissions despite correct algorithmic logic. The challenge lies in grouping monsters by their directional vectors and efficiently computing the number of targets hit by a laser fired in a specific direction.
Monsters are represented as coordinate ...
Posted on Sat, 11 Jul 2026 17:06:05 +0000 by taha
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