Time complexity of std::distance

Revision en1, by Ishan.nitj, 2016-07-05 22:07:03

I am trying to solve this problem http://codeforces.net/contest/652/problem/D. My approach is http://codeforces.net/contest/652/submission/18906153 which is nlogn and should pass the time constraint.However I am getting TLE. I think this might be due std::distance which i have used to calculate distance b/w 2 elements in set.Please HELP.

Tags education round 10, stl

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Ishan.nitj 2016-07-05 22:07:03 372 Initial revision (published)