#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const ll maxN = 3e5+10;
ll n, m;
ll v[maxN]={0};
int main()
{
ios_base::sync_with_stdio(0);cin.tie(nullptr);
cin>>n>>m;
for(int i = 0; i < m; i++){
ll aa, bb, cc;
cin>>aa>>bb>>cc;
v[aa]+=cc;
v[bb]+=cc;
}
ll res=0;
for(int i = 1; i <= n; i++){
res=max(res, v[i]);
}
cout<<res;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
300 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
300 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
32 ms |
4832 KB |
Output is correct |
2 |
Correct |
66 ms |
7120 KB |
Output is correct |
3 |
Incorrect |
19 ms |
2372 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
32 ms |
4832 KB |
Output is correct |
2 |
Correct |
66 ms |
7120 KB |
Output is correct |
3 |
Incorrect |
19 ms |
2372 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |