2 dimesional subset sum

Revision en1, by Mr.Bebra, 2022-04-29 19:01:55

How to solve 2 dimesional subset sum problem elegant?

2 dimesional subset sum is: You give $$$n$$$ pairs $$$x_i$$$, $$$y_i$$$, choose any $$$k$$$ elements that $$$x_1+x_2+...+ x_k = 0$$$ and $$$y_1+y_2+...+ y_k = 0$$$.

I can solve this only with dp on O($$$n^3$$$ $$$\cdot$$$ $$$c^2$$$), where $$$n$$$ — count elements and $$$c$$$ — max $$$x$$$ or $$$y$$$ element, and with bitset get optimaze on divide time to $$$64$$$. Also I can solve using meet-in-the-middle. Are all these solutions 2-d subset sum?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Mr.Bebra 2022-04-29 19:01:55 493 Initial revision for English translation
ru1 Russian Mr.Bebra 2022-04-29 19:01:09 493 Первая редакция (опубликовано)