# 506.相对名次

[原题](https://leetcode-cn.com/problems/relative-ranks/)

把每个人的分数和下标写入二元组，再根据分数排序即可

```python
class Solution:
    def findRelativeRanks(self, score: List[int]) -> List[str]:
        n = len(score)
        tmpS = []
        for i in range(n):
            tmpS.append((score[i], i))
        tmpS.sort(key = lambda x : -x[0])
        res = [0 ] * n		#最终结果。放0填充
        for i in range(n):
            if i == 0:	#第一名
                res[tmpS[i][1]] = "Gold Medal"
            elif i == 1:	#第二名
                res[tmpS[i][1]] = "Silver Medal"
            elif i == 2:	#第三名
                res[tmpS[i][1]] = "Bronze Medal"
            else:
                res[tmpS[i][1]] = str(i+1)
        return res
```
