cloudspokes / arena-web

Web arena for SRMs
44 stars 32 forks source link

Improved coder placement algorithm performance #1102

Closed Goodwine closed 9 years ago

Goodwine commented 9 years ago

Improved performance from Θ(n²) to O(nlogn)

Current algorithm can take a lot of time, and it times-out as described on Issue #1099

You can compare the algorithms with these gists:

One thing to note is that the original order is lost (because the array is sorted by totalPoints), but I didn't find any place that suggested that it would break something, in any case, I could update the code to revert the order if you wish.

Goodwine commented 9 years ago

Is this the right way of sending a pull request? Or should I create a new branch?