```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."""
    ordered = sorted(scores, reverse=True)
    ranks = []
    current_rank = 1
    for i, value in enumerate(ordered):
        if i > 0 and value != ordered[i - 1]:
            current_rank = i + 1
        ranks.append(current_rank)
    rank_map = {value: rank for value, rank in zip(ordered, ranks)}
    return [rank_map[score] for score in scores]
```