```python
def rank_of(score: int, scores: list) -> int:
    above = 0
    for other in scores:
        if other > score:
            above += 1
    return above + 1


def rank_all(scores: list) -> list:
    """Each score's rank, in the order they were given."""
    ordered = sorted(set(scores), reverse=True)
    places = {}
    rank = 1
    for value in ordered:
        if value not in places:
            places[value] = rank
            rank += 1
    return [places[score] for score in scores]
```