参考大佬代码,写一下python的 import collections while True: try: n, r, avg = map(int, input().split()) score, time = 0, 0 cost_time = [] dic = collections.defaultdict(int) for _ in range(n): a, b = map(int, input().split()) cost_time.append(b...