```
n, m = map(int, input().split())
x = {} # 记录每个人的偏移量
for _ in range(m):
a, b, c = map(int, input().split())
x[b] = x.get(b, 0) + c
max_x = max(x.values())
person_with_max_x = max(x, key=x.get)
print(person_with_max_x)
```遇到了time limit exceeded问题怎么解决