- 签到题
- 卡了没关同步流的cin 以及莫名卡了python
- a在本题中没有作用
- 主要思路见下面代码即可
#include <iostream>
#include <map>
#include <unordered_map>
using namespace std;
typedef long long ll;
const int N = 1e6 + 10;
unordered_map<int, ll> mp;
int main() {
int n, m;
scanf("%d %d", &n, &m);
ll mx = -1, ans;
for (int i = 1; i <= m; i++) {
int x, y, z;
scanf("%d %d %d", &x, &y, &z);
mp[y] += z;
if (mp[y] > mx) {
mx = mp[y];
ans = y;
}
}
cout << ans << endl;
}