Problem about pairs

Revision en1, by -is-this-dp, 2025-11-23 21:11:53

Can this problem be solved under the standard Time limits ? How ?

Given a multiset of $$$N$$$ pairs, answer $$$Q$$$ queries

A query can be of two types:

$$$1$$$ $$$x$$$ $$$y$$$: add pair $$$(x, y)$$$ to the multiset

$$$2$$$ $$$v$$$: return a pair where both $$$x$$$ and $$$y$$$ are not equal to $$$v$$$ or return $$$-1$$$ if there's no pair where both coordinates are not equal to $$$v$$$

$$$1 ≤ N,Q ≤ 1e5 $$$

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English -is-this-dp 2025-11-23 21:17:12 264 Tiny change: 'le 1e5 $\n' -> 'le 1e5 $\n\nSample input:\n'
en1 English -is-this-dp 2025-11-23 21:11:53 393 Initial revision (published)