๐ WAYPOINT LESSON
Final 1-A: Inversion Doubles
โญ beginnerโณ 40 min read๐ Lesson 203 of 281
Final simulation, problem A: sweep + BIT with negative values. Target: solved within 40 minutes.
Final 1-A โ Inversion Doubles. Count a[i] > 2*a[j] pairs over 200000 possibly-negative values: coordinate-compress {a, 2a}, sweep right-to-left with a Fenwick tree. Graded near-miss: all-pairs scan.
Final 1-A. The sweep reuses the inversion template with a doubling twist; negatives cost nothing because only ranks matter.