 # ELOMAX (Ratings and Rankings) help

Logic -

• Each row of matrix (N x M+3) will store the ratings at the end of M months, month of highest rating achieved, best ranking achieved, month of best ranking.

• For each row, find the max rating of each participant and store in (M+1)th column.

• Sort each month (column) row wise in descending order of rating. Find the ranks of each participant at the end of first month and store in (M+2)th column.

• For subsequent months (column) after sorting row wise find ranks of each participant (row) and replace it with the rank in (M+2)th column only if the current rank is better (less). Then store that month in (M+3)th column.

This solution is not working except the example test cases of the question -
https://www.codechef.com/viewsolution/37275144

Simple idea is.
Store the max rating month wise.
Then create a ranking table.
Using the ranking table find the best ranking’s month and compare it with max rating month. If they are different increase the count
https://www.codechef.com/viewsolution/37341243

Thanks @shim98. I did a similar approach. But can not figure out what is wrong in my code. Its giving WA.

Where are you finding the max rating month in your code?