# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1104281 | overwatch9 | ZigZag (COCI17_zigzag) | C++17 | 3 ms | 1360 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 |
---|---|---|---|---|
Fetching results... |