Submission #1104283

#TimeUsernameProblemLanguageResultExecution timeMemory
1104283toast12Lost Array (NOI19_lostarray)C++14
100 / 100
58 ms848 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; vector<int> ans(n+1, 1); for (int i = 0; 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++) cout << ans[i] << ' '; cout << '\n'; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...