How to solve DISTX on SPOJ?

Revision en2, by mr_knownothing, 2017-06-21 21:29:18

As the title is pretty clear, I want to solve this problem DISTX but I am unable to design any algorithm within time limit. The best I can think of is an n2 approach.

Can anyone please help me solve this problem?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English mr_knownothing 2017-06-21 21:29:18 0 (published)
en1 English mr_knownothing 2017-06-21 21:28:46 293 Initial revision (saved to drafts)