I am having problems with magic ranking problem.
I am quite sure i am using the right approach and produce correct results in O(n^2) but I keep getting TLE .
would someone care to explain to me wat’s worng? thank you in advance .
and here is another solution with double array instead of vector and it gives me SIGSEGV .