python 解法 while True: try: n = int(input()) res = {} for i in range(n): index, value = map(int,input().split()) if index in res: res[index] += value else: res[index] = value for key in sorted(res)...