```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 the scores were given."""
    if not scores:
        return []

    ordered = sorted(scores, reverse=True)
    places = {}
    current_place = len(ordered)
    for value in ordered:
        places[value] = current_place
        current_place -= 1

    return [places[score] for score in scores]
```