On a quick look I found these issues in your code:
Line 41: sort(player,0,n,temp); - I believe it should be sort(player,0,n-1,temp); instead.
Line 134: sort(player, imid, iend, temp); - Element at imid position has already been sorted in line 133. Why sort it again? It should be sort(player, imid+1, iend, temp); instead.
The discrepancy you are talking about is most probably due to processing of garbage values I pointed out above. In addition to it, your algorithm will give unexpected results if you execute it for N=1 case. I will leave it to you to figure out why.
An advice - declare your bigger arrays global or there is a great chance that you will get TLE. Again, I will leave it to you to figure out why