PrevNext
Not Frequent
 0/9

Range Queries with Sweep Line

Authors: Benjamin Qi, Andi Qu

Solving 2D grid problems using 1D range queries.

Focus Problem – read through this problem before continuing!

Focus Problem – read through this problem before continuing!

Tutorial

This section is not complete.

Feel free to file a request to complete this using the "Contact Us" button.

Solution - Intersection Points

This section is not complete.

Feel free to file a request to complete this using the "Contact Us" button.

Solution - Springboards

This section is not complete.

Feel free to file a request to complete this using the "Contact Us" button.

The problem boils down to having a data structure that supports the following operations:

  1. Add a pair .
  2. For any , query the minimum value of over all pairs satisfying .

The other module describes a simpler way of doing this, though it's probably more straightforward to do coordinate compression and use a min segtree. The latter approach is shown below.

1/**
2 * Description: 1D point update, range query where \texttt{comb} is
3 * any associative operation. If $N=2^p$ then \texttt{seg[1]==query(0,N-1)}.
4 * Time: O(\log N)
5 * Source:
6 * http://codeforces.com/blog/entry/18051
7 * KACTL
8 * Verification: SPOJ Fenwick
9 */
10

Problems

StatusSourceProblem NameDifficultyTagsSolutionURL
HEEasyShow Sketch
PlatNormal
Show Tags

PURQ

External Sol
CSESHard
Show Tags

PURQ

View Solution
IZhOHardView Solution

Relating to LIS:

StatusSourceProblem NameDifficultyTagsSolutionURL
Balkan OIHard
Show Tags

DP, BIT

External Sol
COCIHard
Show Tags

DP, BIT

External Sol
PlatVery Hard
Show Tags

DP

External Sol

Module Progress:

Join the USACO Forum!

Stuck on a problem, or don't understand a module? Join the USACO Forum and get help from other competitive programmers!

Give Us Feedback on Range Queries with Sweep Line!

PrevNext