1285 - Final Standings

Discussion around the problems of the COJ.
Forum rules
Remember that posting AC code is not allowed here. If you are going to ask a question or to post a solution, describe your algorithm instead. Posting AC code will be penalized.
Post Reply
User avatar
dovier
Posts: 1143
Joined: 7 years ago
Location: Havana, Cuba
Gender: Male
Cuba

1285 - Final Standings

Post by dovier » 7 years ago




aslf010990
Posts: 3
Joined: 7 years ago
Gender: None specified

Re: 1285 - Final Standings

Post by aslf010990 » 7 years ago

I can help with this problem I have time limit exceeded in the first test, I am using bubble sort method greetings

User avatar
padrinoIJ
Posts: 13
Joined: 7 years ago
Location: CUJAE
Gender: None specified

Re: 1285 - Final Standings

Post by padrinoIJ » 7 years ago

For this problem, classical bubble sort implementation is slow, you should use a faster method that the BS, but with same principle, regards, carlos

User avatar
padrinoIJ
Posts: 13
Joined: 7 years ago
Location: CUJAE
Gender: None specified

Re: 1285 - Final Standings

Post by padrinoIJ » 7 years ago

You can solve to this problem using stable_sort (algorithm) and with a simple overload of operator for compare, the code function is here:

Code: Select all

stable_sort( init , end, comp() );
Regards padrino_IJ, :P

Post Reply

Return to “Problem set”