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;
int A[200005];
int main(){
int n,m,a,b,c;cin >> n >> m;
for(int i=1;i<=m;i++)cin >> a >> b >> c, A[a] = max(A[a], c), A[b] = max(A[b], c);
for(int i=1;i<=n;i++)cout << max(1, A[i]) << " " ;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |