| 12345678910111213141516171819 |
- '''
- > https://www.codingame.com/ide/puzzle/darts
- @author: olivier.massot, 2019
- '''
- size = int(input())
- radius = size // 2
- players = [input() for _ in range(int(input()))]
- scores = {p: [] for p in players}
- for _ in range(int(input())):
- name_, x, y = input().split()
- x, y = int(x), int(y)
- score = 5 * (((abs(x) + abs(y)) <= radius) + ((x**2 + y**2) <= radius**2) + (abs(x) <= radius and abs(y) <= radius))
- scores[name_].append(score)
- for s, _, p in sorted([(sum(scores[p]), i, p) for i, p in enumerate(players)], key=lambda x: (x[0], -1*x[1]), reverse=True):
- print(f"{p} {s}")
|