2 dimesional subset sum

Правка ru1, от Mr.Bebra, 2022-04-29 19:01:09

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?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Mr.Bebra 2022-04-29 19:01:55 493 Initial revision for English translation
ru1 Русский Mr.Bebra 2022-04-29 19:01:09 493 Первая редакция (опубликовано)