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>
#define lp(i,a,b) for(int i = a ; i < b ;i++ )
#define pb push_back
#define ll long long
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define mk make_pair
#define ff first
#define ss second
#define pii pair<int,int>
const int MAXN = 1e5+10 ;
using namespace std ;
int N , M ;
int A[MAXN] ;
int main(){
ios_base::sync_with_stdio(false) ;
cin.tie(0) ;
cin >> N >> M ;
fill(A+1,A+1+N , 1 ) ;
for(int i =1 , a ,b , c ; 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 << A[i] << " ";
cout << "\n" ;
}
# | 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... |