#include <bits/stdc++.h>
using namespace std;
bool comp(array <int, 3> a, array <int, 3> b) {
return a[2] < b[2];
}
int main() {
int n, m;
cin >> n >> m;
vector <int> ans(n+1);
for (int i = 1; i <= m; i++) {
int a, b, c;
cin >> a >> b >> c;
ans[a] = max(ans[a], c);
ans[b] = max(ans[b], c);
}
for (int i = 1; i <= n; i++) {
if (ans[i] == 0)
ans[i] = 1e9;
cout << ans[i] << ' ';
}
cout << '\n';
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
336 KB |
Execution killed with signal 11 |
2 |
Runtime error |
1 ms |
336 KB |
Execution killed with signal 11 |
3 |
Runtime error |
1 ms |
592 KB |
Execution killed with signal 11 |
4 |
Runtime error |
2 ms |
336 KB |
Execution killed with signal 11 |
5 |
Runtime error |
1 ms |
336 KB |
Execution killed with signal 11 |
6 |
Runtime error |
1 ms |
336 KB |
Execution killed with signal 11 |
7 |
Runtime error |
2 ms |
1360 KB |
Execution killed with signal 11 |
8 |
Runtime error |
3 ms |
1360 KB |
Execution killed with signal 11 |
9 |
Runtime error |
2 ms |
1360 KB |
Execution killed with signal 11 |
10 |
Runtime error |
2 ms |
1360 KB |
Execution killed with signal 11 |