Submission #1104281

#TimeUsernameProblemLanguageResultExecution timeMemory
1104281overwatch9ZigZag (COCI17_zigzag)C++17
0 / 80
3 ms1360 KiB
#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 timeMemoryGrader output
Fetching results...